You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
470 B

  1. package keccak256
  2. import (
  3. "encoding/hex"
  4. "math/big"
  5. "testing"
  6. "github.com/stretchr/testify/assert"
  7. )
  8. func TestKeccak256(t *testing.T) {
  9. const SEED = "mimc"
  10. res := Hash([]byte(SEED))
  11. assert.Equal(t,
  12. "b6e489e6b37224a50bebfddbe7d89fa8fdcaa84304a70bd13f79b5d9f7951e9e",
  13. hex.EncodeToString(res))
  14. c := new(big.Int).SetBytes(Hash([]byte(SEED)))
  15. assert.Equal(t,
  16. "82724731331859054037315113496710413141112897654334566532528783843265082629790",
  17. c.String())
  18. }