]> Cypherpunks repositories - gostls13.git/commit
crypto/elliptic,crypto/ecdsa: P256 amd64 assembly
authorVlad Krasnov <vlad@cloudflare.com>
Fri, 17 Apr 2015 13:10:35 +0000 (06:10 -0700)
committerAdam Langley <agl@golang.org>
Tue, 10 Nov 2015 22:16:56 +0000 (22:16 +0000)
commit7bacfc640fba4fb2e50bbcc16a4c15fe4bf5b870
tree697564cd702bcc37c694e8f36b6247baa7ac9d0f
parent50fa64677611313bdd343c1dab85bf0c297d21a4
crypto/elliptic,crypto/ecdsa: P256 amd64 assembly

This is based on the implementation used in OpenSSL, from a
submission by Shay Gueron and myself. Besides using assembly,
this implementation employs several optimizations described in:

    S.Gueron and V.Krasnov, "Fast prime field elliptic-curve
                             cryptography with 256-bit primes"

In addition a new and improved modular inverse modulo N is
implemented here.

The performance measured on a Haswell based Macbook Pro shows 21X
speedup for the sign and 9X for the verify operations.
The operation BaseMult is 30X faster (and the Diffie-Hellman/ECDSA
key generation that use it are sped up as well).

The adaptation to Go with the help of Filippo Valsorda

Updated the submission for faster verify/ecdh, fixed some asm syntax
and API problems and added benchmarks.

Change-Id: I86a33636747d5c92f15e0c8344caa2e7e07e0028
Reviewed-on: https://go-review.googlesource.com/8968
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
src/crypto/ecdsa/ecdsa.go
src/crypto/ecdsa/ecdsa_test.go
src/crypto/elliptic/elliptic_test.go
src/crypto/elliptic/p256.go
src/crypto/elliptic/p256_amd64.go [new file with mode: 0644]
src/crypto/elliptic/p256_asm_amd64.s [new file with mode: 0644]