mirror of
https://salsa.debian.org/gnuk-team/gnuk/gnuk.git
synced 2024-09-20 02:40:08 +00:00
remove unused calculations from mod_reduce.
Detected with scan-build. Signed-off-by: Anthony Romano <anthony.romano@coreos.com>
This commit is contained in:
parent
a51ac8593b
commit
2622840e27
6
AUTHORS
6
AUTHORS
@ -1,3 +1,9 @@
|
|||||||
|
Anthony Romano:
|
||||||
|
Modified:
|
||||||
|
src/call-rsa.c
|
||||||
|
src/main.c
|
||||||
|
src/mod.c
|
||||||
|
|
||||||
Kaz Kojima:
|
Kaz Kojima:
|
||||||
Added STM32 Primer2 support.
|
Added STM32 Primer2 support.
|
||||||
|
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2017-07-18 Anthony Romano <anthony.romano@coreos.com>
|
||||||
|
|
||||||
|
* src/mod.c (mod_reduce): Clean up unused code.
|
||||||
|
|
||||||
2017-07-18 Anthony Romano <anthony.romano@coreos.com>
|
2017-07-18 Anthony Romano <anthony.romano@coreos.com>
|
||||||
|
|
||||||
* src/call-rsa.c (modulus_calc): Free modulus on error.
|
* src/call-rsa.c (modulus_calc): Free modulus on error.
|
||||||
|
1
THANKS
1
THANKS
@ -11,6 +11,7 @@ Achim Pietig achim@pietig.com
|
|||||||
Aidan Thornton
|
Aidan Thornton
|
||||||
Anibal Monsalve Salazar anibal@debian.org
|
Anibal Monsalve Salazar anibal@debian.org
|
||||||
Andre Zepezauer andre.zepezauer@student.uni-halle.de
|
Andre Zepezauer andre.zepezauer@student.uni-halle.de
|
||||||
|
Anthony Romano anthony.romano@coreos.com
|
||||||
Bertrand Jacquin bertrand@jacquin.bzh
|
Bertrand Jacquin bertrand@jacquin.bzh
|
||||||
Clint Adams clint@softwarefreedom.org
|
Clint Adams clint@softwarefreedom.org
|
||||||
Daniel Kahn Gillmor dkg@fifthhorseman.net
|
Daniel Kahn Gillmor dkg@fifthhorseman.net
|
||||||
|
@ -36,7 +36,6 @@ mod_reduce (bn256 *X, const bn512 *A, const bn256 *B, const bn256 *MU_lower)
|
|||||||
bn512 q_big[1], tmp[1];
|
bn512 q_big[1], tmp[1];
|
||||||
uint32_t carry;
|
uint32_t carry;
|
||||||
#define borrow carry
|
#define borrow carry
|
||||||
uint32_t borrow_next;
|
|
||||||
|
|
||||||
memset (q, 0, sizeof (bn256));
|
memset (q, 0, sizeof (bn256));
|
||||||
q->word[0] = A->word[15];
|
q->word[0] = A->word[15];
|
||||||
@ -110,9 +109,7 @@ mod_reduce (bn256 *X, const bn512 *A, const bn256 *B, const bn256 *MU_lower)
|
|||||||
= tmp->word[11] = tmp->word[10] = tmp->word[9] = 0;
|
= tmp->word[11] = tmp->word[10] = tmp->word[9] = 0;
|
||||||
|
|
||||||
borrow = bn256_sub (X, (bn256 *)&q_big->word[0], (bn256 *)&tmp->word[0]);
|
borrow = bn256_sub (X, (bn256 *)&q_big->word[0], (bn256 *)&tmp->word[0]);
|
||||||
borrow_next = (q_big->word[8] < borrow);
|
|
||||||
q_big->word[8] -= borrow;
|
q_big->word[8] -= borrow;
|
||||||
borrow_next += (q_big->word[8] < tmp->word[8]);
|
|
||||||
q_big->word[8] -= tmp->word[8];
|
q_big->word[8] -= tmp->word[8];
|
||||||
|
|
||||||
carry = q_big->word[8];
|
carry = q_big->word[8];
|
||||||
@ -122,7 +119,7 @@ mod_reduce (bn256 *X, const bn512 *A, const bn256 *B, const bn256 *MU_lower)
|
|||||||
bn256_sub (q, X, B);
|
bn256_sub (q, X, B);
|
||||||
|
|
||||||
if (carry)
|
if (carry)
|
||||||
carry -= bn256_sub (X, X, B);
|
bn256_sub (X, X, B);
|
||||||
else
|
else
|
||||||
bn256_sub (q, X, B);
|
bn256_sub (q, X, B);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user