fromzkpyc.typesimportArray,field# zk_ignore
fromzkpyc.stdlib.EMBEDimportunpack# Unpack a field element as 254 big endian bits without checking for overflows
# This does *not* guarantee a single output: for example, 0 can be decomposed as 0 or as P and this function does not enforce either
defunpack_unchecked(i:field)->Array[bool, 254]:res:Array[bool, 254]=unpack(i,254)returnres