diff options
author | Adam Langley <agl@google.com> | 2015-04-14 22:07:44 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-04-16 23:53:05 +0300 |
commit | ad6b28e9745a3567ac991ca3cc57a1bbafd0642a (patch) | |
tree | 411a9ea28a72236fd79b83fde577a773391aa231 /crypto/ec/ec.c | |
parent | 042bcdd9bd68633b5bc9ded6b82ba59e03c33583 (diff) |
Add 64-bit, P-256 implementation.
This is taken from upstream, although it originally came from us. This
will only take effect on 64-bit systems (x86-64 and aarch64).
Before:
Did 1496 ECDH P-256 operations in 1038743us (1440.2 ops/sec)
Did 2783 ECDSA P-256 signing operations in 1081006us (2574.5 ops/sec)
Did 2400 ECDSA P-256 verify operations in 1059508us (2265.2 ops/sec)
After:
Did 4147 ECDH P-256 operations in 1061723us (3905.9 ops/sec)
Did 9372 ECDSA P-256 signing operations in 1040589us (9006.4 ops/sec)
Did 4114 ECDSA P-256 verify operations in 1063478us (3868.4 ops/sec)
Change-Id: I11fabb03239cc3a7c4a97325ed4e4c97421f91a9
Diffstat (limited to 'crypto/ec/ec.c')
-rw-r--r-- | crypto/ec/ec.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/crypto/ec/ec.c b/crypto/ec/ec.c index 5378fcf7..ab65ffb0 100644 --- a/crypto/ec/ec.c +++ b/crypto/ec/ec.c @@ -219,11 +219,18 @@ static const struct curve_data P521 = { 0xB7, 0x1E, 0x91, 0x38, 0x64, 0x09}}; const struct built_in_curve OPENSSL_built_in_curves[] = { - {NID_secp224r1, &P224, 0}, - {NID_X9_62_prime256v1, &P256, 0}, - {NID_secp384r1, &P384, 0}, - {NID_secp521r1, &P521, 0}, - {NID_undef, 0, 0}, + {NID_secp224r1, &P224, 0}, + { + NID_X9_62_prime256v1, &P256, +#if defined(OPENSSL_64_BIT) && !defined(OPENSSL_WINDOWS) + EC_GFp_nistp256_method, +#else + 0, +#endif + }, + {NID_secp384r1, &P384, 0}, + {NID_secp521r1, &P521, 0}, + {NID_undef, 0, 0}, }; EC_GROUP *ec_group_new(const EC_METHOD *meth) { |