PaddedBufferedBlockCipher

PaddedBufferedBlockCipher extends a block cipher or mode (CTR, CBC, ...) by the ability to process data that is not a multiple of the block size. The last block will be padded according to the chosen padding scheme. If the last block is full, then a additional padding block will be appended.

@safe
struct PaddedBufferedBlockCipher (
C
Padding
bool permitPartialBlock = false
) if (
isBlockCipher!C &&
isBlockCipherPadding!Padding
) {
enum blockSize;
enum name;
}

Members

Functions

doFinal
uint doFinal(ubyte[] output)

encrypt the remaining bytes in the buffer, add the padding

processByte
uint processByte(in ubyte b, ubyte[] output)

takes one byte and stores it in a buffer. If the buffer is already full it gets encrypted and written to output

processBytes
uint processBytes(in ubyte[] i, ubyte[] output)

input length not limited to multiples of block size. ensure that length of output buffer is sufficiently large (see below).

Meta