From d74c31f0ba8b7940350f93df044a5cb7002e02d0 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Thu, 29 Dec 2022 15:52:37 +0100 Subject: [PATCH] doc/go1.20: update cryptography release notes Change-Id: I5d6d2bd5cbb246ea514e5adbe936fb31b92904af Reviewed-on: https://go-review.googlesource.com/c/go/+/459978 Run-TryBot: Filippo Valsorda Reviewed-by: Roland Shoemaker Reviewed-by: Cherry Mui TryBot-Result: Gopher Robot Auto-Submit: Filippo Valsorda --- doc/go1.20.html | 71 ++++++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/doc/go1.20.html b/doc/go1.20.html index 6c007fe1ffc..324d59ed6e2 100644 --- a/doc/go1.20.html +++ b/doc/go1.20.html @@ -389,13 +389,13 @@ Do not send CLs removing the interior tags from such phrases.

Go 1.20 adds a new crypto/ecdh package - to provide direct support for Elliptic Curve Diffie-Hellman key exchange + to provide explicit support for Elliptic Curve Diffie-Hellman key exchanges over NIST curves and Curve25519.

- Programs should prefer to use crypto/ecdh - or crypto/ecdsa - instead of the lower-level functionality in crypto/elliptic. + Programs should use crypto/ecdh instead of the lower-level functionality in + crypto/elliptic for ECDH, and + third-party modules for more advanced use cases.

Wrapping multiple errors

@@ -583,6 +583,11 @@ proxyHandler := &httputil.ReverseProxy{
crypto/ecdsa
+

+ When using supported curves, all operations are now implemented in constant time. + This led to an increase in CPU time between 5% and 30%, mostly affecting P-384 and P-521. +

+

The new PrivateKey.ECDH method converts an ecdsa.PrivateKey to an ecdh.PrivateKey. @@ -609,25 +614,21 @@ proxyHandler := &httputil.ReverseProxy{

-
crypto/elliptic
-
-

- Use of custom Curve implementations - not provided by this package (that is, curves other than - P224, - P256, - P384, and - P521) - is deprecated. -

-
-
-
crypto/rsa

The new field OAEPOptions.MGFHash - allows configuring the MGF1 hash separately for OAEP encryption. + allows configuring the MGF1 hash separately for OAEP decryption. +

+ +

+ crypto/rsa now uses a new, safer, constant-time backend. This causes a CPU + runtime increase for decryption operations between approximately 15% + (RSA-2048 on amd64) and 45% (RSA-4096 on arm64), and more on 32-bit architectures. + Encryption operations are approximately 20x slower than before (but still 5-10x faster than decryption). + Performance is expected to improve in future releases. + Programs must not modify or manually generate the fields of + PrecomputedValues.

@@ -643,9 +644,9 @@ proxyHandler := &httputil.ReverseProxy{
crypto/tls
-

- The TLS client now shares parsed certificates across all clients actively using that certificate. - The savings can be significant in programs that make many concurrent connections to a +

+ Parsed certificates are now shared across all clients actively using that certificate. + The memory savings can be significant in programs that make many concurrent connections to a server or collection of servers sharing any part of their certificate chains.

@@ -660,22 +661,22 @@ proxyHandler := &httputil.ReverseProxy{
crypto/x509
-

- CreateCertificateRequest +

+ ParsePKCS8PrivateKey and MarshalPKCS8PrivateKey now support keys of type *crypto/ecdh.PrivateKey. - CreateCertificate + ParsePKIXPublicKey and MarshalPKIXPublicKey now support keys of type *crypto/ecdh.PublicKey. - X.509 unmarshaling continues to unmarshal elliptic curve keys into + Parsing NIST curve keys still returns values of type *ecdsa.PublicKey and *ecdsa.PrivateKey. - Use their new ECDH methods to convert to the crypto/ecdh form. + Use their new ECDH methods to convert to the crypto/ecdh types.

The new SetFallbackRoots - function allows a program to define a set of fallback root certificates in case the + function allows a program to define a set of fallback root certificates in case an operating system verifier or standard platform root bundle is unavailable at runtime. It will most commonly be used with a new package, golang.org/x/crypto/x509roots/fallback, which will provide an up to date root bundle. @@ -832,6 +833,20 @@ proxyHandler := &httputil.ReverseProxy{

+
math/big
+
+

+ The math/big package's wide scope and + input-dependent timing make it ill-suited for implementing cryptography. + The cryptography packages in the standard library no longer call non-trivial + Int methods on attacker-controlled inputs. + In the future, the determination of whether a bug in math/big is + considered a security vulnerability will depend on its wider impact on the + standard library. +

+
+
+
math/rand