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: Fix Params docs #458

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

sorairolake
Copy link
Contributor

@sorairolake sorairolake commented Sep 5, 2023

  • The minimum value of m_cost is 8 ( 8*MIN_OUTPUT_LEN), not 1.
  • The maximum value of p_cost is (2^24)-1, not 255.

These are defined in RFC 9106, and MIN_M_COST and MAX_P_COST are also like that.

See also: #451, #452

* The minimum value of `m_cost` is 8, not 1.
* The maximum value of `p_cost` is (2^24)-1, not 255.
Copy link
Member

@tarcieri tarcieri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified these match the RFC.

@tarcieri tarcieri merged commit 144b2e4 into RustCrypto:master Sep 5, 2023
13 checks passed
@sorairolake sorairolake deleted the fix-argon2-params-doc branch September 5, 2023 13:25
@sorairolake
Copy link
Contributor Author

Params::new verifies that m_cost is greater than or equal to p_cost*8.

if m_cost < p_cost * 8 {
return Err(Error::MemoryTooLittle);
}

So, it might be better to explain that the minimum value of m_cost is p_cost*8 instead of 8.

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.

2 participants