mirror of
https://github.com/arnaucube/go-iden3-crypto.git
synced 2026-02-08 12:06:51 +01:00
Better keccac256 (#41)
* Switch to keccac256 implementation from golang.org/x/crypto instead of go-ethereum
This commit is contained in:
committed by
GitHub
parent
9c2ca9ca7c
commit
64e757cc4a
@@ -5,16 +5,16 @@ import (
|
||||
"math/big"
|
||||
"testing"
|
||||
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/iden3/go-iden3-crypto/keccak256"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestKeccak256(t *testing.T) {
|
||||
res := crypto.Keccak256([]byte(SEED))
|
||||
res := keccak256.Hash([]byte(SEED))
|
||||
assert.Equal(t,
|
||||
"b6e489e6b37224a50bebfddbe7d89fa8fdcaa84304a70bd13f79b5d9f7951e9e",
|
||||
hex.EncodeToString(res))
|
||||
c := new(big.Int).SetBytes(crypto.Keccak256([]byte(SEED)))
|
||||
c := new(big.Int).SetBytes(keccak256.Hash([]byte(SEED)))
|
||||
assert.Equal(t,
|
||||
"82724731331859054037315113496710413141112897654334566532528783843265082629790",
|
||||
c.String())
|
||||
|
||||
Reference in New Issue
Block a user