diff --git a/crypto/keccak/keccak_state.go b/crypto/keccak/keccak_state.go new file mode 100644 index 0000000000..c83709cec7 --- /dev/null +++ b/crypto/keccak/keccak_state.go @@ -0,0 +1,12 @@ +package keccak + +// KeccakState wraps sha3.state. In addition to the usual hash methods, it also supports +// Read to get a variable amount of data from the hash state. Read is faster than Sum +// because it doesn't copy the internal state, but also modifies the internal state. +type KeccakState struct { + state +} + +func NewLegacyKeccak256State() *KeccakState { + return &KeccakState{state{rate: rateK512, outputLen: 32, dsbyte: dsbyteKeccak}} +}