const view of the unpadded data. It may be a slice of
input (when the input is already const-backed) or a fresh copy — callers must not rely on either, and must not mutate the result.
const(ubyte)[] unpad(const(ubyte)[] input, size_t blockSize)Removes padding from the input.
input | The padded data (must be a multiple of blockSize). |
blockSize | The block size in bytes. |
const view of the unpadded data. It may be a slice of
input (when the input is already const-backed) or a fresh copy — callers must not rely on either, and must not mutate the result.
Security note: distinguishable error paths (invalid padding vs. other failures) are the classic padding-oracle attack vector under CBC. Implementations SHOULD perform the unpadding decision in constant time and return a single uniform CryptoException for every rejection; callers handling unauthenticated ciphertext must treat every failure identically.