Note
in the case where the underlying cipher is either a CFB cipher or an OFB one the last block may not be a multiple of the block size.
| Modifier and Type | Field and Description |
|---|---|
| protected byte[] | |
| protected int | |
| protected BlockCipher | |
| protected boolean | |
| protected MultiBlockCipher | |
| protected boolean | |
| protected boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| public | BufferedBlockCipher(BlockCipher
the underlying block cipher this buffering object wraps. cipher)
Deprecated
use the constructor on DefaultBufferedBlockCipher.
Create a buffered block cipher without padding. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the number of output bytes copied to out.the array the block currently being held is copied into. out, int the offset at which the copying starts. outOff)Process the last block in the buffer. |
| public int | Returns: the blocksize for the underlying cipher.return the blocksize for the underlying cipher. |
| public int | Returns: the space required to accommodate a call to update and doFinal with 'length' bytes of input.the length of the input. length)return the size of the output buffer required for an update plus a doFinal with an input of 'length' bytes. |
| public BlockCipher | |
| public int | Returns: the space required to accommodate a call to update with len bytes of input.the length of the input. len)return the size of the output buffer required for an update an input of len bytes. |
| public void | init(boolean
if true the cipher is initialised for
encryption, if false for decryption. forEncryption, CipherParameters the key and other data required by the cipher. params)initialise the cipher. |
| public int | Returns: the number of output bytes copied to out.the input byte. in, byte[] the space for any output that might be produced. out, int the offset from which the output will be copied. outOff)process a single byte, producing an output block if necessary. |
| public int | Returns: the number of output bytes copied to out.the input byte array. in, int the offset at which the input data starts. inOff, int the number of bytes to be copied out of the input array. len, byte[] the space for any output that might be produced. out, int the offset from which the output will be copied. outOff)process an array of bytes, producing output if necessary. |
| public void |
| buf | back to summary |
|---|---|
| protected byte[] buf | |
| bufOff | back to summary |
|---|---|
| protected int bufOff | |
| cipher | back to summary |
|---|---|
| protected BlockCipher cipher | |
| forEncryption | back to summary |
|---|---|
| protected boolean forEncryption | |
| mbCipher | back to summary |
|---|---|
| protected MultiBlockCipher mbCipher | |
| partialBlockOkay | back to summary |
|---|---|
| protected boolean partialBlockOkay | |
| pgpCFB | back to summary |
|---|---|
| protected boolean pgpCFB | |
| BufferedBlockCipher | back to summary |
|---|---|
| pack-priv BufferedBlockCipher() constructor for subclasses | |
| BufferedBlockCipher | back to summary |
|---|---|
| public BufferedBlockCipher(BlockCipher cipher)
Deprecated use the constructor on DefaultBufferedBlockCipher. Create a buffered block cipher without padding.
| |
| doFinal | back to summary |
|---|---|
| public int doFinal(byte[] out, int outOff) throws DataLengthException, IllegalStateException, InvalidCipherTextException Process the last block in the buffer.
| |
| getBlockSize | back to summary |
|---|---|
| public int getBlockSize() return the blocksize for the underlying cipher.
| |
| getOutputSize | back to summary |
|---|---|
| public int getOutputSize(int length) return the size of the output buffer required for an update plus a doFinal with an input of 'length' bytes.
| |
| getUnderlyingCipher | back to summary |
|---|---|
| public BlockCipher getUnderlyingCipher() return the cipher this object wraps.
| |
| getUpdateOutputSize | back to summary |
|---|---|
| public int getUpdateOutputSize(int len) return the size of the output buffer required for an update an input of len bytes.
| |
| init | back to summary |
|---|---|
| public void init(boolean forEncryption, CipherParameters params) throws IllegalArgumentException initialise the cipher.
| |
| processByte | back to summary |
|---|---|
| public int processByte(byte in, byte[] out, int outOff) throws DataLengthException, IllegalStateException process a single byte, producing an output block if necessary.
| |
| processBytes | back to summary |
|---|---|
| public int processBytes(byte[] in, int inOff, int len, byte[] out, int outOff) throws DataLengthException, IllegalStateException process an array of bytes, producing output if necessary.
| |
| reset | back to summary |
|---|---|
| public void reset() Reset the buffer and cipher. After resetting the object is in the same state as it was after the last init (if there was one). | |