Fork of the Go standard TLS library, providing low-level access to the ClientHello for mimicry purposes.
Find a file
Filippo Valsorda 5661b3ddeb crypto/ecdsa: use bigmod and nistec instead of math/big and crypto/elliptic
Ignoring custom curves, this makes the whole package constant-time.
There is a slight loss in performance for P-384 and P-521 because bigmod
is slower than math/big (but P-256 has an assembly scalar field
inversion, so doesn't use bigmod for anything big).

name                old time/op    new time/op    delta
Sign/P256-8           19.2µs ± 2%    19.1µs ± 2%     ~     (p=0.268 n=9+10)
Sign/P384-8            166µs ± 3%     188µs ± 2%  +13.52%  (p=0.000 n=10+10)
Sign/P521-8            337µs ± 2%     359µs ± 2%   +6.46%  (p=0.000 n=10+10)
Verify/P256-8         58.1µs ± 2%    58.1µs ± 2%     ~     (p=0.971 n=10+10)
Verify/P384-8          484µs ± 2%     569µs ±12%  +17.65%  (p=0.000 n=10+10)
Verify/P521-8         1.03ms ± 4%    1.14ms ± 2%  +11.02%  (p=0.000 n=10+10)
GenerateKey/P256-8    12.4µs ±12%    12.0µs ± 2%     ~     (p=0.063 n=10+10)
GenerateKey/P384-8     129µs ±18%     119µs ± 2%     ~     (p=0.190 n=10+10)
GenerateKey/P521-8     241µs ± 2%     240µs ± 2%     ~     (p=0.436 n=10+10)

name                old alloc/op   new alloc/op   delta
Sign/P256-8           3.08kB ± 0%    2.47kB ± 0%  -19.77%  (p=0.000 n=10+10)
Sign/P384-8           6.16kB ± 0%    2.64kB ± 0%  -57.16%  (p=0.000 n=10+10)
Sign/P521-8           7.87kB ± 0%    3.01kB ± 0%  -61.80%  (p=0.000 n=10+10)
Verify/P256-8         1.29kB ± 1%    0.48kB ± 0%  -62.69%  (p=0.000 n=10+10)
Verify/P384-8         2.49kB ± 1%    0.64kB ± 0%  -74.25%  (p=0.000 n=10+10)
Verify/P521-8         3.31kB ± 0%    0.96kB ± 0%  -71.02%  (p=0.000 n=7+10)
GenerateKey/P256-8      720B ± 0%      920B ± 0%  +27.78%  (p=0.000 n=10+10)
GenerateKey/P384-8      921B ± 0%     1120B ± 0%  +21.61%  (p=0.000 n=9+10)
GenerateKey/P521-8    1.30kB ± 0%    1.44kB ± 0%  +10.45%  (p=0.000 n=10+10)

name                old allocs/op  new allocs/op  delta
Sign/P256-8             45.0 ± 0%      33.0 ± 0%  -26.67%  (p=0.000 n=10+10)
Sign/P384-8             69.0 ± 0%      34.0 ± 0%  -50.72%  (p=0.000 n=10+10)
Sign/P521-8             71.0 ± 0%      35.0 ± 0%  -50.70%  (p=0.000 n=10+10)
Verify/P256-8           23.0 ± 0%      10.0 ± 0%  -56.52%  (p=0.000 n=10+10)
Verify/P384-8           43.0 ± 0%      14.0 ± 0%  -67.44%  (p=0.000 n=10+10)
Verify/P521-8           45.0 ± 0%      14.0 ± 0%  -68.89%  (p=0.000 n=7+10)
GenerateKey/P256-8      13.0 ± 0%      14.0 ± 0%   +7.69%  (p=0.000 n=10+10)
GenerateKey/P384-8      16.0 ± 0%      17.0 ± 0%   +6.25%  (p=0.000 n=10+10)
GenerateKey/P521-8      16.5 ± 3%      17.0 ± 0%   +3.03%  (p=0.033 n=10+10)

Change-Id: I4e074ef039b0f7ffbc436a4cdbe4ef90c647018d
Reviewed-on: https://go-review.googlesource.com/c/go/+/353849
Auto-Submit: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2022-11-21 16:19:34 +00:00
fipsonly [dev.boringcrypto] all: add boringcrypto build tags 2022-04-29 14:23:22 +00:00
testdata crypto/ecdsa: use bigmod and nistec instead of math/big and crypto/elliptic 2022-11-21 16:19:34 +00:00
alert.go crypto/tls: add missing alert values 2020-04-01 19:32:57 +00:00
auth.go [dev.boringcrypto] all: merge commit 9d0819b27c (CL 314609) into dev.boringcrypto 2021-05-13 12:59:22 -04:00
auth_test.go [dev.boringcrypto] all: merge master into dev.boringcrypto 2020-04-08 17:48:41 -04:00
boring.go [dev.boringcrypto] crypto/x509: remove VerifyOptions.IsBoring 2022-04-29 14:23:29 +00:00
boring_test.go crypto/x509: allow BoringCrypto to use 4096-bit keys 2022-11-09 14:47:58 +00:00
cache.go crypto/tls: use certificate cache in client 2022-11-07 19:47:10 +00:00
cache_test.go crypto/tls: add a certificate cache implementation 2022-11-07 19:46:27 +00:00
cipher_suites.go all: fix problematic comments 2022-11-11 19:12:52 +00:00
common.go crypto/tls: add CertificateVerificationError to tls handshake 2022-11-18 18:50:57 +00:00
common_string.go crypto/tls: add {SignatureScheme,CurveID,ClientAuthType}.String() 2020-03-11 20:02:18 +00:00
conn.go crypto/tls: use certificate cache in client 2022-11-07 19:47:10 +00:00
conn_test.go crypto/tls: select only compatible chains from Certificates 2019-11-12 01:08:57 +00:00
example_test.go crypto/tls: replace VerifyPeerCertificate example with VerifyConnection 2020-06-24 20:48:12 +00:00
generate_cert.go crypto/tls: delete unnecessary line of return 2022-08-08 15:22:02 +00:00
handshake_client.go crypto/tls: add CertificateVerificationError to tls handshake 2022-11-18 18:50:57 +00:00
handshake_client_test.go all: consistently use US spelling of present participles 2022-04-08 13:44:41 +00:00
handshake_client_tls13.go crypto/ecdh: move ECDH method to PrivateKey 2022-11-16 14:37:29 +00:00
handshake_messages.go crypto/tls: reject duplicate extensions 2022-04-21 16:18:13 +00:00
handshake_messages_test.go [dev.boringcrypto] all: merge master into dev.boringcrypto 2022-04-27 20:09:28 +02:00
handshake_server.go crypto/tls: add CertificateVerificationError to tls handshake 2022-11-18 18:50:57 +00:00
handshake_server_test.go crypto/tls: support ECDHE when ec_point_formats is missing 2022-08-25 16:35:38 +00:00
handshake_server_tls13.go crypto/ecdh: move ECDH method to PrivateKey 2022-11-16 14:37:29 +00:00
handshake_test.go crypto/tls: set default minimum client version to TLS 1.2 2021-11-05 22:03:24 +00:00
handshake_unix_test.go all: use new "unix" build tag where appropriate 2022-03-29 16:24:51 +00:00
key_agreement.go crypto/ecdh: move ECDH method to PrivateKey 2022-11-16 14:37:29 +00:00
key_schedule.go crypto: fix a few function names on comments 2022-09-29 22:56:49 +00:00
key_schedule_test.go crypto/tls: implement TLS 1.3 cryptographic computations 2018-11-02 21:54:52 +00:00
link_test.go all: use ":" for compiler generated symbols 2022-08-09 11:28:56 +00:00
notboring.go [dev.boringcrypto] crypto/x509: remove VerifyOptions.IsBoring 2022-04-29 14:23:29 +00:00
prf.go crypto/tls: remove unused hashForClientCertificate param 2022-08-14 00:26:03 +00:00
prf_test.go crypto/tls: remove SSLv3 support 2019-08-27 22:24:05 +00:00
ticket.go crypto/tls: remove version check when unmarshaling sessionState 2020-05-18 23:09:31 +00:00
tls.go crypto/tls: add HandshakeContext method to Conn 2021-03-16 14:05:45 +00:00
tls_test.go crypto/tls: make cipher suite preference ordering automatic 2021-05-08 05:15:48 +00:00