Ver Fonte

crypto/sha3: Export Keccak-256 hash function

This hash function is slightly different from the standarized NIST SHA-3
as both of them use different domain separation bits.
Ricardo Catalinas Jiménez há 9 anos atrás
pai
commit
c20d6e5e4e
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      crypto/sha3/hashes.go

+ 3 - 0
crypto/sha3/hashes.go

@@ -12,6 +12,9 @@ import (
 	"hash"
 )
 
+// NewKeccak256 creates a new Keccak-256 hash.
+func NewKeccak256() hash.Hash { return &state{rate: 136, outputLen: 32, dsbyte: 0x01} }
+
 // New224 creates a new SHA3-224 hash.
 // Its generic security strength is 224 bits against preimage attacks,
 // and 112 bits against collision attacks.