public class AESEngine extends Object
CryptixAESEngine which extends this class.
This design pattern allows for:
CryptixAESEngine| Modifier and Type | Field and Description |
|---|---|
protected I2PAppContext |
_context
I2P application context
|
protected Log |
_log
Logger instance
|
| Modifier | Constructor and Description |
|---|---|
protected |
AESEngine(I2PAppContext ctx)
Constructor for subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decrypt(byte[] payload,
int payloadIndex,
byte[] out,
int outIndex,
SessionKey sessionKey,
byte[] iv,
int length)
Decrypt the data with the session key
|
void |
decrypt(byte[] payload,
int payloadIndex,
byte[] out,
int outIndex,
SessionKey sessionKey,
byte[] iv,
int ivOffset,
int length)
Decrypt the data with the session key.
|
void |
decryptBlock(byte[] payload,
int inIndex,
SessionKey sessionKey,
byte[] rv,
int outIndex)
This just copies payload to rv, see extension for the real thing.
|
void |
encrypt(byte[] payload,
int payloadIndex,
byte[] out,
int outIndex,
SessionKey sessionKey,
byte[] iv,
int length)
Encrypt the payload with the session key
|
void |
encrypt(byte[] payload,
int payloadIndex,
byte[] out,
int outIndex,
SessionKey sessionKey,
byte[] iv,
int ivOffset,
int length)
Encrypt payload with session key.
|
void |
encryptBlock(byte[] payload,
int inIndex,
SessionKey sessionKey,
byte[] out,
int outIndex)
This just copies payload to out, see extension for the real thing.
|
static byte[] |
getPadding(I2PAppContext context,
int curSize,
long minPaddedSize)
Return random bytes for padding the data to a mod 16 size so that it is
at least minPaddedSize
Public for ElGamalAESEngine.
|
static int |
getPaddingSize(int curSize,
long minPaddedSize)
Return size for padding the data to a mod 16 size so that it is
at least minPaddedSize
Public for ElGamalAESEngine.
|
protected final I2PAppContext _context
protected final Log _log
protected AESEngine(I2PAppContext ctx)
ctx - I2P application contextpublic void decrypt(byte[] payload,
int payloadIndex,
byte[] out,
int outIndex,
SessionKey sessionKey,
byte[] iv,
int length)
payload - data to be decryptedpayloadIndex - index into the payload to start decryptingout - where to store the cleartextoutIndex - where in out to start writingsessionKey - private session key to decrypt toiv - IV for CBClength - how much data to decryptpublic void decrypt(byte[] payload,
int payloadIndex,
byte[] out,
int outIndex,
SessionKey sessionKey,
byte[] iv,
int ivOffset,
int length)
payload - data to be decryptedpayloadIndex - index into the payload to start decryptingout - where to store the cleartextoutIndex - where in out to start writingsessionKey - private session key to decrypt toiv - IV for CBCivOffset - offset into IVlength - how much data to decryptpublic void decryptBlock(byte[] payload,
int inIndex,
SessionKey sessionKey,
byte[] rv,
int outIndex)
payload - encrypted datainIndex - starting index in payloadsessionKey - private session keyrv - output bufferoutIndex - starting index in outputpublic void encrypt(byte[] payload,
int payloadIndex,
byte[] out,
int outIndex,
SessionKey sessionKey,
byte[] iv,
int length)
payload - data to be encryptedpayloadIndex - index into the payload to start encryptingout - where to store the resultoutIndex - where in out to start writingsessionKey - private esession key to encrypt toiv - IV for CBC, must be 16 byteslength - how much data to encryptpublic void encrypt(byte[] payload,
int payloadIndex,
byte[] out,
int outIndex,
SessionKey sessionKey,
byte[] iv,
int ivOffset,
int length)
payload - data to be encryptedpayloadIndex - index into payload to start encryptingout - where to store resultoutIndex - where in out to start writingsessionKey - private session key to encrypt toiv - IV for CBCivOffset - offset into IVlength - how much data to encryptpublic void encryptBlock(byte[] payload,
int inIndex,
SessionKey sessionKey,
byte[] out,
int outIndex)
payload - data to encryptinIndex - starting index in payloadsessionKey - unusedout - output bufferoutIndex - starting index in outputpublic static final byte[] getPadding(I2PAppContext context, int curSize, long minPaddedSize)
context - I2P application contextcurSize - current data sizeminPaddedSize - minimum padded sizepublic static final int getPaddingSize(int curSize,
long minPaddedSize)
curSize - current data sizeminPaddedSize - minimum padded size