]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: use hash.Cloner
authorqmuntal <quimmuntal@gmail.com>
Fri, 20 Jun 2025 12:28:56 +0000 (14:28 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Fri, 29 Aug 2025 13:13:57 +0000 (06:13 -0700)
commit53515fb0a9e267d6040c1d8785fe51b1367e8d4d
treed1cfb0458f242bf52f089fedb930cf8729fc23ce
parent13bb48e6fbc35419a28747688426eb3684242fbc
crypto/tls: use hash.Cloner

A hash object needs to be cloned when doing certain steps in a
TLS 1.3 server handshake. It is more efficient to use the
hash.Cloner interface to clone a hash than to encode and decode
the hash object using the binary encoding interfaces.

We still need to support the binary encoding path in case the
hash objects come from the fips140 v1.0.0 module, given that
this module doesn't support the hash.Cloner interface.

Change-Id: I8425e14e481dcefafc9aa1e5bfd63b61c22675ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/682597
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/crypto/tls/handshake_server_tls13.go