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:
Oleksandr Brezhniev
2023-03-08 13:18:55 -05:00
committed by GitHub
parent edc36bfa52
commit e5cf066b8b
19 changed files with 355 additions and 165 deletions

View 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())
}