public class KXTSBlockCipher extends DefaultBufferedBlockCipher
buf, bufOff, cipher, forEncryption, mbCipher, partialBlockOkay, pgpCFB
Constructor and Description |
---|
KXTSBlockCipher(BlockCipher cipher) |
Modifier and Type | Method and Description |
---|---|
int |
doFinal(byte[] output,
int outOff)
Process the last block in the buffer.
|
int |
getOutputSize(int length)
return the size of the output buffer required for an update plus a
doFinal with an input of 'length' bytes.
|
protected static long |
getReductionPolynomial(int blockSize) |
int |
getUpdateOutputSize(int len)
return the size of the output buffer required for an update
an input of len bytes.
|
void |
init(boolean forEncryption,
CipherParameters parameters)
initialise the cipher.
|
int |
processByte(byte in,
byte[] out,
int outOff)
process a single byte, producing an output block if necessary.
|
int |
processBytes(byte[] input,
int inOff,
int len,
byte[] output,
int outOff)
process an array of bytes, producing output if necessary.
|
void |
reset()
Reset the buffer and cipher.
|
getBlockSize, getUnderlyingCipher
public KXTSBlockCipher(BlockCipher cipher)
protected static long getReductionPolynomial(int blockSize)
public int getOutputSize(int length)
DefaultBufferedBlockCipher
getOutputSize
in class DefaultBufferedBlockCipher
length
- the length of the input.public int getUpdateOutputSize(int len)
DefaultBufferedBlockCipher
getUpdateOutputSize
in class DefaultBufferedBlockCipher
len
- the length of the input.public void init(boolean forEncryption, CipherParameters parameters)
DefaultBufferedBlockCipher
init
in class DefaultBufferedBlockCipher
forEncryption
- if true the cipher is initialised for
encryption, if false for decryption.parameters
- the key and other data required by the cipher.public int processByte(byte in, byte[] out, int outOff)
DefaultBufferedBlockCipher
processByte
in class DefaultBufferedBlockCipher
in
- the input byte.out
- the space for any output that might be produced.outOff
- the offset from which the output will be copied.public int processBytes(byte[] input, int inOff, int len, byte[] output, int outOff)
DefaultBufferedBlockCipher
processBytes
in class DefaultBufferedBlockCipher
input
- the input byte array.inOff
- the offset at which the input data starts.len
- the number of bytes to be copied out of the input array.output
- the space for any output that might be produced.outOff
- the offset from which the output will be copied.public int doFinal(byte[] output, int outOff)
DefaultBufferedBlockCipher
doFinal
in class DefaultBufferedBlockCipher
output
- the array the block currently being held is copied into.outOff
- the offset at which the copying starts.public void reset()
DefaultBufferedBlockCipher
reset
in class DefaultBufferedBlockCipher