Skip to main content

pkcs7_unpad

Function pkcs7_unpad 

Source
pub fn pkcs7_unpad(buf: &[u8]) -> Result<usize>
Expand description

Strip PKCS#7 padding in constant time, returning the plaintext length.

The check is branch-free over the padding contents, so a padding-oracle attacker learns nothing beyond pass/fail — and callers of the AEAD APIs never reach this path at all.