1use thiserror::Error;
6
7#[derive(Debug, Clone, Error)]
9pub enum Error {
10 #[error("Key must be '{0}' bytes long")]
11 KeyIncorrectLength(usize),
12 #[error("IV must be 16 bytes long")]
13 IvIncorrectLength,
14 #[error("Buffer not multiple of block size")]
15 NonBlockSizeAlignedBuffer,
16 #[error("Output buffer is not big enough to hold the result of processing input")]
17 InsufficientBufferSize,
18 #[error("Buffer not large enough to accomodate padded buffer")]
19 PaddedBufferTooSmall,
20 #[error("Unable to unpad buffer: {0}")]
21 UnpadError(String),
22}