1
0
mirror of https://github.com/golang/go synced 2024-11-07 20:56:16 -07:00
go/src/crypto
Vlad Krasnov ff81a6444a crypto/elliptic: implement P256 for arm64
This patch ports the existing optimized P256 implementation to arm64.

name            old time/op    new time/op    delta
pkg:crypto/ecdsa goos:linux goarch:arm64
SignP256           539µs ±13%      43µs ± 2%  -91.95%  (p=0.000 n=20+20)
SignP384          13.2ms ± 1%    13.2ms ± 1%     ~     (p=0.739 n=10+10)
VerifyP256        1.57ms ± 0%    0.12ms ± 0%  -92.40%  (p=0.000 n=18+20)
KeyGeneration      391µs ± 0%      25µs ± 0%  -93.62%  (p=0.000 n=9+9)
pkg:crypto/elliptic goos:linux goarch:arm64
BaseMult          1.66ms ± 0%    1.65ms ± 1%     ~     (p=0.079 n=9+10)
BaseMultP256       389µs ± 0%      22µs ± 1%  -94.28%  (p=0.000 n=19+20)
ScalarMultP256    1.03ms ± 0%    0.09ms ± 0%  -91.25%  (p=0.000 n=19+20)

name            old alloc/op   new alloc/op   delta
pkg:crypto/ecdsa goos:linux goarch:arm64
SignP256          5.47kB ± 0%    3.20kB ± 0%  -41.50%  (p=0.000 n=20+20)
SignP384          2.32MB ± 0%    2.32MB ± 0%     ~     (p=0.739 n=10+10)
VerifyP256        7.65kB ± 4%    0.98kB ± 0%  -87.24%  (p=0.000 n=20+20)
KeyGeneration     1.41kB ± 0%    0.69kB ± 0%  -51.05%  (p=0.000 n=9+10)
pkg:crypto/elliptic goos:linux goarch:arm64
BaseMult            224B ± 0%      224B ± 0%     ~     (all equal)
BaseMultP256      1.12kB ± 0%    0.29kB ± 0%  -74.29%  (p=0.000 n=20+20)
ScalarMultP256    1.59kB ± 7%    0.26kB ± 0%  -83.91%  (p=0.000 n=20+20)

name            old allocs/op  new allocs/op  delta
pkg:crypto/ecdsa goos:linux goarch:arm64
SignP256            67.0 ± 0%      35.0 ± 0%  -47.76%  (p=0.000 n=20+20)
SignP384           17.5k ± 0%     17.5k ± 0%     ~     (p=0.725 n=10+10)
VerifyP256          97.2 ± 3%      17.0 ± 0%  -82.52%  (p=0.000 n=20+20)
KeyGeneration       21.0 ± 0%      13.0 ± 0%  -38.10%  (p=0.000 n=10+10)
pkg:crypto/elliptic goos:linux goarch:arm64
BaseMult            5.00 ± 0%      5.00 ± 0%     ~     (all equal)
BaseMultP256        16.0 ± 0%       6.0 ± 0%  -62.50%  (p=0.000 n=20+20)
ScalarMultP256      19.9 ± 6%       5.0 ± 0%  -74.87%  (p=0.000 n=20+20)

Fixes #22806

Change-Id: I12b343a27e6544189334f99c84242bb59db70a76
Reviewed-on: https://go-review.googlesource.com/121360
Run-TryBot: Vlad Krasnov <vlad@cloudflare.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Vlad Krasnov <vlad@cloudflare.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-07-19 18:40:51 +00:00
..
aes crypto: panic on illegal input and output overlap 2018-06-19 21:06:50 +00:00
cipher crypto: panic on illegal input and output overlap 2018-06-19 21:06:50 +00:00
des crypto: panic on illegal input and output overlap 2018-06-19 21:06:50 +00:00
dsa crypto: randomly read an extra byte of randomness in some places. 2018-06-07 15:09:25 +00:00
ecdsa crypto: randomly read an extra byte of randomness in some places. 2018-06-07 15:09:25 +00:00
elliptic crypto/elliptic: implement P256 for arm64 2018-07-19 18:40:51 +00:00
hmac all: update comment URLs from HTTP to HTTPS, where possible 2018-06-01 21:52:00 +00:00
internal crypto: panic on illegal input and output overlap 2018-06-19 21:06:50 +00:00
md5 crypto/md5: unnecessary conversion 2018-04-24 15:49:43 +00:00
rand syscall/js: add TypedArrayOf 2018-06-27 20:29:21 +00:00
rc4 crypto: panic on illegal input and output overlap 2018-06-19 21:06:50 +00:00
rsa crypto: randomly read an extra byte of randomness in some places. 2018-06-07 15:09:25 +00:00
sha1 crypto, internal/cpu: fix s390x AES feature detection and update SHA implementations 2018-06-11 11:41:31 +00:00
sha256 crypto, internal/cpu: fix s390x AES feature detection and update SHA implementations 2018-06-11 11:41:31 +00:00
sha512 crypto, internal/cpu: fix s390x AES feature detection and update SHA implementations 2018-06-11 11:41:31 +00:00
subtle
tls crypto/tls: add RSASSA-PSS support for handshake messages 2018-06-27 23:08:06 +00:00
x509 crypto/x509: add GODEBUG option x509ignoreCN=1 2018-07-16 19:30:55 +00:00
crypto.go
issue21104_test.go