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

11 lines
353 B
Plaintext
Raw Normal View History

2023-12-05 06:06:28 +00:00
#pragma curve bn128
import "../bool/nonStrictUnpack256" as unpack;
import "../../casts/bool_256_to_u32_8" as from_bits;
// Unpack a field element as a u32[8] (big-endian)
// 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) -> u32[8] {
return from_bits(unpack(i));
}