Format of padding
Modulecrypton-2.1.7Haskell2010
Crypto.Data.Padding
Various cryptographic padding commonly used for block ciphers or asymmetric systems.
- 1 type
- 2 values
- Packagecrypton-2.1.7
- Exports3
- LanguageHaskell2010
- LicenceBSD-3-Clause AND MIT AND ISC
- SourcePadding.hs
Try to remove some padding from a bytearray.
PKCS7 padding says how long it is, so this undoes pad exactly.
ZERO padding says nothing, and pad adds none at all when the input is already a multiple of the block size, so there is no way to tell padding from data that happens to end in zero octets. This therefore does not undo pad: it returns the input unchanged when the last octet is not zero, and Nothing when it is, rather than guess and hand back less than it was given. Zero padding is only usable where the original length is known by other means.