For the CCM mode of AES the ciphertext is slightly larger than the plaintext. This is because of the built in Message Authentication Code (MAC).
At what point in the write pipeline do I need take this into account ? Encryption happens after Compression but in the case there there is no Compression (either because it is off or the compress state didn't result in smaller datasize) the PSIZE will be larger than the LSIZE (the opposite of compression). I know the additional amount of space I need at the start of the zio_write_encrypt() stage (it is actually a hardcoded amount rather than a function of the input size). Do I need to somehow reallocate the block ? -- Darren J Moffat