Documentation
¶
Index ¶
- Constants
- func PoseidonHash(inputs ...*big.Int) (*big.Int, error)
- func PoseidonMultiHash(inputs []*big.Int) (*big.Int, error)
- func StateRoot(processID, censusOrigin, pubKeyX, pubKeyY, ballotMode *big.Int) (*big.Int, error)
- func TruncateToLowerBits(input *big.Int, bits uint) *big.Int
- func VoteID(processID, address, k *big.Int) (*big.Int, error)
Constants ¶
View Source
const (
LeafResultsHex = "1f72c52b6e5dedca4f99ecfa24f2776732431e8d544e14c6f78f5042727c4657"
)
Results leaf is a constant derived from ZERO_BALLOT_HASH:
leafResults = H_3(KEY_RESULTS, ZERO_BALLOT_HASH, LEAF_DOMAIN)
View Source
const ZeroBallotHashHex = "2c66ee3d8ff0f86c2251e885d4c207e5162c05d0b458c773106cd5579c58bf36"
ZeroBallotHashHex (a.k.a ZERO_BALLOT_HASH) is the Poseidon hash of 8 fields where each field is the 4-tuple (0, 1, 0, 1) (babyjubjub identity points):
zeroBallotValues = [ 0,1,0,1, 0,1,0,1, 0,1,0,1, 0,1,0,1, 0,1,0,1, 0,1,0,1, 0,1,0,1, 0,1,0,1 ]
Variables ¶
This section is empty.
Functions ¶
func PoseidonHash ¶
PoseidonHash hashes the provided inputs with iden3 Poseidon.
func PoseidonMultiHash ¶
PoseidonMultiHash matches the multiposeidon logic used in circuits (16-wide chunks).
func TruncateToLowerBits ¶
TruncateToLowerBits returns a big.Int truncated to the least-significant `bits`.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.