Added uECC_generate_random_int(), and made uECC_vli_cmp() constant-time.

This commit is contained in:
Ken MacKay
2015-10-12 21:29:56 -07:00
parent 41207c563a
commit 69744ae539
4 changed files with 69 additions and 38 deletions
+2 -2
View File
@@ -21654,7 +21654,7 @@ uECC_VLI_API void uECC_vli_mmod_fast(uint8_t *RESTRICT result, uint8_t *RESTRICT
if (carry > 0) {
uECC_vli_sub(result, result, curve_p);
}
if (uECC_vli_cmp(result, curve_p) > 0) {
if (uECC_vli_cmp_unsafe(result, curve_p) > 0) {
uECC_vli_sub(result, result, curve_p);
}
}
@@ -21977,7 +21977,7 @@ uECC_VLI_API void uECC_vli_mmod_fast(uint8_t *RESTRICT result, uint8_t *RESTRICT
if (carry > 0) {
uECC_vli_sub(result, result, curve_p);
}
if (uECC_vli_cmp(result, curve_p) > 0) {
if (uECC_vli_cmp_unsafe(result, curve_p) > 0) {
uECC_vli_sub(result, result, curve_p);
}
}