solutions/zokrates_prover/.zokrates/stdlib/utils/pack/bool/nonStrictUnpack256.zok

11 lines
322 B
Plaintext
Raw Normal View History

2023-12-05 06:06:28 +00:00
#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];
}