NullEnginepublic class NullEngine extends Object implements org.bouncycastle.crypto.BlockCipherThe no-op engine that just copies bytes through, irrespective of whether encrypting and decrypting.
Provided for the sake of completeness. |
Fields Summary |
---|
protected static final int | BLOCK_SIZE |
Constructors Summary |
---|
public NullEngine()Standard constructor.
super();
|
Methods Summary |
---|
public java.lang.String | getAlgorithmName()
return "Null";
| public int | getBlockSize()
return BLOCK_SIZE;
| public void | init(boolean forEncryption, org.bouncycastle.crypto.CipherParameters params)
// we don't mind any parameters that may come in
| public int | processBlock(byte[] in, int inOff, byte[] out, int outOff)
if ((inOff + BLOCK_SIZE) > in.length)
{
throw new DataLengthException("input buffer too short");
}
if ((outOff + BLOCK_SIZE) > out.length)
{
throw new DataLengthException("output buffer too short");
}
for (int i = 0; i < BLOCK_SIZE; ++i)
{
out[outOff + i] = in[inOff + i];
}
return BLOCK_SIZE;
| public void | reset()
// nothing needs to be done
|
|