Closed fengyin450 closed 1 year ago
Hi:
h := mimc.NewMiMC()
var message fr.Element
message.SetString("0xdeadf00d")
h.Write(message.Marshal())
res := h.Sum(nil)
var result fr.Element
result.SetBytes(res)
fmt.Println(result.String())
In the example of https://play.gnark.io/#, it can be seen that the hash result of "Secret": "0xdeadf00d" is "Hash": "1037254799353855871006189384309576393135431139055333626960622147300727 796413", how to call https://github.com/Consensys/gnark-crypto/blob/master/ecc/bn254/fr/mimc/mimc.go can input Secret to get Hash by implementing mimc function? I tried many methods, but the output is 0 or wrong result. The following is one of them: