mirror of
https://github.com/arnaucube/go-iden3-crypto.git
synced 2026-02-07 11:36:41 +01:00
Poseidon Sponge Hash with different frame sizes (#52)
* Poseidon Sponge Hash with different frame sizes * Update deps. Bump go version * Update & fix linter. * Refactor a bit. * Reduce gc pressure
This commit is contained in:
committed by
GitHub
parent
edc36bfa52
commit
e5cf066b8b
21
keccak256/keccac256_test.go
Normal file
21
keccak256/keccac256_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package keccak256
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"math/big"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestKeccak256(t *testing.T) {
|
||||
const SEED = "mimc"
|
||||
res := Hash([]byte(SEED))
|
||||
assert.Equal(t,
|
||||
"b6e489e6b37224a50bebfddbe7d89fa8fdcaa84304a70bd13f79b5d9f7951e9e",
|
||||
hex.EncodeToString(res))
|
||||
c := new(big.Int).SetBytes(Hash([]byte(SEED)))
|
||||
assert.Equal(t,
|
||||
"82724731331859054037315113496710413141112897654334566532528783843265082629790",
|
||||
c.String())
|
||||
}
|
||||
Reference in New Issue
Block a user