Skip to content

Commit 2817b23

Browse files
committed
[sw,cryptolib] Update ECC random scalar gen function header
This commit updates the ECC random secret scalar generation function header. I checked the implementation for FIPS 186-5 compliance and updated the header comment accordingly. Signed-off-by: Hakim Filali <[email protected]>
1 parent e431c33 commit 2817b23

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

sw/otbn/crypto/p256_base.s

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,10 +1618,10 @@ p256_base_mult:
16181618
*
16191619
* Returns t, a random value that is nonzero mod n, in shares.
16201620
*
1621-
* This follows a modified version of the method in FIPS 186-4 sections B.4.1
1622-
* and B.5.1 for generation of secret scalar values d and k. The computation
1623-
* in FIPS 186-4 is:
1624-
* seed = RBG(seedlen) // seedlen >= 320
1621+
* This follows a modified version of the method in FIPS 186-5 sections A.2.2
1622+
* and A.3.2 for generation of secret scalar values d and k. The computation
1623+
* in FIPS 186-5 is:
1624+
* seed = RBG(seedlen) // seedlen >= 256
16251625
* return (seed mod (n-1)) + 1
16261626
*
16271627
* The important features here are that (a) the seed is at least 64 bits longer

sw/otbn/crypto/p384_keygen.s

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
*
1414
* Returns t, a random value that is nonzero mod n, in shares.
1515
*
16-
* This follows a modified version of the method in FIPS 186-4 sections B.4.1
17-
* and B.5.1 for generation of secret scalar values d and k. The computation
18-
* in FIPS 186-4 is:
19-
* seed = RBG(seedlen) // seedlen >= 448
16+
* This follows a modified version of the method in FIPS 186-5 sections A.2.2
17+
* and A.3.2 for generation of secret scalar values d and k. The computation
18+
* in FIPS 186-5 is:
19+
* seed = RBG(seedlen) // seedlen >= 384
2020
* return (seed mod (n-1)) + 1
2121
*
2222
* The important features here are that (a) the seed is at least 64 bits longer

0 commit comments

Comments
 (0)