mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 00:05:42 +01:00
Restore tinycrypt implementation of regularize_k()
Signed-off-by: Shelly Liberman <shelly.liberman@arm.com>
This commit is contained in:
parent
8472bc76c6
commit
a23f599584
@ -1610,10 +1610,13 @@ static void EccPoint_mult(uECC_word_t * result, const uECC_word_t * point,
|
||||
static uECC_word_t regularize_k(const uECC_word_t * const k, uECC_word_t *k0,
|
||||
uECC_word_t *k1)
|
||||
{
|
||||
wordcount_t num_n_words = NUM_ECC_WORDS;
|
||||
bitcount_t num_n_bits = NUM_ECC_BITS;
|
||||
|
||||
|
||||
uECC_word_t carry = uECC_vli_add(k0, k, curve_n) ||
|
||||
uECC_vli_testBit(k0, num_n_bits);
|
||||
(num_n_bits < ((bitcount_t)num_n_words * uECC_WORD_SIZE * 8) &&
|
||||
uECC_vli_testBit(k0, num_n_bits));
|
||||
|
||||
uECC_vli_add(k1, k0, curve_n);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user