Skip to main content

select_message

Function select_message 

Source
pub(crate) fn select_message(
    em: &mut [u8],
    am: &[u8],
    al: u16,
    l: u32,
    check: Choice,
) -> u32
Expand description

Step 5: select the last AL octets of AM if check is set, otherwise the last L of EM.

Select the entire encoded buffer in place before exposing the final length. Both EM and AM are read at every offset, independently of check, AL, and L. The caller may then expose the returned length and copy that suffix of EM.

The buffers must have the same public length k; AL and L must be at most k.