1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00
ZoKrates/zokrates_stdlib/stdlib/utils/pack/bool/nonStrictUnpack256.zok
2021-09-23 14:45:45 +03:00

12 lines
No EOL
318 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(i)
return [false, false, ...b]