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

Argon2: add constant for recommended salt length #306

Merged

Conversation

falko17
Copy link
Contributor

@falko17 falko17 commented Jun 8, 2022

The specification of argon2 recommends a salt length of 16 bytes for password hashing (section 3.1).
This pull request introduces a constant RECOMMENDED_SALT_LEN to make this recommended salt length accessible to users.
(Also, a slight mistake in the documentation has been corrected.)

@tarcieri
Copy link
Member

tarcieri commented Jun 8, 2022

Note: this is identical to password_hash::Salt::RECOMMENDED_LENGTH

@falko17
Copy link
Contributor Author

falko17 commented Jun 8, 2022

Oh, that's true, didn't notice that. Should I remove RECOMMENDED_SALT_LEN again, or should I just set its value to Salt::RECOMMENDED_LENGTH?

@tarcieri
Copy link
Member

tarcieri commented Jun 8, 2022

The latter (effectively re-exporting the constant) is fine.

@falko17 falko17 force-pushed the argon2-recommended-salt-length branch 2 times, most recently from 4db553c to 7578316 Compare June 8, 2022 14:03
@falko17
Copy link
Contributor Author

falko17 commented Jun 8, 2022

Sorry for the notifications, I was stumbling around with the features a bit. I believe it should work now, though the new constant is only available if the password-hash feature is enabled.

@falko17 falko17 force-pushed the argon2-recommended-salt-length branch from 161d74e to 2cfe157 Compare June 8, 2022 14:15
argon2/src/lib.rs Outdated Show resolved Hide resolved
The specification of argon2 recommends a salt length of
16 bytes for password hashing (section 3.1).
This commit adds a constant to make this recommended
salt length accessible to users by re-exporting
`password_hash::Salt::RECOMMENDED_LENGTH`.
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 this pull request may close these issues.

None yet

2 participants