mirror of
https://github.com/neocturne/libuecc.git
synced 2025-03-04 17:03:31 +01:00
Remove some unnecessary squeeze() calls
As only the subtrahend in a sub() call needs to be squeezed, the squeeze can be skipped in these cases.
This commit is contained in:
parent
320daa4838
commit
89f8a35c71
1 changed files with 3 additions and 3 deletions
|
@ -546,9 +546,9 @@ void ecc_25519_double(ecc_25519_work_t *out, const ecc_25519_work_t *in) {
|
||||||
mult_int(D, 486664, A);
|
mult_int(D, 486664, A);
|
||||||
add(t1, in->X, in->Y);
|
add(t1, in->X, in->Y);
|
||||||
square(t2, t1);
|
square(t2, t1);
|
||||||
sub(t3, t2, A); squeeze(t3);
|
sub(t3, t2, A);
|
||||||
sub(E, t3, B);
|
sub(E, t3, B);
|
||||||
add(G, D, B); squeeze(G);
|
add(G, D, B);
|
||||||
sub(F, G, C);
|
sub(F, G, C);
|
||||||
sub(H, D, B);
|
sub(H, D, B);
|
||||||
mult(out->X, E, F);
|
mult(out->X, E, F);
|
||||||
|
@ -568,7 +568,7 @@ void ecc_25519_add(ecc_25519_work_t *out, const ecc_25519_work_t *in1, const ecc
|
||||||
add(t1, in1->X, in1->Y);
|
add(t1, in1->X, in1->Y);
|
||||||
add(t2, in2->X, in2->Y);
|
add(t2, in2->X, in2->Y);
|
||||||
mult(t3, t1, t2);
|
mult(t3, t1, t2);
|
||||||
sub(t4, t3, A); squeeze(t4);
|
sub(t4, t3, A);
|
||||||
sub(E, t4, B);
|
sub(E, t4, B);
|
||||||
sub(F, D, C);
|
sub(F, D, C);
|
||||||
add(G, D, C);
|
add(G, D, C);
|
||||||
|
|
Loading…
Add table
Reference in a new issue