1
0
Fork 0
mirror of synced 2025-09-23 04:08:33 +00:00
ZoKrates/zokrates_stdlib/stdlib/utils/pack/bool/nonStrictUnpack256.zok

12 lines
No EOL
325 B
Text

#pragma curve bn128
import "./unpack_unchecked"
// Unpack a field element as 256 big-endian bits
// Note: uniqueness of the output is not guaranteed
// For example, `0` can map to `[0, 0, ..., 0]` or to `bits(p)`
def main(field i) -> bool[256]:
bool[254] b = unpack_unchecked::<254>(i)
return [false, false, ...b]