Trait for padding messages divided into blocks
block filled with data up to
pos should be inside of the block and block must not be full, i.e.
pos < block.len() must be true. Otherwise method will return
PadError. Some potentially irreversible padding schemes can allow
padding of the full block, in this case aforementioned condition is
pos <= block.len().
fn unpad(data: &[u8]) -> Result<&[u8], UnpadError>
data by truncating it according to the used padding.
In case of the malformed padding will return
Pads message with length
pos in the provided buffer.
&buf[..pos] is perceived as the message, the buffer must contain
enough leftover space for padding:
block_size - (pos % block_size)
extra bytes must be available. Otherwise method will return