mirror of
https://github.com/kmackay/micro-ecc.git
synced 2026-09-07 01:30:09 +00:00
Updated and generalized random number generation function
(uECC_generate_random_int). This function is also used internally. In the new implementation when the random number is outside of the requested range it is corrected by subtraction instead of requesting new random number.
This commit is contained in:
committed by
Ken MacKay
parent
8b3838ea5f
commit
7b115fdf93
+5
-2
@@ -155,8 +155,11 @@ void uECC_point_mult(uECC_word_t *result,
|
||||
const uECC_word_t *scalar,
|
||||
uECC_Curve curve);
|
||||
|
||||
/* Generates a random integer r in the range 0 < r < curve->n */
|
||||
int uECC_generate_random_int(uECC_word_t *random, uECC_Curve curve);
|
||||
/* Generates a random integer in the range 0 < random < top.
|
||||
Both, random and top, have num_words words. */
|
||||
int uECC_generate_random_int(uECC_word_t *random,
|
||||
const uECC_word_t *top,
|
||||
wordcount_t num_words);
|
||||
|
||||
#endif /* uECC_ENABLE_VLI_API */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user