Re: [openssl-users] fips_ecdhvs failing for non Prime Curves

2015-02-24 Thread Dr. Stephen Henson
On Mon, Feb 23, 2015, Bala Duvvuri wrote:

 Hi All,
 
 I am trying to test the FIPS ECDH support present in OpenSSL i.e trying to 
 run the fips_ecdhvs.c test.
 

When you say ECDH support present in OpenSSL do you mean in the FIPS module or
in OpenSSL itself?

If you mean in OpenSSL itself then you need to use cofactor ECDH for the tests
which is only supported in OpenSSL 1.0.2 and later (it is supported in the
FIPS module). The results for cofactor ECDH differ from ECDH if the curve
cofactor is not 1: this is true for several binary curves which would account
for the differences you were seeing.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
___
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


[openssl-users] fips_ecdhvs failing for non Prime Curves

2015-02-23 Thread Bala Duvvuri
Hi All,

I am trying to test the FIPS ECDH support present in OpenSSL i.e trying to run 
the fips_ecdhvs.c test.

The test vectors  ECC CDH Primitive Test Vectors from NIST website have been 
downloaded - http://csrc.nist.gov/groups/STM/cavp/#09 and given as the input.

The test passes for the vectors that have the field type - 
NID_X9_62_prime_field (NIST Prime-Curve P-192, P-256 etc ) but outputs wrong 
shared key for other curves like (NIST Binary-Curve K-163/B-163/K-233 etc)

The test is run using the command - ./fips_ecdhvs ecdhver 
KAS_ECC_CDH_PrimitiveTest.txt Out

One observation is the non prime test vectors have 0 at the begining:

QIUTx = 00071f8b2877d6027d9c1ade4244f2dea12692ef23d5
QIUTy = 0005c15ee776221c72b84b347ce383f38067b89c3e9a

If we print the EC key using ec_print_key, we find the leading 0's missing, is 
this ok?

QIUTx = 071f8b2877d6027d9c1ade4244f2dea12692ef23d5
QIUTy = 05c15ee776221c72b84b347ce383f38067b89c3e9a

Please let me know how to make the above test work?

thanks,
Bala
___
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users