fixes for ECC

This commit is contained in:
NIIBE Yutaka 2014-12-12 14:17:35 +09:00
parent 8d56a4bff5
commit abde30b943
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,9 @@
2014-12-03 NIIBE Yutaka <gniibe@fsij.org>
2014-12-09 Niibe Yutaka <gniibe@fsij.org>
* src/ecc.c (compute_kP): Bug fix. It's P, not G.
(point_is_on_the_curve): Bug fix.
2014-12-03 Niibe Yutaka <gniibe@fsij.org>
Changes for RSA-4096.

View File

@ -169,7 +169,7 @@ point_is_on_the_curve (const ac *P)
MFNC(sqr) (s, P->x);
MFNC(mul) (s, s, P->x);
#ifdef COEFFICIENT_A_IS_ZERO
#ifndef COEFFICIENT_A_IS_ZERO
MFNC(mul) (t, coefficient_a, P->x);
MFNC(add) (s, s, t);
#endif
@ -311,7 +311,7 @@ FUNC(compute_kP) (ac *X, const bn256 *K, const ac *P)
}
dst = k_is_even ? Q : tmp;
FUNC(jpc_add_ac) (dst, Q, &precomputed_KG[0]);
FUNC(jpc_add_ac) (dst, Q, P);
return FUNC(jpc_to_ac) (X, Q);
}