12 lines
No EOL
325 B
Text
12 lines
No EOL
325 B
Text
#pragma curve bn128
|
|
|
|
import "./unpack_unchecked"
|
|
|
|
// Unpack a field element as 256 big-endian bits
|
|
// 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) -> bool[256]:
|
|
|
|
bool[254] b = unpack_unchecked::<254>(i)
|
|
|
|
return [false, false, ...b] |