Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update crypto-mac to 0.11 in blake2 #330

Closed
Eijebong opened this issue Dec 7, 2021 · 1 comment · Fixed by #217
Closed

Update crypto-mac to 0.11 in blake2 #330

Eijebong opened this issue Dec 7, 2021 · 1 comment · Fixed by #217

Comments

@Eijebong
Copy link

Eijebong commented Dec 7, 2021

Trying to cleanup a dependency tree where we have 3 versions of crypto-mac, one of them from blake2. Would be nice if you could update it.

I tried doing it myself but can't figure out why tests are broken. Here's the diff:

diff --git a/blake2/Cargo.toml b/blake2/Cargo.toml
index 6d25e15..925a325 100644
--- a/blake2/Cargo.toml
+++ b/blake2/Cargo.toml
@@ -13,12 +13,12 @@ categories = ["cryptography", "no-std"]

 [dependencies]
 digest = "0.9"
-crypto-mac = "0.8"
+crypto-mac = "0.11.1"
 opaque-debug = "0.3"

 [dev-dependencies]
 digest = { version = "0.9", features = ["dev"] }
-crypto-mac = { version = "0.8", features = ["dev"] }
+crypto-mac = { version = "0.11.1", features = ["dev"] }
 hex-literal = "0.2"

 [features]
diff --git a/blake2/src/blake2.rs b/blake2/src/blake2.rs
index 3255a30..e7ea513 100644
--- a/blake2/src/blake2.rs
+++ b/blake2/src/blake2.rs
@@ -375,7 +375,7 @@ macro_rules! blake2_impl {
                 Self { state }
             }

-            fn new_varkey(key: &[u8]) -> Result<Self, InvalidKeyLength> {
+            fn new_from_slice(key: &[u8]) -> Result<Self, InvalidKeyLength> {
                 if key.len() > $bytes::to_usize() {
                     Err(InvalidKeyLength)
                 } else {
@newpavlov
Copy link
Member

newpavlov commented Dec 7, 2021

crypto-mac functionality will be merged into digest v0.10, so this issue will be fixed in the next blake2 release, see #217.

The tests are failing because storage format of test vectors has changed a bit between crypto-mac v0.10 and v0.11

@newpavlov newpavlov transferred this issue from RustCrypto/traits Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants