aztec-nr - noir_aztec::utils::conversion::fields_as_bytes

Function try_decode_fields_from_bytes

pub fn try_decode_fields_from_bytes<let N: u32>(
    bytes: BoundedVec<u8, N>,
) -> Option<BoundedVec<Field, N / 32>>

Decodes bytes back into fields, returning None on failure.

Inverse of encode_fields_as_bytes. Returns Option::none() if the input length is not a multiple of 32, or if any 32-byte chunk is >= the BN254 field modulus.