solutions/zokrates_prover/.zokrates/stdlib/utils/casts/field_to_u32.zok

8 lines
250 B
Plaintext
Raw Permalink Normal View History

2023-12-05 06:06:28 +00:00
from "field" import FIELD_SIZE_IN_BITS;
import "utils/pack/bool/unpack";
import "utils/casts/u32_from_bits";
def main(field input) -> u32 {
bool[FIELD_SIZE_IN_BITS] bits = unpack(input);
return u32_from_bits(bits[FIELD_SIZE_IN_BITS-32..]);
}