Use symmetric crypto from rust-bitcoin primitives to prep for 0.7 - #13
Merged
Merged
Conversation
Replace the `hkdf` and `sha2` dependencies with a direct RFC 5869 implementation over `bitcoin_hashes`' HMAC, keeping SHA-256/384/512 support and the existing public interface. bitcoin_hashes ships HMAC but no HKDF, so Extract/Expand are written out here; Expand rejects lengths needing more than 255 blocks, which the `hkdf` crate enforced. The RFC 5869 test vectors already in this module (appendix A.1-A.3) pass unchanged, so derived key material is byte-identical.
With AES-GCM no longer selectable, `rh/aead.rs` needs no dispatch enum, so it is rewritten directly onto the rust-bitcoin `chacha20-poly1305` crate. That crate is detached and in-place, so seal appends the tag and open splits it off; `Aead::new` now rejects the GCM algorithm ids rather than constructing an engine for them. This drops `aead`, `aes-gcm`, and `chacha20poly1305`, leaving `bitcoin_hashes` and `chacha20-poly1305` as the only crypto dependencies. `Error::Aead` loses its `aead::Error` source and becomes a unit variant. Both crates implement RFC 8439, so ciphertexts are unchanged: the QUIC ChaCha20-Poly1305 test vector still passes. The two QUIC AES-GCM vectors are dropped with the engines they exercised, and a test is added asserting that the GCM ids are rejected.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.