mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 20:14:20 +08:00
Simplify handling of named curves: get rid of EC_GROUP_new_by_name(),
EC_GROUP_new_by_nid() should be enough. This avoids a lot of redundancy. Submitted by: Nils Larsch
This commit is contained in:
parent
265e892fed
commit
7eb18f1237
3
CHANGES
3
CHANGES
@ -233,9 +233,8 @@ TODO: bug: pad x with leading zeros if necessary
|
||||
|
||||
*) Include some named elliptic curves, and add OIDs from X9.62,
|
||||
SECG, and WAP/WTLS. The curves can be obtained from the new
|
||||
functions
|
||||
function
|
||||
EC_GROUP_new_by_nid()
|
||||
EC_GROUP_new_by_name()
|
||||
Also add a 'curve_name' member to EC_GROUP objects, which can be
|
||||
accessed via
|
||||
EC_GROUP_set_nid()
|
||||
|
103
apps/ecparam.c
103
apps/ecparam.c
@ -1,6 +1,6 @@
|
||||
/* apps/ecparam.c */
|
||||
/*
|
||||
* Originally written by Nils Larsch for the OpenSSL project.
|
||||
* Written by Nils Larsch for the OpenSSL project.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
@ -92,9 +92,6 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/ec.h>
|
||||
#ifndef OPENSSL_NO_ECDSA
|
||||
#include <openssl/ecdsa.h>
|
||||
#endif
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
|
||||
@ -123,80 +120,11 @@
|
||||
* explicit
|
||||
* -no_seed - if 'explicit' parameters are choosen do not
|
||||
* use the seed
|
||||
* -genkey - generates a ecdsa private key
|
||||
* -genkey - generates a ec private key
|
||||
* -rand file
|
||||
* -engine e - use engine e, possible a hardware device
|
||||
*/
|
||||
|
||||
static const char *curve_list[67] = {
|
||||
"prime192v1 - 192 bit prime curve from the X9.62 draft",
|
||||
"prime192v2 - 192 bit prime curve from the X9.62 draft",
|
||||
"prime192v3 - 192 bit prime curve from the X9.62 draft",
|
||||
"prime239v1 - 239 bit prime curve from the X9.62 draft",
|
||||
"prime239v2 - 239 bit prime curve from the X9.62 draft",
|
||||
"prime239v3 - 239 bit prime curve from the X9.62 draft",
|
||||
"prime256v1 - 256 bit prime curve from the X9.62 draft",
|
||||
"secp112r1 - SECG recommended curve over a 112 bit prime field",
|
||||
"secp112r2 - SECG recommended curve over a 112 bit prime field",
|
||||
"secp128r1 - SECG recommended curve over a 128 bit prime field",
|
||||
"secp128r2 - SECG recommended curve over a 128 bit prime field",
|
||||
"secp160k1 - SECG recommended curve over a 160 bit prime field",
|
||||
"secp160r1 - SECG recommended curve over a 160 bit prime field",
|
||||
"secp160r2 - SECG recommended curve over a 160 bit prime field",
|
||||
"secp192k1 - SECG recommended curve over a 192 bit prime field",
|
||||
"prime192v1 - SECG recommended curve over a 192 bit prime field (aka secp192r1)",
|
||||
"secp224k1 - SECG recommended curve over a 224 bit prime field",
|
||||
"secp224r1 - SECG/NIST recommended curve over a 224 bit prime field",
|
||||
"secp256k1 - SECG recommended curve over a 256 bit prime field",
|
||||
"prime256v1 - SECG recommended curve over a 256 bit prime field (aka secp256r1)",
|
||||
"secp384r1 - SECG/NIST recommended curve over a 384 bit prime field",
|
||||
"secp521r1 - SECG/NIST recommended curve over a 521 bit prime field",
|
||||
"wap-wsg-idm-ecid-wtls6 - 112 bit prime curve from the WTLS standard",
|
||||
"wap-wsg-idm-ecid-wtls8 - 112 bit prime curve from the WTLS standard",
|
||||
"wap-wsg-idm-ecid-wtls7 - 160 bit prime curve from the WTLS standard",
|
||||
"wap-wsg-idm-ecid-wtls9 - 160 bit prime curve from the WTLS standard",
|
||||
"wap-wsg-idm-ecid-wtls12 - 224 bit prime curve from the WTLS standard",
|
||||
"c2pnb163v1 - 163 bit binary curve from the X9.62 draft",
|
||||
"c2pnb163v2 - 163 bit binary curve from the X9.62 draft",
|
||||
"c2pnb163v3 - 163 bit binary curve from the X9.62 draft",
|
||||
"c2pnb176v1 - 176 bit binary curve from the X9.62 draft",
|
||||
"c2tnb191v1 - 191 bit binary curve from the X9.62 draft",
|
||||
"c2tnb191v2 - 191 bit binary curve from the X9.62 draft",
|
||||
"c2tnb191v3 - 191 bit binary curve from the X9.62 draft",
|
||||
"c2pnb208w1 - 208 bit binary curve from the X9.62 draft",
|
||||
"c2tnb239v1 - 239 bit binary curve from the X9.62 draft",
|
||||
"c2tnb239v2 - 239 bit binary curve from the X9.62 draft",
|
||||
"c2tnb239v3 - 239 bit binary curve from the X9.62 draft",
|
||||
"c2pnb272w1 - 272 bit binary curve from the X9.62 draft",
|
||||
"c2pnb304w1 - 304 bit binary curve from the X9.62 draft",
|
||||
"c2tnb359v1 - 359 bit binary curve from the X9.62 draft",
|
||||
"c2pnb368w1 - 368 bit binary curve from the X9.62 draft",
|
||||
"c2tnb431r1 - 431 bit binary curve from the X9.62 draft",
|
||||
"sect113r1 - SECG recommended curve over a 113 bit binary field",
|
||||
"sect113r2 - SECG recommended curve over a 113 bit binary field",
|
||||
"sect131r1 - SECG recommended curve over a 131 bit binary field",
|
||||
"sect131r2 - SECG recommended curve over a 131 bit binary field",
|
||||
"sect163k1 - SECG/NIST recommended curve over a 163 bit binary field",
|
||||
"sect163r1 - SECG recommended curve over a 163 bit binary field",
|
||||
"sect163r2 - SECG/NIST recommended curve over a 163 bit binary field",
|
||||
"sect193r1 - SECG recommended curve over a 193 bit binary field",
|
||||
"sect193r2 - SECG recommended curve over a 193 bit binary field",
|
||||
"sect233k1 - SECG/NIST recommended curve over a 233 bit binary field",
|
||||
"sect233r1 - SECG/NIST recommended curve over a 233 bit binary field",
|
||||
"sect239k1 - SECG recommended curve over a 239 bit binary field",
|
||||
"sect283k1 - SECG/NIST recommended curve over a 283 bit binary field",
|
||||
"sect283r1 - SECG/NIST recommended curve over a 283 bit binary field",
|
||||
"sect409k1 - SECG/NIST recommended curve over a 409 bit binary field",
|
||||
"sect409r1 - SECG/NIST recommended curve over a 409 bit binary field",
|
||||
"sect571k1 - SECG/NIST recommended curve over a 571 bit binary field",
|
||||
"sect571r1 - SECG/NIST recommended curve over a 571 bit binary field",
|
||||
"wap-wsg-idm-ecid-wtls1 - 113 bit binary curve from the WTLS standard",
|
||||
"wap-wsg-idm-ecid-wtls4 - 113 bit binary curve from the WTLS standard",
|
||||
"wap-wsg-idm-ecid-wtls3 - 163 bit binary curve from the WTLS standard",
|
||||
"wap-wsg-idm-ecid-wtls5 - 163 bit binary curve from the WTLS standard",
|
||||
"wap-wsg-idm-ecid-wtls10 - 233 bit binary curve from the WTLS standard",
|
||||
"wap-wsg-idm-ecid-wtls11 - 233 bit binary curve from the WTLS standard"
|
||||
};
|
||||
|
||||
static int ecparam_print_var(BIO *,BIGNUM *,const char *,int,unsigned char *);
|
||||
|
||||
@ -376,7 +304,7 @@ bad:
|
||||
BIO_printf(bio_err, " -no_seed if 'explicit'"
|
||||
" parameters are choosen do not\n");
|
||||
BIO_printf(bio_err, " use the seed\n");
|
||||
BIO_printf(bio_err, " -genkey generate ecdsa"
|
||||
BIO_printf(bio_err, " -genkey generate ec"
|
||||
" key\n");
|
||||
BIO_printf(bio_err, " -rand file files to use for"
|
||||
" random number input\n");
|
||||
@ -430,10 +358,27 @@ bad:
|
||||
{
|
||||
int counter=0;
|
||||
|
||||
for (; counter < sizeof(curve_list)/sizeof(char *); counter++)
|
||||
if (BIO_printf(bio_err, " %s\n", curve_list[counter])
|
||||
<= 0)
|
||||
goto end;
|
||||
for (;;)
|
||||
{
|
||||
const char *comment;
|
||||
const char *sname;
|
||||
int len, nid = ec_group_index2nid(counter++);
|
||||
if (!nid)
|
||||
break;
|
||||
comment = EC_GROUP_get0_comment(nid);
|
||||
sname = OBJ_nid2sn(nid);
|
||||
if (comment == NULL)
|
||||
comment = "";
|
||||
if (sname == NULL)
|
||||
sname == "";
|
||||
|
||||
len = BIO_printf(out, " %-10s: ", sname);
|
||||
if (len + strlen(comment) > 80)
|
||||
BIO_printf(out, "\n%80s\n", comment);
|
||||
else
|
||||
BIO_printf(out, "%s\n", comment);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
goto end;
|
||||
}
|
||||
|
@ -110,7 +110,7 @@
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
|
||||
* ECDH support in OpenSSL originally developed by
|
||||
* ECC cipher suite support in OpenSSL originally developed by
|
||||
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
|
||||
*/
|
||||
|
||||
|
30
apps/speed.c
30
apps/speed.c
@ -559,22 +559,22 @@ int MAIN(int argc, char **argv)
|
||||
static unsigned int test_curves[EC_NUM] =
|
||||
{
|
||||
/* Prime Curves */
|
||||
EC_GROUP_SECG_PRIME_160R1,
|
||||
EC_GROUP_NIST_PRIME_224,
|
||||
EC_GROUP_NIST_PRIME_256,
|
||||
EC_GROUP_NIST_PRIME_384,
|
||||
EC_GROUP_NIST_PRIME_521,
|
||||
NID_secp160r1,
|
||||
NID_secp224r1,
|
||||
NID_X9_62_prime256v1,
|
||||
NID_secp384r1,
|
||||
NID_secp521r1,
|
||||
/* Binary Curves */
|
||||
EC_GROUP_NIST_CHAR2_K163,
|
||||
EC_GROUP_NIST_CHAR2_K233,
|
||||
EC_GROUP_NIST_CHAR2_K283,
|
||||
EC_GROUP_NIST_CHAR2_K409,
|
||||
EC_GROUP_NIST_CHAR2_K571,
|
||||
EC_GROUP_NIST_CHAR2_B163,
|
||||
EC_GROUP_NIST_CHAR2_B233,
|
||||
EC_GROUP_NIST_CHAR2_B283,
|
||||
EC_GROUP_NIST_CHAR2_B409,
|
||||
EC_GROUP_NIST_CHAR2_B571
|
||||
NID_sect163k1,
|
||||
NID_sect233k1,
|
||||
NID_sect283k1,
|
||||
NID_sect409k1,
|
||||
NID_sect571k1,
|
||||
NID_sect163r2,
|
||||
NID_sect233r1,
|
||||
NID_sect283r1,
|
||||
NID_sect409r1,
|
||||
NID_sect571r1
|
||||
};
|
||||
static char * test_curves_names[EC_NUM] =
|
||||
{
|
||||
|
@ -118,12 +118,11 @@ ec_check.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
|
||||
ec_check.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
ec_check.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
ec_check.o: ../../include/openssl/symhacks.h ec_check.c ec_lcl.h
|
||||
ec_curve.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
|
||||
ec_curve.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
|
||||
ec_curve.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||
ec_curve.o: ../../include/openssl/ec.h ../../include/openssl/err.h
|
||||
ec_curve.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
|
||||
ec_curve.o: ../../include/openssl/opensslconf.h
|
||||
ec_curve.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
|
||||
ec_curve.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
|
||||
ec_curve.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
|
||||
ec_curve.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||
ec_curve.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h
|
||||
ec_curve.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||
ec_curve.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||
ec_curve.o: ../../include/openssl/symhacks.h ec_curve.c ec_lcl.h
|
||||
|
234
crypto/ec/ec.h
234
crypto/ec/ec.h
@ -182,94 +182,15 @@ int EC_GROUP_check_discriminant(const EC_GROUP *, BN_CTX *);
|
||||
EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
|
||||
EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
|
||||
|
||||
/* EC_GROUP_new_by_nid() and EC_GROUP_new_by_name() also set
|
||||
* generator and order */
|
||||
/* EC_GROUP_new_by_nid() creates a EC_GROUP structure specified by a NID */
|
||||
EC_GROUP *EC_GROUP_new_by_nid(int nid);
|
||||
EC_GROUP *EC_GROUP_new_by_name(int name);
|
||||
/* Currently valid arguments to EC_GROUP_new_by_name() */
|
||||
#define EC_GROUP_NO_CURVE 0
|
||||
#define EC_GROUP_NIST_PRIME_192 NID_X9_62_prime192v1
|
||||
#define EC_GROUP_NIST_PRIME_224 NID_secp224r1
|
||||
#define EC_GROUP_NIST_PRIME_256 NID_X9_62_prime256v1
|
||||
#define EC_GROUP_NIST_PRIME_384 NID_secp384r1
|
||||
#define EC_GROUP_NIST_PRIME_521 NID_secp521r1
|
||||
#define EC_GROUP_X9_62_PRIME_192V1 NID_X9_62_prime192v1
|
||||
#define EC_GROUP_X9_62_PRIME_192V2 NID_X9_62_prime192v2
|
||||
#define EC_GROUP_X9_62_PRIME_192V3 NID_X9_62_prime192v3
|
||||
#define EC_GROUP_X9_62_PRIME_239V1 NID_X9_62_prime239v1
|
||||
#define EC_GROUP_X9_62_PRIME_239V2 NID_X9_62_prime239v2
|
||||
#define EC_GROUP_X9_62_PRIME_239V3 NID_X9_62_prime239v3
|
||||
#define EC_GROUP_X9_62_PRIME_256V1 NID_X9_62_prime256v1
|
||||
#define EC_GROUP_SECG_PRIME_112R1 NID_secp112r1
|
||||
#define EC_GROUP_SECG_PRIME_112R2 NID_secp112r2
|
||||
#define EC_GROUP_SECG_PRIME_128R1 NID_secp128r1
|
||||
#define EC_GROUP_SECG_PRIME_128R2 NID_secp128r2
|
||||
#define EC_GROUP_SECG_PRIME_160K1 NID_secp160k1
|
||||
#define EC_GROUP_SECG_PRIME_160R1 NID_secp160r1
|
||||
#define EC_GROUP_SECG_PRIME_160R2 NID_secp160r2
|
||||
#define EC_GROUP_SECG_PRIME_192K1 NID_secp192k1
|
||||
#define EC_GROUP_SECG_PRIME_192R1 NID_X9_62_prime192v1
|
||||
#define EC_GROUP_SECG_PRIME_224K1 NID_secp224k1
|
||||
#define EC_GROUP_SECG_PRIME_224R1 NID_secp224r1
|
||||
#define EC_GROUP_SECG_PRIME_256K1 NID_secp256k1
|
||||
#define EC_GROUP_SECG_PRIME_256R1 NID_X9_62_prime256v1
|
||||
#define EC_GROUP_SECG_PRIME_384R1 NID_secp384r1
|
||||
#define EC_GROUP_SECG_PRIME_521R1 NID_secp521r1
|
||||
#define EC_GROUP_WTLS_6 NID_wap_wsg_idm_ecid_wtls6
|
||||
#define EC_GROUP_WTLS_7 NID_wap_wsg_idm_ecid_wtls7
|
||||
#define EC_GROUP_WTLS_8 NID_wap_wsg_idm_ecid_wtls8
|
||||
#define EC_GROUP_WTLS_9 NID_wap_wsg_idm_ecid_wtls9
|
||||
#define EC_GROUP_WTLS_12 NID_wap_wsg_idm_ecid_wtls12
|
||||
#define EC_GROUP_NIST_CHAR2_K163 NID_sect163k1
|
||||
#define EC_GROUP_NIST_CHAR2_B163 NID_sect163r2
|
||||
#define EC_GROUP_NIST_CHAR2_K233 NID_sect233k1
|
||||
#define EC_GROUP_NIST_CHAR2_B233 NID_sect233r1
|
||||
#define EC_GROUP_NIST_CHAR2_K283 NID_sect283k1
|
||||
#define EC_GROUP_NIST_CHAR2_B283 NID_sect283r1
|
||||
#define EC_GROUP_NIST_CHAR2_K409 NID_sect409k1
|
||||
#define EC_GROUP_NIST_CHAR2_B409 NID_sect409r1
|
||||
#define EC_GROUP_NIST_CHAR2_K571 NID_sect571k1
|
||||
#define EC_GROUP_NIST_CHAR2_B571 NID_sect571r1
|
||||
#define EC_GROUP_X9_62_CHAR2_163V1 NID_X9_62_c2pnb163v1
|
||||
#define EC_GROUP_X9_62_CHAR2_163V2 NID_X9_62_c2pnb163v2
|
||||
#define EC_GROUP_X9_62_CHAR2_163V3 NID_X9_62_c2pnb163v3
|
||||
#define EC_GROUP_X9_62_CHAR2_176V1 NID_X9_62_c2pnb176v1
|
||||
#define EC_GROUP_X9_62_CHAR2_191V1 NID_X9_62_c2tnb191v1
|
||||
#define EC_GROUP_X9_62_CHAR2_191V2 NID_X9_62_c2tnb191v2
|
||||
#define EC_GROUP_X9_62_CHAR2_191V3 NID_X9_62_c2tnb191v3
|
||||
#define EC_GROUP_X9_62_CHAR2_208W1 NID_X9_62_c2pnb208w1
|
||||
#define EC_GROUP_X9_62_CHAR2_239V1 NID_X9_62_c2tnb239v1
|
||||
#define EC_GROUP_X9_62_CHAR2_239V2 NID_X9_62_c2tnb239v2
|
||||
#define EC_GROUP_X9_62_CHAR2_239V3 NID_X9_62_c2tnb239v3
|
||||
#define EC_GROUP_X9_62_CHAR2_272W1 NID_X9_62_c2pnb272w1
|
||||
#define EC_GROUP_X9_62_CHAR2_304W1 NID_X9_62_c2pnb304w1
|
||||
#define EC_GROUP_X9_62_CHAR2_359V1 NID_X9_62_c2tnb359v1
|
||||
#define EC_GROUP_X9_62_CHAR2_368W1 NID_X9_62_c2pnb368w1
|
||||
#define EC_GROUP_X9_62_CHAR2_431R1 NID_X9_62_c2tnb431r1
|
||||
#define EC_GROUP_SECG_CHAR2_113R1 NID_sect113r1
|
||||
#define EC_GROUP_SECG_CHAR2_113R2 NID_sect113r2
|
||||
#define EC_GROUP_SECG_CHAR2_131R1 NID_sect131r1
|
||||
#define EC_GROUP_SECG_CHAR2_131R2 NID_sect131r2
|
||||
#define EC_GROUP_SECG_CHAR2_163K1 NID_sect163k1
|
||||
#define EC_GROUP_SECG_CHAR2_163R1 NID_sect163r1
|
||||
#define EC_GROUP_SECG_CHAR2_163R2 NID_sect163r2
|
||||
#define EC_GROUP_SECG_CHAR2_193R1 NID_sect193r1
|
||||
#define EC_GROUP_SECG_CHAR2_193R2 NID_sect193r2
|
||||
#define EC_GROUP_SECG_CHAR2_233K1 NID_sect233k1
|
||||
#define EC_GROUP_SECG_CHAR2_233R1 NID_sect233r1
|
||||
#define EC_GROUP_SECG_CHAR2_239K1 NID_sect239k1
|
||||
#define EC_GROUP_SECG_CHAR2_283K1 NID_sect283k1
|
||||
#define EC_GROUP_SECG_CHAR2_283R1 NID_sect283r1
|
||||
#define EC_GROUP_SECG_CHAR2_409K1 NID_sect409k1
|
||||
#define EC_GROUP_SECG_CHAR2_409R1 NID_sect409r1
|
||||
#define EC_GROUP_SECG_CHAR2_571K1 NID_sect571k1
|
||||
#define EC_GROUP_SECG_CHAR2_571R1 NID_sect571r1
|
||||
#define EC_GROUP_WTLS_1 NID_wap_wsg_idm_ecid_wtls1
|
||||
#define EC_GROUP_WTLS_3 NID_wap_wsg_idm_ecid_wtls3
|
||||
#define EC_GROUP_WTLS_4 NID_wap_wsg_idm_ecid_wtls4
|
||||
#define EC_GROUP_WTLS_5 NID_wap_wsg_idm_ecid_wtls5
|
||||
#define EC_GROUP_WTLS_10 NID_wap_wsg_idm_ecid_wtls10
|
||||
#define EC_GROUP_WTLS_11 NID_wap_wsg_idm_ecid_wtls11
|
||||
/* EC_GROUP_get0_comment() returns a pointer to the 'comment' field of
|
||||
* ec_curve_data_st structure */
|
||||
const char *EC_GROUP_get0_comment(int nid);
|
||||
/* internal function : ec_group_index2nid() returns the NID of curve
|
||||
* with the given index i from the internal curve list */
|
||||
int ec_group_index2nid(int i);
|
||||
|
||||
|
||||
EC_POINT *EC_POINT_new(const EC_GROUP *);
|
||||
void EC_POINT_free(EC_POINT *);
|
||||
@ -426,111 +347,109 @@ void ERR_load_EC_strings(void);
|
||||
|
||||
/* Function codes. */
|
||||
#define EC_F_COMPUTE_WNAF 143
|
||||
#define EC_F_D2I_ECPARAMETERS 155
|
||||
#define EC_F_D2I_ECPKPARAMETERS 161
|
||||
#define EC_F_D2I_ECPRIVATEKEY 168
|
||||
#define EC_F_ECPARAMETERS_PRINT 173
|
||||
#define EC_F_ECPARAMETERS_PRINT_FP 174
|
||||
#define EC_F_ECPKPARAMETERS_PRINT 166
|
||||
#define EC_F_ECPKPARAMETERS_PRINT_FP 167
|
||||
#define EC_F_ECPUBLICKEY_GET_OCTET 170
|
||||
#define EC_F_ECPUBLICKEY_SET_OCTET 171
|
||||
#define EC_F_EC_ASN1_GROUP2CURVE 159
|
||||
#define EC_F_EC_ASN1_GROUP2FIELDID 156
|
||||
#define EC_F_EC_ASN1_GROUP2PARAMETERS 160
|
||||
#define EC_F_EC_ASN1_GROUP2PKPARAMETERS 162
|
||||
#define EC_F_D2I_ECPARAMETERS 144
|
||||
#define EC_F_D2I_ECPKPARAMETERS 145
|
||||
#define EC_F_D2I_ECPRIVATEKEY 146
|
||||
#define EC_F_ECPARAMETERS_PRINT 147
|
||||
#define EC_F_ECPARAMETERS_PRINT_FP 148
|
||||
#define EC_F_ECPKPARAMETERS_PRINT 149
|
||||
#define EC_F_ECPKPARAMETERS_PRINT_FP 150
|
||||
#define EC_F_ECPUBLICKEY_GET_OCTET 151
|
||||
#define EC_F_ECPUBLICKEY_SET_OCTET 152
|
||||
#define EC_F_EC_ASN1_GROUP2CURVE 153
|
||||
#define EC_F_EC_ASN1_GROUP2FIELDID 154
|
||||
#define EC_F_EC_ASN1_GROUP2PARAMETERS 155
|
||||
#define EC_F_EC_ASN1_GROUP2PKPARAMETERS 156
|
||||
#define EC_F_EC_ASN1_PARAMETERS2GROUP 157
|
||||
#define EC_F_EC_ASN1_PKPARAMETERS2GROUP 163
|
||||
#define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 168
|
||||
#define EC_F_EC_GF2M_SIMPLE_OCT2POINT 169
|
||||
#define EC_F_EC_GF2M_SIMPLE_POINT2OCT 170
|
||||
#define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 171
|
||||
#define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 172
|
||||
#define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 182
|
||||
#define EC_F_EC_ASN1_PKPARAMETERS2GROUP 158
|
||||
#define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159
|
||||
#define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160
|
||||
#define EC_F_EC_GF2M_SIMPLE_POINT2OCT 161
|
||||
#define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 162
|
||||
#define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 163
|
||||
#define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164
|
||||
#define EC_F_EC_GFP_MONT_FIELD_DECODE 133
|
||||
#define EC_F_EC_GFP_MONT_FIELD_ENCODE 134
|
||||
#define EC_F_EC_GFP_MONT_FIELD_MUL 131
|
||||
#define EC_F_EC_GFP_MONT_FIELD_SQR 132
|
||||
#define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 152
|
||||
#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 100
|
||||
#define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165
|
||||
#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166
|
||||
#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP 100
|
||||
#define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR 101
|
||||
#define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102
|
||||
#define EC_F_EC_GFP_SIMPLE_OCT2POINT 103
|
||||
#define EC_F_EC_GFP_SIMPLE_POINT2OCT 104
|
||||
#define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 137
|
||||
#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 105
|
||||
#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 128
|
||||
#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 129
|
||||
#define EC_F_EC_GROUP_CHECK 150
|
||||
#define EC_F_EC_GROUP_CHECK_DISCRIMINANT 153
|
||||
#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 167
|
||||
#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP 105
|
||||
#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 168
|
||||
#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP 128
|
||||
#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 169
|
||||
#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP 129
|
||||
#define EC_F_EC_GROUP_CHECK 170
|
||||
#define EC_F_EC_GROUP_CHECK_DISCRIMINANT 171
|
||||
#define EC_F_EC_GROUP_COPY 106
|
||||
#define EC_F_EC_GROUP_GET0_GENERATOR 139
|
||||
#define EC_F_EC_GROUP_GET_COFACTOR 140
|
||||
#define EC_F_EC_GROUP_GET_CURVE_GF2M 173
|
||||
#define EC_F_EC_GROUP_GET_CURVE_GF2M 172
|
||||
#define EC_F_EC_GROUP_GET_CURVE_GFP 130
|
||||
#define EC_F_EC_GROUP_GET_DEGREE 174
|
||||
#define EC_F_EC_GROUP_GET_DEGREE 173
|
||||
#define EC_F_EC_GROUP_GET_EXTRA_DATA 107
|
||||
#define EC_F_EC_GROUP_GET_ORDER 141
|
||||
#define EC_F_EC_GROUP_GROUP2NID 147
|
||||
#define EC_F_EC_GROUP_NEW 108
|
||||
#define EC_F_EC_GROUP_NEW_BY_NAME 144
|
||||
#define EC_F_EC_GROUP_NEW_BY_NID 146
|
||||
#define EC_F_EC_GROUP_NEW_GF2M_FROM_HEX 175
|
||||
#define EC_F_EC_GROUP_NEW_GFP_FROM_HEX 148
|
||||
#define EC_F_EC_GROUP_NEW_BY_NID 174
|
||||
#define EC_F_EC_GROUP_NEW_FROM_DATA 175
|
||||
#define EC_F_EC_GROUP_PRECOMPUTE_MULT 142
|
||||
#define EC_F_EC_GROUP_SET_CURVE_GF2M 176
|
||||
#define EC_F_EC_GROUP_SET_CURVE_GFP 109
|
||||
#define EC_F_EC_GROUP_SET_EXTRA_DATA 110
|
||||
#define EC_F_EC_GROUP_SET_GENERATOR 111
|
||||
#define EC_F_EC_KEY_CHECK_KEY 184
|
||||
#define EC_F_EC_KEY_COPY 186
|
||||
#define EC_F_EC_KEY_GENERATE_KEY 185
|
||||
#define EC_F_EC_KEY_PRINT 175
|
||||
#define EC_F_EC_KEY_PRINT_FP 176
|
||||
#define EC_F_EC_NEW 172
|
||||
#define EC_F_EC_KEY_CHECK_KEY 177
|
||||
#define EC_F_EC_KEY_COPY 178
|
||||
#define EC_F_EC_KEY_GENERATE_KEY 179
|
||||
#define EC_F_EC_KEY_PRINT 180
|
||||
#define EC_F_EC_KEY_PRINT_FP 181
|
||||
#define EC_F_EC_NEW 182
|
||||
#define EC_F_EC_POINTS_MAKE_AFFINE 136
|
||||
#define EC_F_EC_POINTS_MUL 138
|
||||
#define EC_F_EC_POINT_ADD 112
|
||||
#define EC_F_EC_POINT_CMP 113
|
||||
#define EC_F_EC_POINT_COPY 114
|
||||
#define EC_F_EC_POINT_DBL 115
|
||||
#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 177
|
||||
#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 183
|
||||
#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 116
|
||||
#define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 117
|
||||
#define EC_F_EC_POINT_IS_AT_INFINITY 118
|
||||
#define EC_F_EC_POINT_IS_ON_CURVE 119
|
||||
#define EC_F_EC_POINT_MAKE_AFFINE 120
|
||||
#define EC_F_EC_POINT_MUL 179
|
||||
#define EC_F_EC_POINT_MUL 184
|
||||
#define EC_F_EC_POINT_NEW 121
|
||||
#define EC_F_EC_POINT_OCT2POINT 122
|
||||
#define EC_F_EC_POINT_POINT2OCT 123
|
||||
#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 180
|
||||
#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 185
|
||||
#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 124
|
||||
#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 181
|
||||
#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 186
|
||||
#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 125
|
||||
#define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126
|
||||
#define EC_F_EC_POINT_SET_TO_INFINITY 127
|
||||
#define EC_F_EC_WNAF_MUL 183
|
||||
#define EC_F_EC_WNAF_PRECOMPUTE_MULT 178
|
||||
#define EC_F_GFP_MONT_GROUP_SET_CURVE 135
|
||||
#define EC_F_I2D_ECDSAPARAMETERS 158
|
||||
#define EC_F_I2D_ECPARAMETERS 164
|
||||
#define EC_F_I2D_ECPKPARAMETERS 165
|
||||
#define EC_F_I2D_ECPRIVATEKEY 169
|
||||
#define EC_F_EC_WNAF_MUL 187
|
||||
#define EC_F_EC_WNAF_PRECOMPUTE_MULT 188
|
||||
#define EC_F_GFP_MONT_GROUP_SET_CURVE 189
|
||||
#define EC_F_GFP_MONT_GROUP_SET_CURVE_GFP 135
|
||||
#define EC_F_I2D_ECPARAMETERS 190
|
||||
#define EC_F_I2D_ECPKPARAMETERS 191
|
||||
#define EC_F_I2D_ECPRIVATEKEY 192
|
||||
|
||||
/* Reason codes. */
|
||||
#define EC_R_ASN1_ERROR 130
|
||||
#define EC_R_ASN1_UNKNOWN_FIELD 131
|
||||
#define EC_R_ASN1_ERROR 115
|
||||
#define EC_R_ASN1_UNKNOWN_FIELD 116
|
||||
#define EC_R_BUFFER_TOO_SMALL 100
|
||||
#define EC_R_D2I_ECPARAMETERS_FAILURE 132
|
||||
#define EC_R_D2I_ECPKPARAMETERS_FAILURE 133
|
||||
#define EC_R_D2I_EC_PARAMETERS_FAILURE 123
|
||||
#define EC_R_D2I_ECPKPARAMETERS_FAILURE 117
|
||||
#define EC_R_DISCRIMINANT_IS_ZERO 118
|
||||
#define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 124
|
||||
#define EC_R_GROUP2PARAMETERS_FAILURE 125
|
||||
#define EC_R_GROUP2PKPARAMETERS_FAILURE 134
|
||||
#define EC_R_I2D_ECPKPARAMETERS_FAILURE 135
|
||||
#define EC_R_I2D_EC_PARAMETERS_FAILURE 126
|
||||
#define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119
|
||||
#define EC_R_GROUP2PKPARAMETERS_FAILURE 120
|
||||
#define EC_R_I2D_ECPKPARAMETERS_FAILURE 121
|
||||
#define EC_R_INCOMPATIBLE_OBJECTS 101
|
||||
#define EC_R_INVALID_ARGUMENT 112
|
||||
#define EC_R_INVALID_COMPRESSED_POINT 110
|
||||
@ -538,25 +457,22 @@ void ERR_load_EC_strings(void);
|
||||
#define EC_R_INVALID_ENCODING 102
|
||||
#define EC_R_INVALID_FIELD 103
|
||||
#define EC_R_INVALID_FORM 104
|
||||
#define EC_R_INVALID_GROUP_ORDER 119
|
||||
#define EC_R_INVALID_PRIVATE_KEY 139
|
||||
#define EC_R_MISSING_PARAMETERS 127
|
||||
#define EC_R_MISSING_PRIVATE_KEY 138
|
||||
#define EC_R_NOT_IMPLEMENTED 136
|
||||
#define EC_R_INVALID_GROUP_ORDER 122
|
||||
#define EC_R_INVALID_PRIVATE_KEY 123
|
||||
#define EC_R_MISSING_PARAMETERS 124
|
||||
#define EC_R_MISSING_PRIVATE_KEY 125
|
||||
#define EC_R_NOT_IMPLEMENTED 126
|
||||
#define EC_R_NOT_INITIALIZED 111
|
||||
#define EC_R_NO_SUCH_EXTRA_DATA 105
|
||||
#define EC_R_PARAMETERS2GROUP_FAILURE 128
|
||||
#define EC_R_PKPARAMETERS2GROUP_FAILURE 137
|
||||
#define EC_R_PKPARAMETERS2GROUP_FAILURE 127
|
||||
#define EC_R_POINT_AT_INFINITY 106
|
||||
#define EC_R_POINT_IS_NOT_ON_CURVE 107
|
||||
#define EC_R_SLOT_FULL 108
|
||||
#define EC_R_UNDEFINED_GENERATOR 113
|
||||
#define EC_R_UNDEFINED_ORDER 122
|
||||
#define EC_R_UNKNOWN_GROUP 116
|
||||
#define EC_R_UNKNOWN_NID 117
|
||||
#define EC_R_UNDEFINED_ORDER 128
|
||||
#define EC_R_UNKNOWN_GROUP 129
|
||||
#define EC_R_UNKNOWN_ORDER 114
|
||||
#define EC_R_UNKNOWN_PARAMETERS_TYPE 129
|
||||
#define EC_R_WRONG_ORDER 140
|
||||
#define EC_R_WRONG_ORDER 130
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -770,7 +770,7 @@ EC_GROUP *EC_ASN1_pkparameters2group(const ECPKPARAMETERS *params)
|
||||
if (params->type == 0)
|
||||
{ /* the curve is given by an OID */
|
||||
tmp = OBJ_obj2nid(params->value.named_curve);
|
||||
if ((ret = EC_GROUP_new_by_name(tmp)) == NULL)
|
||||
if ((ret = EC_GROUP_new_by_nid(tmp)) == NULL)
|
||||
{
|
||||
ECerr(EC_F_EC_ASN1_PKPARAMETERS2GROUP,
|
||||
EC_R_EC_GROUP_NEW_BY_NAME_FAILURE);
|
||||
|
1873
crypto/ec/ec_curve.c
1873
crypto/ec/ec_curve.c
File diff suppressed because it is too large
Load Diff
@ -94,14 +94,18 @@ static ERR_STRING_DATA EC_str_functs[]=
|
||||
{ERR_PACK(0,EC_F_EC_GFP_MONT_FIELD_SQR,0), "ec_GFp_mont_field_sqr"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT,0), "ec_GFp_simple_group_check_discriminant"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE,0), "ec_GFp_simple_group_set_curve"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP,0), "EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR,0), "EC_GFP_SIMPLE_GROUP_SET_GENERATOR"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_MAKE_AFFINE,0), "ec_GFp_simple_make_affine"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_OCT2POINT,0), "ec_GFp_simple_oct2point"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT2OCT,0), "ec_GFp_simple_point2oct"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE,0), "ec_GFp_simple_points_make_affine"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES,0), "ec_GFp_simple_point_get_affine_coordinates"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP,0), "EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES,0), "ec_GFp_simple_point_set_affine_coordinates"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP,0), "EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES,0), "ec_GFp_simple_set_compressed_coordinates"},
|
||||
{ERR_PACK(0,EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP,0), "EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_CHECK,0), "EC_GROUP_check"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_CHECK_DISCRIMINANT,0), "EC_GROUP_check_discriminant"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_COPY,0), "EC_GROUP_copy"},
|
||||
@ -114,10 +118,8 @@ static ERR_STRING_DATA EC_str_functs[]=
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_GET_ORDER,0), "EC_GROUP_get_order"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_GROUP2NID,0), "EC_GROUP_GROUP2NID"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_NEW,0), "EC_GROUP_new"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_NEW_BY_NAME,0), "EC_GROUP_new_by_name"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_NEW_BY_NID,0), "EC_GROUP_new_by_nid"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_NEW_GF2M_FROM_HEX,0), "EC_GROUP_NEW_GF2M_FROM_HEX"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_NEW_GFP_FROM_HEX,0), "EC_GROUP_NEW_GFP_FROM_HEX"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_NEW_FROM_DATA,0), "EC_GROUP_NEW_FROM_DATA"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_PRECOMPUTE_MULT,0), "EC_GROUP_precompute_mult"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_SET_CURVE_GF2M,0), "EC_GROUP_set_curve_GF2m"},
|
||||
{ERR_PACK(0,EC_F_EC_GROUP_SET_CURVE_GFP,0), "EC_GROUP_set_curve_GFp"},
|
||||
@ -154,7 +156,7 @@ static ERR_STRING_DATA EC_str_functs[]=
|
||||
{ERR_PACK(0,EC_F_EC_WNAF_MUL,0), "ec_wNAF_mul"},
|
||||
{ERR_PACK(0,EC_F_EC_WNAF_PRECOMPUTE_MULT,0), "ec_wNAF_precompute_mult"},
|
||||
{ERR_PACK(0,EC_F_GFP_MONT_GROUP_SET_CURVE,0), "GFP_MONT_GROUP_SET_CURVE"},
|
||||
{ERR_PACK(0,EC_F_I2D_ECDSAPARAMETERS,0), "I2D_ECDSAPARAMETERS"},
|
||||
{ERR_PACK(0,EC_F_GFP_MONT_GROUP_SET_CURVE_GFP,0), "GFP_MONT_GROUP_SET_CURVE_GFP"},
|
||||
{ERR_PACK(0,EC_F_I2D_ECPARAMETERS,0), "i2d_ECParameters"},
|
||||
{ERR_PACK(0,EC_F_I2D_ECPKPARAMETERS,0), "i2d_ECPKParameters"},
|
||||
{ERR_PACK(0,EC_F_I2D_ECPRIVATEKEY,0), "i2d_ECPrivateKey"},
|
||||
@ -166,15 +168,11 @@ static ERR_STRING_DATA EC_str_reasons[]=
|
||||
{EC_R_ASN1_ERROR ,"asn1 error"},
|
||||
{EC_R_ASN1_UNKNOWN_FIELD ,"asn1 unknown field"},
|
||||
{EC_R_BUFFER_TOO_SMALL ,"buffer too small"},
|
||||
{EC_R_D2I_ECPARAMETERS_FAILURE ,"d2i ecparameters failure"},
|
||||
{EC_R_D2I_ECPKPARAMETERS_FAILURE ,"d2i ecpkparameters failure"},
|
||||
{EC_R_D2I_EC_PARAMETERS_FAILURE ,"d2i ec parameters failure"},
|
||||
{EC_R_DISCRIMINANT_IS_ZERO ,"discriminant is zero"},
|
||||
{EC_R_EC_GROUP_NEW_BY_NAME_FAILURE ,"ec group new by name failure"},
|
||||
{EC_R_GROUP2PARAMETERS_FAILURE ,"group2parameters failure"},
|
||||
{EC_R_GROUP2PKPARAMETERS_FAILURE ,"group2pkparameters failure"},
|
||||
{EC_R_I2D_ECPKPARAMETERS_FAILURE ,"i2d ecpkparameters failure"},
|
||||
{EC_R_I2D_EC_PARAMETERS_FAILURE ,"i2d ec parameters failure"},
|
||||
{EC_R_INCOMPATIBLE_OBJECTS ,"incompatible objects"},
|
||||
{EC_R_INVALID_ARGUMENT ,"invalid argument"},
|
||||
{EC_R_INVALID_COMPRESSED_POINT ,"invalid compressed point"},
|
||||
@ -189,7 +187,6 @@ static ERR_STRING_DATA EC_str_reasons[]=
|
||||
{EC_R_NOT_IMPLEMENTED ,"not implemented"},
|
||||
{EC_R_NOT_INITIALIZED ,"not initialized"},
|
||||
{EC_R_NO_SUCH_EXTRA_DATA ,"no such extra data"},
|
||||
{EC_R_PARAMETERS2GROUP_FAILURE ,"parameters2group failure"},
|
||||
{EC_R_PKPARAMETERS2GROUP_FAILURE ,"pkparameters2group failure"},
|
||||
{EC_R_POINT_AT_INFINITY ,"point at infinity"},
|
||||
{EC_R_POINT_IS_NOT_ON_CURVE ,"point is not on curve"},
|
||||
@ -197,9 +194,7 @@ static ERR_STRING_DATA EC_str_reasons[]=
|
||||
{EC_R_UNDEFINED_GENERATOR ,"undefined generator"},
|
||||
{EC_R_UNDEFINED_ORDER ,"undefined order"},
|
||||
{EC_R_UNKNOWN_GROUP ,"unknown group"},
|
||||
{EC_R_UNKNOWN_NID ,"unknown nid"},
|
||||
{EC_R_UNKNOWN_ORDER ,"unknown order"},
|
||||
{EC_R_UNKNOWN_PARAMETERS_TYPE ,"unknown parameters type"},
|
||||
{EC_R_WRONG_ORDER ,"wrong order"},
|
||||
{0,NULL}
|
||||
};
|
||||
|
@ -129,7 +129,7 @@ int test_ecdh_curve(int nid, char *text, BN_CTX *ctx, BIO *out)
|
||||
int i,alen,blen,aout,bout,ret=0;
|
||||
|
||||
if ((a=EC_KEY_new()) == NULL) goto err;
|
||||
if ((a->group=EC_GROUP_new_by_name(nid)) == NULL) goto err;
|
||||
if ((a->group=EC_GROUP_new_by_nid(nid)) == NULL) goto err;
|
||||
|
||||
if ((b=EC_KEY_new()) == NULL) goto err;
|
||||
b->group = a->group;
|
||||
@ -242,22 +242,22 @@ int main(int argc, char *argv[])
|
||||
if ((ctx=BN_CTX_new()) == NULL) goto err;
|
||||
|
||||
/* NIST PRIME CURVES TESTS */
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_PRIME_192, "NIST Prime-Curve P-192", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_PRIME_224, "NIST Prime-Curve P-224", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_PRIME_256, "NIST Prime-Curve P-256", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_PRIME_384, "NIST Prime-Curve P-384", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_PRIME_521, "NIST Prime-Curve P-521", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_X9_62_prime192v1, "NIST Prime-Curve P-192", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_secp224r1, "NIST Prime-Curve P-224", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_X9_62_prime256v1, "NIST Prime-Curve P-256", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_secp384r1, "NIST Prime-Curve P-384", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_secp521r1, "NIST Prime-Curve P-521", ctx, out)) goto err;
|
||||
/* NIST BINARY CURVES TESTS */
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_CHAR2_K163, "NIST Binary-Curve K-163", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_CHAR2_B163, "NIST Binary-Curve B-163", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_CHAR2_K233, "NIST Binary-Curve K-233", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_CHAR2_B233, "NIST Binary-Curve B-233", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_CHAR2_K283, "NIST Binary-Curve K-283", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_CHAR2_B283, "NIST Binary-Curve B-283", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_CHAR2_K409, "NIST Binary-Curve K-409", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_CHAR2_B409, "NIST Binary-Curve B-409", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_CHAR2_K571, "NIST Binary-Curve K-571", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(EC_GROUP_NIST_CHAR2_B571, "NIST Binary-Curve B-571", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_sect163k1, "NIST Binary-Curve K-163", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_sect163r2, "NIST Binary-Curve B-163", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_sect233k1, "NIST Binary-Curve K-233", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_sect233r1, "NIST Binary-Curve B-233", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_sect283k1, "NIST Binary-Curve K-283", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_sect283r1, "NIST Binary-Curve B-283", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_sect409k1, "NIST Binary-Curve K-409", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_sect409r1, "NIST Binary-Curve B-409", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_sect571k1, "NIST Binary-Curve K-571", ctx, out)) goto err;
|
||||
if (!test_ecdh_curve(NID_sect571r1, "NIST Binary-Curve B-571", ctx, out)) goto err;
|
||||
|
||||
ret = 0;
|
||||
|
||||
|
@ -156,7 +156,7 @@ int set_p192_param(EC_KEY *ecdsa)
|
||||
if ((ctx = BN_CTX_new()) == NULL) goto err;
|
||||
clear_ecdsa(ecdsa);
|
||||
|
||||
if ((ecdsa->group = EC_GROUP_new_by_name(EC_GROUP_X9_62_PRIME_192V1)) == NULL)
|
||||
if ((ecdsa->group = EC_GROUP_new_by_nid(NID_X9_62_prime192v1)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"ECDSA_SET_GROUP_P_192_V1() failed \n");
|
||||
goto err;
|
||||
@ -189,7 +189,7 @@ int set_p239_param(EC_KEY *ecdsa)
|
||||
if ((ctx = BN_CTX_new()) == NULL) goto err;
|
||||
clear_ecdsa(ecdsa);
|
||||
|
||||
if ((ecdsa->group = EC_GROUP_new_by_name(EC_GROUP_X9_62_PRIME_239V1)) == NULL)
|
||||
if ((ecdsa->group = EC_GROUP_new_by_nid(NID_X9_62_prime239v1)) == NULL)
|
||||
{
|
||||
BIO_printf(bio_err,"ECDSA_SET_GROUP_P_239_V1() failed \n");
|
||||
goto err;
|
||||
@ -566,7 +566,7 @@ int main(void)
|
||||
BIO_printf(bio_err, "Testing sign & verify with %s : \n", text); \
|
||||
EC_KEY_free(ecdsa); \
|
||||
if ((ecdsa = EC_KEY_new()) == NULL) goto err; \
|
||||
if ((ecdsa->group = EC_GROUP_new_by_name(curve)) == NULL) goto err; \
|
||||
if ((ecdsa->group = EC_GROUP_new_by_nid(curve)) == NULL) goto err; \
|
||||
if (!EC_KEY_generate_key(ecdsa)) goto err; \
|
||||
tim = clock(); \
|
||||
for (i=0; i<ECDSA_NIST_TESTS; i++) \
|
||||
@ -589,22 +589,22 @@ int main(void)
|
||||
}
|
||||
|
||||
/* NIST PRIME CURVES TESTS */
|
||||
ECDSA_GROUP_TEST("NIST Prime-Curve P-192", EC_GROUP_NIST_PRIME_192);
|
||||
ECDSA_GROUP_TEST("NIST Prime-Curve P-224", EC_GROUP_NIST_PRIME_224);
|
||||
ECDSA_GROUP_TEST("NIST Prime-Curve P-256", EC_GROUP_NIST_PRIME_256);
|
||||
ECDSA_GROUP_TEST("NIST Prime-Curve P-384", EC_GROUP_NIST_PRIME_384);
|
||||
ECDSA_GROUP_TEST("NIST Prime-Curve P-521", EC_GROUP_NIST_PRIME_521);
|
||||
ECDSA_GROUP_TEST("NIST Prime-Curve P-192", NID_X9_62_prime192v1);
|
||||
ECDSA_GROUP_TEST("NIST Prime-Curve P-224", NID_secp224r1);
|
||||
ECDSA_GROUP_TEST("NIST Prime-Curve P-256", NID_X9_62_prime256v1);
|
||||
ECDSA_GROUP_TEST("NIST Prime-Curve P-384", NID_secp384r1);
|
||||
ECDSA_GROUP_TEST("NIST Prime-Curve P-521", NID_secp521r1);
|
||||
/* NIST BINARY CURVES TESTS */
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve K-163", EC_GROUP_NIST_CHAR2_K163);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve B-163", EC_GROUP_NIST_CHAR2_B163);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve K-233", EC_GROUP_NIST_CHAR2_K233);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve B-233", EC_GROUP_NIST_CHAR2_B233);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve K-283", EC_GROUP_NIST_CHAR2_K283);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve B-283", EC_GROUP_NIST_CHAR2_B283);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve K-409", EC_GROUP_NIST_CHAR2_K409);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve B-409", EC_GROUP_NIST_CHAR2_B409);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve K-571", EC_GROUP_NIST_CHAR2_K571);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve B-571", EC_GROUP_NIST_CHAR2_B571);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve K-163", NID_sect163k1);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve B-163", NID_sect163r2);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve K-233", NID_sect233k1);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve B-233", NID_sect233r1);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve K-283", NID_sect283k1);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve B-283", NID_sect283r1);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve K-409", NID_sect409k1);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve B-409", NID_sect409r1);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve K-571", NID_sect571k1);
|
||||
ECDSA_GROUP_TEST("NIST Binary-Curve B-571", NID_sect571r1);
|
||||
#undef ECDSA_GROUP_TEST
|
||||
|
||||
EC_KEY_free(ecdsa);
|
||||
|
@ -2785,7 +2785,7 @@ NCONF_default 3227 EXIST::FUNCTION:
|
||||
OPENSSL_no_config 3228 EXIST::FUNCTION:
|
||||
NCONF_WIN32 3229 EXIST::FUNCTION:
|
||||
ECDSA_set_conversion_form 3230 NOEXIST::FUNCTION:
|
||||
EC_GROUP_new_by_name 3231 EXIST::FUNCTION:EC
|
||||
EC_GROUP_new_by_name 3231 NOEXIST::FUNCTION:
|
||||
d2i_ECDSA_PUBKEY 3232 NOEXIST::FUNCTION:
|
||||
PEM_read_bio_ECDSAPrivateKey 3233 NOEXIST::FUNCTION:
|
||||
EC_GROUP_get_asn1_flag 3234 EXIST::FUNCTION:EC
|
||||
@ -2911,7 +2911,8 @@ ECDSA_get_enc_flag 3347 NOEXIST::FUNCTION:
|
||||
ECDSA_set_enc_flag 3348 NOEXIST::FUNCTION:
|
||||
i2d_EC_PRIVATEKEY 3349 NOEXIST::FUNCTION:
|
||||
EC_PRIVATEKEY_free 3350 NOEXIST::FUNCTION:
|
||||
EC_POINT_get_affine_coordinates_GF2m 3351 EXIST::FUNCTION:EC
|
||||
EC_POINT_get_affine_coordinates_GF2m 3351 EXIST:!VMS:FUNCTION:EC
|
||||
EC_POINT_get_affine_coords_GF2m 3351 EXIST:VMS:FUNCTION:EC
|
||||
BN_GF2m_mod_sqr_arr 3352 EXIST::FUNCTION:
|
||||
EC_GROUP_new_curve_GF2m 3353 EXIST::FUNCTION:EC
|
||||
EC_GF2m_simple_method 3354 EXIST::FUNCTION:EC
|
||||
@ -2919,7 +2920,8 @@ EC_GROUP_set_curve_GF2m 3355 EXIST::FUNCTION:EC
|
||||
EC_GROUP_dup 3356 EXIST::FUNCTION:EC
|
||||
BN_GF2m_mod_solve_quad 3357 EXIST::FUNCTION:
|
||||
BN_GF2m_mod_div 3358 EXIST::FUNCTION:
|
||||
EC_POINT_set_compressed_coordinates_GF2m 3359 EXIST::FUNCTION:EC
|
||||
EC_POINT_set_compressed_coordinates_GF2m 3359 EXIST:!VMS:FUNCTION:EC
|
||||
EC_POINT_set_compr_coords_GF2m 3359 EXIST:VMS:FUNCTION:EC
|
||||
BN_GF2m_mod_sqr 3360 EXIST::FUNCTION:
|
||||
BN_GF2m_add 3361 EXIST::FUNCTION:
|
||||
BN_GF2m_mod_solve_quad_arr 3362 EXIST::FUNCTION:
|
||||
@ -2939,7 +2941,8 @@ BN_GF2m_mod_inv_arr 3375 EXIST::FUNCTION:
|
||||
BN_GF2m_mod_exp_arr 3376 EXIST::FUNCTION:
|
||||
BN_GF2m_poly2arr 3377 EXIST::FUNCTION:
|
||||
EC_POINT_dup 3378 EXIST::FUNCTION:EC
|
||||
EC_POINT_set_affine_coordinates_GF2m 3379 EXIST::FUNCTION:EC
|
||||
EC_POINT_set_affine_coordinates_GF2m 3379 EXIST:!VMS:FUNCTION:EC
|
||||
EC_POINT_set_affine_coords_GF2m 3379 EXIST:VMS:FUNCTION:EC
|
||||
i2d_EC_PUBKEY 3380 EXIST::FUNCTION:EC
|
||||
i2d_ECPrivateKey 3381 EXIST::FUNCTION:EC
|
||||
EC_KEY_free 3382 EXIST::FUNCTION:EC
|
||||
@ -3000,3 +3003,5 @@ ENGINE_register_all_ECDH 3436 EXIST::FUNCTION:
|
||||
ECDH_DATA_new_method 3437 EXIST::FUNCTION:ECDH
|
||||
ENGINE_set_default_ECDH 3438 EXIST::FUNCTION:
|
||||
ENGINE_register_ECDH 3439 EXIST::FUNCTION:
|
||||
EC_GROUP_get0_comment 3440 EXIST::FUNCTION:EC
|
||||
ec_group_index2nid 3441 EXIST::FUNCTION:EC
|
||||
|
Loading…
Reference in New Issue
Block a user