Function unpad_bytes

Source
pub(crate) fn unpad_bytes(padded_bytes: &[u8]) -> Result<&[u8], CryptoError>
Expand description

Unpads bytes that is padded using the PKCS7-like padding defined by pad_bytes. The last N bytes of the padded bytes all have the value N. Minimum of 1 padding byte. For example, padded to size 4, the value 0,0 becomes 0,0,2,2.