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

Blake2 method KeyInit::new is incorrect and not tested #433

Closed
vlad9486 opened this issue Nov 11, 2022 · 2 comments · Fixed by #435
Closed

Blake2 method KeyInit::new is incorrect and not tested #433

vlad9486 opened this issue Nov 11, 2022 · 2 comments · Fixed by #435

Comments

@vlad9486
Copy link
Contributor

Now it is crashing:

#[cfg(test)]
#[test]
fn blake2b_trivial() {
    use blake2::{Blake2bMac512, digest::KeyInit};

    <Blake2bMac512 as KeyInit>::new(&Default::default());
}

Because of this

core: <$hash>::new_with_params(key, &[], key.len(), OutSize::USIZE),

This line is passing key as salt, but it should not.

@vlad9486
Copy link
Contributor Author

#432

@newpavlov
Copy link
Member

newpavlov commented Nov 11, 2022

The issue is fixed in v0.10.5. I will close this issue after tests for KeyInit::new will be added.

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