1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00
ZoKrates/zokrates_stdlib/stdlib/utils/pack/bool/unpack128.zok
2020-08-04 20:49:32 +02:00

13 lines
No EOL
289 B
Text

#pragma curve bn128
import "EMBED/unpack" as unpack
// Unpack a field element as 128 big-endian bits
// Precondition: the input is smaller or equal to `2**128 - 1`
def main(field i) -> bool[128]:
bool[254] b = unpack(i)
assert(b[0..126] == [false; 126])
return b[126..254]