1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

Fix compilation of reveal_bit example

This commit is contained in:
Alex Beregszaszi 2021-05-20 15:25:19 +01:00
parent 33c2dbe68a
commit 0017179c69

View file

@ -7,13 +7,12 @@ import "utils/casts/u32_to_bits" as u32_to_bits
// WARNING, once enough bits have been revealed it is possible to brute force
// the remaining preimage bits.
def main(private u32[16] preimage, field bitNum) -> (u32[8], bool):
def main(private u32[16] preimage, u32 bitNum) -> (u32[8], bool):
// Convert the preimage to bits
bool[512] preimageBits = [false; 512]
for field i in 0..16 do
for u32 i in 0..16 do
bool[32] val = u32_to_bits(preimage[i])
for field bit in 0..32 do
for u32 bit in 0..32 do
preimageBits[i*32+bit] = val[bit]
endfor
endfor