]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.boringcrypto] crypto/internal/boring: allow hmac operations after Sum
authorRuss Cox <rsc@golang.org>
Thu, 7 Sep 2017 16:14:31 +0000 (12:14 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 18 Sep 2017 00:15:39 +0000 (00:15 +0000)
commit8fa8f42cb37648a3c0754552c7397aeb3f36d921
tree17552c2746ab7818d4328c5544f52b1094bd9d02
parent07f6ce9d391df3b173772d4b12eff2d5c98bdd9c
[dev.boringcrypto] crypto/internal/boring: allow hmac operations after Sum

hmac.New returns a hash.Hash, which defines Sum as:

// Sum appends the current hash to b and returns the resulting slice.
// It does not change the underlying hash state.
Sum(b []byte) []byte

I've now seen two different pieces of code that make
use of the assumption that Sum has no effect on the
internal state, so make it so.

Test in next CL in stack, so that it can be cherry-picked
to master.

Change-Id: Iad84ab3e2cc12dbecef25c3fc8f2662d157b0d0b
Reviewed-on: https://go-review.googlesource.com/63910
Reviewed-by: Adam Langley <agl@golang.org>
src/crypto/internal/boring/goboringcrypto.h
src/crypto/internal/boring/goboringcrypto_linux_amd64.syso
src/crypto/internal/boring/hmac.go