aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRicardo Catalinas Jiménez <r@untroubled.be>2016-02-22 06:09:59 +0800
committerRicardo Catalinas Jiménez <r@untroubled.be>2016-02-22 06:34:34 +0800
commitc20d6e5e4ed8eff6d26cd849f90ca42dd5a7040c (patch)
tree3f40595c4fa7ee66563c611f6966c3b93b14a637 /crypto
parent5387ad760fa48bc4a060e7fbcbb3c6760cdacac3 (diff)
downloaddexon-c20d6e5e4ed8eff6d26cd849f90ca42dd5a7040c.tar
dexon-c20d6e5e4ed8eff6d26cd849f90ca42dd5a7040c.tar.gz
dexon-c20d6e5e4ed8eff6d26cd849f90ca42dd5a7040c.tar.bz2
dexon-c20d6e5e4ed8eff6d26cd849f90ca42dd5a7040c.tar.lz
dexon-c20d6e5e4ed8eff6d26cd849f90ca42dd5a7040c.tar.xz
dexon-c20d6e5e4ed8eff6d26cd849f90ca42dd5a7040c.tar.zst
dexon-c20d6e5e4ed8eff6d26cd849f90ca42dd5a7040c.zip
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.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/sha3/hashes.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/sha3/hashes.go b/crypto/sha3/hashes.go
index 2b51cf4e9..669cd5543 100644
--- a/crypto/sha3/hashes.go
+++ b/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.