Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

Commit dce6bb1

Browse files
ecc_dh: Fix discrepancy of ecc_make_key definition and declaration
ecc_make_key declaration has random size of NUM_ECC_DIGITS * 2 but definition has (and use) only NUM_ECC_DIGITS. See: https://gerrit.zephyrproject.org/r/#/c/1982 Change-Id: I696d1ecfca439545ac4a7995500bfb7cb8ed2db5 Signed-off-by: Flavio Santes <[email protected]>
1 parent 1d9047f commit dce6bb1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/include/tinycrypt/ecc_dh.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,20 @@ extern "C" {
8383
* @return returns TC_CRYPTO_SUCCESS (1) if the key pair was generated successfully
8484
* returns TC_CRYPTO_FAIL (0) if:
8585
* the private key is 0
86-
86+
*
8787
* @param p_publicKey OUT -- the point representing the public key.
8888
* @param p_privateKey OUT -- the private key.
8989
* @param p_random IN -- The random number to use to generate the key pair.
9090
*
9191
* @note You must use a new non-predictable random number to generate each
9292
* new key pair.
93-
* @note p_random must have NUM_ECC_DIGITS*2 bits of entropy to eliminate
94-
* bias in keys.
9593
*
9694
* @note side-channel countermeasure: algorithm strengthened against timing
9795
* attack.
9896
*/
9997
int32_t ecc_make_key(EccPoint *p_publicKey,
10098
uint32_t p_privateKey[NUM_ECC_DIGITS],
101-
uint32_t p_random[NUM_ECC_DIGITS * 2]);
99+
uint32_t p_random[NUM_ECC_DIGITS]);
102100

103101
/**
104102
* @brief Determine whether or not a given point is on the chosen elliptic curve

0 commit comments

Comments
 (0)