From 3b00a77de57ab2737a7887521c192ce004c721e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Sun, 5 Mar 2017 17:38:34 +0200 Subject: crypto, pow: add pure Go implementation of ethash --- crypto/sha3/hashes.go | 3 +++ crypto/sha3/keccakf_amd64.s | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'crypto/sha3') diff --git a/crypto/sha3/hashes.go b/crypto/sha3/hashes.go index 669cd5543..fa0d7b436 100644 --- a/crypto/sha3/hashes.go +++ b/crypto/sha3/hashes.go @@ -15,6 +15,9 @@ import ( // NewKeccak256 creates a new Keccak-256 hash. func NewKeccak256() hash.Hash { return &state{rate: 136, outputLen: 32, dsbyte: 0x01} } +// NewKeccak512 creates a new Keccak-512 hash. +func NewKeccak512() hash.Hash { return &state{rate: 72, outputLen: 64, 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. diff --git a/crypto/sha3/keccakf_amd64.s b/crypto/sha3/keccakf_amd64.s index a35335178..f88533acc 100644 --- a/crypto/sha3/keccakf_amd64.s +++ b/crypto/sha3/keccakf_amd64.s @@ -322,7 +322,6 @@ // func keccakF1600(state *[25]uint64) TEXT ·keccakF1600(SB), 0, $200-8 MOVQ state+0(FP), rpState - SUBQ $(8*25), SP // Convert the user state into an internal state NOTQ _be(rpState) @@ -388,5 +387,4 @@ TEXT ·keccakF1600(SB), 0, $200-8 NOTQ _mi(rpState) NOTQ _sa(rpState) - ADDQ $(8*25), SP RET -- cgit v1.2.3