decode_padding

Function decode_padding 

Source
pub(crate) fn decode_padding(
    input: &[u8],
) -> Result<(usize, i16), InvalidEncodingError>
Expand description

Validate padding is of the expected length compute unpadded length.

Note that this method does not explicitly check that the padded data is valid in and of itself: that is performed by validate_last_block as a final step.

Returns length-related errors eagerly as a Result, and data-dependent errors (i.e. malformed padding bytes) as i16 to be combined with other encoding-related errors prior to branching.