-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Incorrect digest with hmac-blake2s #19
Comments
Thank you for reporting this! The problem is in the |
Done! I've published |
Confirmed working. |
I think it would be worthwhile to file a RustSec advisory for this. The affected version was released October 2018 while the fixed version was released August this year. Also, according to libs.rs, the Note: I haven't checked the other versions. |
This definitely falls under RustSec's "cryptographic failure" category |
@tarcieri |
@newpavlov sure |
BLAKE2b and BLAKE2s were implemented using the wrong block size. All versions of the `blake2` crate prior to v0.8.1 compute incorrect digests. See: RustCrypto/MACs#19
Opened a PR with an advisory here: rustsec/advisory-db#151 |
BLAKE2b and BLAKE2s were implemented using the wrong block size. All versions of the `blake2` crate prior to v0.8.1 compute incorrect digests. See: RustCrypto/MACs#19
I seem to be getting incorrect results when using the hmac crate with blake2s. I have verified that the implementation of the hash functions themselves behave identically.
HMAC-Blake2s : mismatching output
MACing the empty message with the empty key, using Go
/x/crypto
for reference:Go Playground
Outputs
eaf4bb25938f4d20e72656bbbc7a9bf63c0c18537333c35bdb67db1402661acd
Outputs
972c8a67004c0a295f6aa879b2130cada52849501e36bd1791b588a356ea852f
HMAC-SHA256 : identical output
The same behaviour does not occur when instantiating HMAC with SHA256:
Go Playgound
Outputs
b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad
Outputs
b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad
I have reason to believe the Rust implementation is at fault: the Go code is used in
wireguard-go
and successfully performs cryptographic handshakes with other compatible clients.The text was updated successfully, but these errors were encountered: