CryptixAESEnginepublic class AESEngine extends Object
| Modifier and Type | Field | Description |
|---|---|---|
protected I2PAppContext |
_context |
|
protected Log |
_log |
| Constructor | Description |
|---|---|
AESEngine(I2PAppContext ctx) |
| Modifier and Type | Method | 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 the payload with the 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.
|
byte[] |
safeDecrypt(byte[] payload,
SessionKey sessionKey,
byte[] iv) |
Deprecated.
unused
|
byte[] |
safeEncrypt(byte[] payload,
SessionKey sessionKey,
byte[] iv,
int paddedSize) |
Deprecated.
unused
|
protected final Log _log
protected final I2PAppContext _context
public AESEngine(I2PAppContext ctx)
public 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 the payload to start encryptingout - where to store the resultoutIndex - where in out to start writingsessionKey - private esession key to encrypt toiv - IV for CBClength - how much data to encrypt@Deprecated public byte[] safeEncrypt(byte[] payload, SessionKey sessionKey, byte[] iv, int paddedSize)
paddedSize - minimum size of the outputiv - IV for CBC, must be 16 bytes@Deprecated public byte[] safeDecrypt(byte[] payload, SessionKey sessionKey, byte[] iv)
iv - IV for CBC, must be 16 bytespublic 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 CBClength - how much data to decryptpublic void encryptBlock(byte[] payload,
int inIndex,
SessionKey sessionKey,
byte[] out,
int outIndex)
sessionKey - unusedpublic void decryptBlock(byte[] payload,
int inIndex,
SessionKey sessionKey,
byte[] rv,
int outIndex)
payload - encrypted datasessionKey - private session key