1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00
ZoKrates/zokrates_stdlib/stdlib/utils/pack/bool/pack256.zok
2022-04-07 16:04:40 +02:00

10 lines
312 B
Text

#pragma curve bn128
import "./pack" as pack;
// pack 256 big-endian bits into one field element
// Note: This is not a injective operation as `p` is smaller than `2**256 - 1` for bn128
// For example, `[0, 0,..., 0]` and `bits(p)` both point to `0`
def main(bool[256] bits) -> field {
return pack(bits);
}