1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00
ZoKrates/zokrates_stdlib/stdlib/utils/pack/bool/nonStrictUnpack256.zok
2022-04-07 16:04:40 +02:00

11 lines
No EOL
322 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];
}