diff options
Diffstat (limited to 'src/lib/libcrypto/ec/ec_cvt.c')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_cvt.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/lib/libcrypto/ec/ec_cvt.c b/src/lib/libcrypto/ec/ec_cvt.c index bfcbab35fe..d45640bab9 100644 --- a/src/lib/libcrypto/ec/ec_cvt.c +++ b/src/lib/libcrypto/ec/ec_cvt.c | |||
| @@ -78,32 +78,7 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM | |||
| 78 | const EC_METHOD *meth; | 78 | const EC_METHOD *meth; |
| 79 | EC_GROUP *ret; | 79 | EC_GROUP *ret; |
| 80 | 80 | ||
| 81 | #if defined(OPENSSL_BN_ASM_MONT) | ||
| 82 | /* | ||
| 83 | * This might appear controversial, but the fact is that generic | ||
| 84 | * prime method was observed to deliver better performance even | ||
| 85 | * for NIST primes on a range of platforms, e.g.: 60%-15% | ||
| 86 | * improvement on IA-64, ~25% on ARM, 30%-90% on P4, 20%-25% | ||
| 87 | * in 32-bit build and 35%--12% in 64-bit build on Core2... | ||
| 88 | * Coefficients are relative to optimized bn_nist.c for most | ||
| 89 | * intensive ECDSA verify and ECDH operations for 192- and 521- | ||
| 90 | * bit keys respectively. Choice of these boundary values is | ||
| 91 | * arguable, because the dependency of improvement coefficient | ||
| 92 | * from key length is not a "monotone" curve. For example while | ||
| 93 | * 571-bit result is 23% on ARM, 384-bit one is -1%. But it's | ||
| 94 | * generally faster, sometimes "respectfully" faster, sometimes | ||
| 95 | * "tolerably" slower... What effectively happens is that loop | ||
| 96 | * with bn_mul_add_words is put against bn_mul_mont, and the | ||
| 97 | * latter "wins" on short vectors. Correct solution should be | ||
| 98 | * implementing dedicated NxN multiplication subroutines for | ||
| 99 | * small N. But till it materializes, let's stick to generic | ||
| 100 | * prime method... | ||
| 101 | * <appro> | ||
| 102 | */ | ||
| 103 | meth = EC_GFp_mont_method(); | ||
| 104 | #else | ||
| 105 | meth = EC_GFp_nist_method(); | 81 | meth = EC_GFp_nist_method(); |
| 106 | #endif | ||
| 107 | 82 | ||
| 108 | ret = EC_GROUP_new(meth); | 83 | ret = EC_GROUP_new(meth); |
| 109 | if (ret == NULL) | 84 | if (ret == NULL) |
| @@ -147,7 +122,7 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM | |||
| 147 | return ret; | 122 | return ret; |
| 148 | } | 123 | } |
| 149 | 124 | ||
| 150 | #ifndef OPENSSL_NO_EC2M | 125 | |
| 151 | EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) | 126 | EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) |
| 152 | { | 127 | { |
| 153 | const EC_METHOD *meth; | 128 | const EC_METHOD *meth; |
| @@ -167,4 +142,3 @@ EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM | |||
| 167 | 142 | ||
| 168 | return ret; | 143 | return ret; |
| 169 | } | 144 | } |
| 170 | #endif | ||
