Skip to content

Argon2: Fix Params docs#458

Merged
tarcieri merged 1 commit intoRustCrypto:masterfrom
sorairolake:fix-argon2-params-doc
Sep 5, 2023
Merged

Argon2: Fix Params docs#458
tarcieri merged 1 commit intoRustCrypto:masterfrom
sorairolake:fix-argon2-params-doc

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
@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