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

10 lines
289 B
Plaintext
Raw Permalink Normal View History

2023-12-05 06:06:28 +00:00
#pragma curve bn128
import "../bool/unpack128" as unpack;
import "../../casts/bool_128_to_u32_4" as from_bits;
// Unpack a field element as 128 big-endian bits
// Precondition: the input is smaller or equal to `2**128 - 1`
def main(field i) -> u32[4] {
return from_bits(unpack(i));
}