make sure 'neg' flag (which does not really matter for GF(2^m), but
could cause confusion for ECDSA) is set to zero
Submitted by: Sheueling Chang
diff --git a/crypto/ec/ec2_smpl.c b/crypto/ec/ec2_smpl.c
index ece8abb..b218c56 100644
--- a/crypto/ec/ec2_smpl.c
+++ b/crypto/ec/ec2_smpl.c
@@ -364,8 +364,11 @@
}
if (!BN_copy(&point->X, x)) goto err;
+ point->X.neg = 0;
if (!BN_copy(&point->Y, y)) goto err;
+ point->Y.neg = 0;
if (!BN_copy(&point->Z, BN_value_one())) goto err;
+ point->Z.neg = 0;
point->Z_is_one = 1;
ret = 1;
@@ -396,10 +399,12 @@
if (x != NULL)
{
if (!BN_copy(x, &point->X)) goto err;
+ x->neg = 0;
}
if (y != NULL)
{
if (!BN_copy(y, &point->Y)) goto err;
+ y->neg = 0;
}
ret = 1;