pub enum Error {
InvalidKeyLen,
InvalidIvLen,
InvalidPaddingForMode,
OutputBufferTooSmall {
needed: usize,
},
NotInitialized,
AlreadyFinalized,
UnpaddedInput,
BadPadding,
}Expand description
Errors returned by Cipher.
Variants§
InvalidKeyLen
The supplied key length does not match the algorithm.
InvalidIvLen
The supplied IV length does not match the mode’s block size.
InvalidPaddingForMode
Padding::None is required for stream-shaped modes (CTR), and
padded modes are required for block-shaped modes (ECB, CBC) if
the caller wants to feed unaligned data.
OutputBufferTooSmall
Caller-provided output buffer is too small for the bytes that
the call would have produced. The needed field reports the
total number of bytes the call would have written.
NotInitialized
update / finalize was called before Cipher::init.
AlreadyFinalized
update / init was called after Cipher::finalize without
re-initializing.
UnpaddedInput
Encrypting or decrypting with Padding::None but the total
input was not a multiple of the block size.
BadPadding
Decrypted padding bytes do not match the declared padding scheme.