]> Cypherpunks.ru repositories - gostls13.git/commit
crypto/sha256: add WriteString and WriteByte method
authorIan Lance Taylor <iant@golang.org>
Mon, 3 Apr 2023 04:21:24 +0000 (21:21 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 25 Apr 2023 22:05:33 +0000 (22:05 +0000)
commitbb079efbdcc738a236b30f295ccb286df58e2bc3
tree7cbefc3b2e9f8d315327923d3b135482bfbc16d9
parentce0b9143123abe8005a059c92dbd763f7ab46214
crypto/sha256: add WriteString and WriteByte method

This can reduce allocations when hashing a string or byte
rather than []byte.

For #38776

Change-Id: I1c6dd1bc018220784a05939e92b47558c0562110
Reviewed-on: https://go-review.googlesource.com/c/go/+/481478
Reviewed-by: Joel Sing <joel@sing.id.au>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
13 files changed:
src/crypto/internal/boring/sha.go
src/crypto/sha256/sha256.go
src/crypto/sha256/sha256_test.go
src/crypto/sha256/sha256block.go
src/crypto/sha256/sha256block_386.s
src/crypto/sha256/sha256block_amd64.s
src/crypto/sha256/sha256block_arm64.go
src/crypto/sha256/sha256block_arm64.s
src/crypto/sha256/sha256block_decl.go
src/crypto/sha256/sha256block_generic.go
src/crypto/sha256/sha256block_ppc64x.s
src/crypto/sha256/sha256block_s390x.go
src/crypto/sha256/sha256block_s390x.s