diff --git a/sw/otbn/crypto/p256_base.s b/sw/otbn/crypto/p256_base.s index 60cfc7fc726bf..85b30f60de162 100644 --- a/sw/otbn/crypto/p256_base.s +++ b/sw/otbn/crypto/p256_base.s @@ -1580,10 +1580,10 @@ p256_base_mult: * * Returns t, a random value that is nonzero mod n, in shares. * - * This follows a modified version of the method in FIPS 186-4 sections B.4.1 - * and B.5.1 for generation of secret scalar values d and k. The computation - * in FIPS 186-4 is: - * seed = RBG(seedlen) // seedlen >= 320 + * This follows a modified version of the method in FIPS 186-5 sections A.2.2 + * and A.3.2 for generation of secret scalar values d and k. The computation + * in FIPS 186-5 is: + * seed = RBG(seedlen) // seedlen >= 256 * return (seed mod (n-1)) + 1 * * The important features here are that (a) the seed is at least 64 bits longer @@ -1893,7 +1893,7 @@ boolean_to_arithmetic: * d = (d0 + d1) mod n * ...where n is the curve order. * - * This implementation follows FIPS 186-4 section B.4.1, where we + * This implementation follows FIPS 186-5 section A.2.2, where we * generate d using N+64 random bits (320 bits in this case) as a seed. But * while FIPS computes d = (seed mod (n-1)) + 1 to ensure a nonzero key, we * instead just compute d = seed mod n. The caller MUST ensure that if this diff --git a/sw/otbn/crypto/p384_keygen.s b/sw/otbn/crypto/p384_keygen.s index 73bd3a4d7e5de..8f82f0c5400c9 100644 --- a/sw/otbn/crypto/p384_keygen.s +++ b/sw/otbn/crypto/p384_keygen.s @@ -13,10 +13,10 @@ * * Returns t, a random value that is nonzero mod n, in shares. * - * This follows a modified version of the method in FIPS 186-4 sections B.4.1 - * and B.5.1 for generation of secret scalar values d and k. The computation - * in FIPS 186-4 is: - * seed = RBG(seedlen) // seedlen >= 448 + * This follows a modified version of the method in FIPS 186-5 sections A.2.2 + * and A.3.2 for generation of secret scalar values d and k. The computation + * in FIPS 186-5 is: + * seed = RBG(seedlen) // seedlen >= 384 * return (seed mod (n-1)) + 1 * * The important features here are that (a) the seed is at least 64 bits longer