In the following sample test case I get a false-positive from OpenSSL
1.0.0 Beta 3.  Note that this tests specifically for a vector larger
than should be allowed (192/32 = 6 32-bit integers, but Qy requires
7).  Other test cases succeed or fail as expected - this is an edge
case.

[P-192]
Qx = cd6d0f029a023e9aaca429615b8f577abee685d8257cc83a
Qy = 00019c410987680e9fb6c0b6ecc01d9a2647c8bae27721bacdfc

The correct result is a failure, but the following steps produce a
false positive.  I have removed error checking code for brevity, but
my test code includes it.  Is there something wrong with the process
I'm using?

EC_KEY *eckey = NULL;
EC_GROUP *group = NULL;
EC_POINT *pub_key = NULL;
BIGNUM *Qx = NULL;
BIGNUM *Qy = NULL;

BN_hex2bn(Qx, "cd6d0f029a023e9aaca429615b8f577abee685d8257cc83a");
BN_hex2bn(Qy, "000000019c410987680e9fb6c0b6ecc01d9a2647c8bae27721bacdfc");

eckey = EC_KEY_new();
group = EC_GROUP_new_by_curve_name(NID_X9_62_prime192v1);
EC_KEY_set_group(eckey, group);

pub_key = EC_POINT_new(group);
EC_POINT_set_affine_coordinates_GFp(group, pub_key, Qx, Qy, NULL);

EC_KEY_set_public_key(eckey, pub_key);

EC_KEY_check_key(eckey)

Will Bickford
"In Google We Trust"
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to