aztec-nr - noir_aztec::messages::encoding

Function decode_message

pub unconstrained fn decode_message(
    message: BoundedVec<Field, 14>,
) -> (u64, u64, BoundedVec<Field, 13>)

Decodes a standard aztec-nr message, i.e. one created via encode_message, returning the original encoded values.

Note that encode_message returns a fixed size array while this function takes a BoundedVec: this is because prior to decoding the message type is unknown, and consequentially not known at compile time. If working with fixed-size messages, consider using BoundedVec::from_array to convert them.