]> Cypherpunks repositories - gostls13.git/commit
crypto, hash: implement BinaryMarshaler, BinaryUnmarshaler in hash implementations
authorTim Cooper <tim.cooper@layeh.com>
Wed, 27 Sep 2017 22:46:58 +0000 (19:46 -0300)
committerIan Lance Taylor <iant@golang.org>
Wed, 1 Nov 2017 21:04:12 +0000 (21:04 +0000)
commit731b6321728eb53e6087dc877344878b06cc4b06
tree05193f7e0aafe3624b42a6dbbc901f8c7178334a
parent14bc4f5e5fd5a113c97bdf1455b4f7d36a81f54b
crypto, hash: implement BinaryMarshaler, BinaryUnmarshaler in hash implementations

The marshal method allows the hash's internal state to be serialized and
unmarshaled at a later time, without having the re-write the entire stream
of data that was already written to the hash.

Fixes #20573

Change-Id: I40bbb84702ac4b7c5662f99bf943cdf4081203e5
Reviewed-on: https://go-review.googlesource.com/66710
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
18 files changed:
src/cmd/dist/deps.go
src/crypto/md5/md5.go
src/crypto/md5/md5_test.go
src/crypto/sha1/sha1.go
src/crypto/sha1/sha1_test.go
src/crypto/sha256/sha256.go
src/crypto/sha256/sha256_test.go
src/crypto/sha512/sha512.go
src/crypto/sha512/sha512_test.go
src/hash/adler32/adler32.go
src/hash/adler32/adler32_test.go
src/hash/crc32/crc32.go
src/hash/crc32/crc32_test.go
src/hash/crc64/crc64.go
src/hash/crc64/crc64_test.go
src/hash/fnv/fnv.go
src/hash/fnv/fnv_test.go
src/hash/hash.go