Z will be 0 not 1

This commit is contained in:
Sean Parkinson
2016-11-11 12:53:48 +10:00
parent 71259113b2
commit 8a7bb3fad4

View File

@@ -1069,7 +1069,7 @@ int ecc_projective_add_point(ecc_point* P, ecc_point* Q, ecc_point* R,
/* if Z is one then these are no-operations */
if (err == MP_OKAY) {
if (!mp_isone(Q->z)) {
if (!mp_iszero(Q->z)) {
/* T1 = Z' * Z' */
err = mp_sqr(Q->z, &t1);
if (err == MP_OKAY)
@@ -1163,7 +1163,7 @@ int ecc_projective_add_point(ecc_point* P, ecc_point* Q, ecc_point* R,
}
if (err == MP_OKAY) {
if (!mp_isone(Q->z)) {
if (!mp_iszero(Q->z)) {
/* Z = Z * Z' */
err = mp_mul(z, Q->z, z);
if (err == MP_OKAY)