Minimal Anti Collusion Infrastructure (MACI) v2.0.0-alpha / genRandomBabyJubValue
Function: genRandomBabyJubValue()
genRandomBabyJubValue():
bigint
Returns a BabyJub-compatible random value. We create it by first generating a random value (initially 256 bits large) modulo the snark field size as described in EIP197. This results in a key size of roughly 253 bits and no more than 254 bits. To prevent modulo bias, we then use this efficient algorithm: http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/crypt/arc4random_uniform.c
Returns
bigint
Defined in
crypto/ts/babyjub.ts:115