diff --git a/crypto/fipsmodule/ec/ec_key.c b/crypto/fipsmodule/ec/ec_key.c index d7acf969c..2d04d13cc 100644 --- a/crypto/fipsmodule/ec/ec_key.c +++ b/crypto/fipsmodule/ec/ec_key.c @@ -308,6 +308,9 @@ int EC_KEY_check_key(const EC_KEY *eckey) { } // Check the public and private keys match. + // + // NOTE: this is a FIPS pair-wise consistency check for the ECDH case. See SP + // 800-56Ar3, page 36. if (eckey->priv_key != NULL) { EC_RAW_POINT point; if (!ec_point_mul_scalar_base(eckey->group, &point, diff --git a/include/openssl/ec_key.h b/include/openssl/ec_key.h index 3a4085660..502bfc2d9 100644 --- a/include/openssl/ec_key.h +++ b/include/openssl/ec_key.h @@ -167,8 +167,9 @@ OPENSSL_EXPORT void EC_KEY_set_conv_form(EC_KEY *key, // about the problem can be found on the error stack. OPENSSL_EXPORT int EC_KEY_check_key(const EC_KEY *key); -// EC_KEY_check_fips performs a signing pairwise consistency test (FIPS 140-2 -// 4.9.2). It returns one if it passes and zero otherwise. +// EC_KEY_check_fips performs both a signing pairwise consistency test +// (FIPS 140-2 4.9.2) and the consistency test from SP 800-56Ar3 section +// 5.6.2.1.4. It returns one if it passes and zero otherwise. OPENSSL_EXPORT int EC_KEY_check_fips(const EC_KEY *key); // EC_KEY_set_public_key_affine_coordinates sets the public key in |key| to @@ -194,7 +195,9 @@ OPENSSL_EXPORT size_t EC_KEY_key2buf(const EC_KEY *key, OPENSSL_EXPORT int EC_KEY_generate_key(EC_KEY *key); // EC_KEY_generate_key_fips behaves like |EC_KEY_generate_key| but performs -// additional checks for FIPS compliance. +// additional checks for FIPS compliance. This function is applicable when +// generating keys for either signing/verification or key agreement because +// both types of consistency check (PCT) are performed. OPENSSL_EXPORT int EC_KEY_generate_key_fips(EC_KEY *key); // EC_KEY_derive_from_secret deterministically derives a private key for |group|