1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/zokrates_stdlib/stdlib/utils/pack/pack256.zok
2020-06-05 17:11:07 +02:00

10 lines
No EOL
178 B
Text

def main(bool[256] bits) -> (field):
field out = 0
for field j in 0..256 do
field i = 256 - (j + 1)
out = out + if bits[i] then (2 ** j) else 0 fi
endfor
return out