public abstract class FPEEngine
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected BlockCipher |
baseCipher |
protected boolean |
forEncryption |
protected FPEParameters |
fpeParameters |
| Modifier | Constructor and Description |
|---|---|
protected |
FPEEngine(BlockCipher baseCipher) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
decryptBlock(byte[] inBuf,
int inOff,
int length,
byte[] outBuf,
int outOff) |
protected abstract int |
encryptBlock(byte[] inBuf,
int inOff,
int length,
byte[] outBuf,
int outOff) |
abstract java.lang.String |
getAlgorithmName()
Return the name of the algorithm the cipher implements.
|
abstract void |
init(boolean forEncryption,
CipherParameters parameters)
Initialize the FPE engine for encryption/decryption.
|
int |
processBlock(byte[] inBuf,
int inOff,
int length,
byte[] outBuf,
int outOff)
Process length bytes from inBuf, writing the output to outBuf.
|
protected static byte[] |
toByteArray(short[] buf) |
protected static short[] |
toShortArray(byte[] buf) |
protected final BlockCipher baseCipher
protected boolean forEncryption
protected FPEParameters fpeParameters
protected FPEEngine(BlockCipher baseCipher)
public int processBlock(byte[] inBuf,
int inOff,
int length,
byte[] outBuf,
int outOff)
inBuf - input data.inOff - offset in input data to start at.length - number of bytes to process.outBuf - destination buffer.outOff - offset to start writing at in destination buffer.protected static short[] toShortArray(byte[] buf)
protected static byte[] toByteArray(short[] buf)
public abstract void init(boolean forEncryption,
CipherParameters parameters)
forEncryption - true if initialising for encryption, false otherwise.parameters - the key and other parameters to use to set the engine up.public abstract java.lang.String getAlgorithmName()
protected abstract int encryptBlock(byte[] inBuf,
int inOff,
int length,
byte[] outBuf,
int outOff)
protected abstract int decryptBlock(byte[] inBuf,
int inOff,
int length,
byte[] outBuf,
int outOff)