iden3 / go-iden3-crypto

Go implementation of some cryptographic primitives (that fit inside the SNARK field) and compatible with circomlib
Apache License 2.0
117 stars 38 forks source link

Update Poseidon Hash function names, rm HashBytes #25

Closed arnaucube closed 4 years ago

arnaucube commented 4 years ago

Since Poseidon Hash is used because of compatibility in zkSNARK circuits, due circuit constraints number, the hash method of [T]*big.Int is the one directly compatible with the circuits, is the method which have the Hash name on it. The method that can take arbitrary length of []*big.Int putting them in chunks of [T]*big.Int and iterating, is called HashSlice. The HashBytes has been removed, as is a method that will not be used in zkSNARK circuits due high constraints number.

For zkSNARK circuits, should be used poseidon.Hash([poseidon.T]*big.Int).