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

8 lines
250 B
Plaintext

from "field" import FIELD_SIZE_IN_BITS;
import "utils/pack/bool/unpack";
import "utils/casts/u64_from_bits";
def main(field input) -> u64 {
bool[FIELD_SIZE_IN_BITS] bits = unpack(input);
return u64_from_bits(bits[FIELD_SIZE_IN_BITS-64..]);
}