## net.i2p.crypto
Class AESEngine

    java.lang.Object
      net.i2p.crypto.AESEngine

Direct Known Subclasses:
  CryptixAESEngine

    public class AESEngine

extends java.lang.Object

Dummy wrapper for AES cipher operation.

Constructor Summary
`AESEngine(I2PAppContext ctx)`

Method Summary
`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)` decrypt the data with the session key provided
`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)`
`static void` `main(java.lang.String[] args)`
`byte[]` `safeDecrypt(byte[] payload, SessionKey sessionKey, byte[] iv)`
`byte[]` `safeEncrypt(byte[] payload, SessionKey sessionKey, byte[] iv, int paddedSize)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AESEngine

    public AESEngine(I2PAppContext ctx)

Method Detail

### encrypt

    public void encrypt(byte[] payload,
                        int payloadIndex,
                        byte[] out,
                        int outIndex,
                        SessionKey sessionKey,
                        byte[] iv,
                        int length)

  Encrypt the payload with the session key

  Parameters:
    `payload` - data to be encrypted
    `payloadIndex` - index into the payload to start encrypting
    `out` - where to store the result
    `outIndex` - where in out to start writing
    `sessionKey` - private esession key to encrypt to
    `iv` - IV for CBC
    `length` - how much data to encrypt

### encrypt

    public 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

  Parameters:
    `payload` - data to be encrypted
    `payloadIndex` - index into the payload to start encrypting
    `out` - where to store the result
    `outIndex` - where in out to start writing
    `sessionKey` - private esession key to encrypt to
    `iv` - IV for CBC
    `length` - how much data to encrypt

### safeEncrypt

    public byte[] safeEncrypt(byte[] payload,
                              SessionKey sessionKey,
                              byte[] iv,
                              int paddedSize)

### safeDecrypt

    public byte[] safeDecrypt(byte[] payload,
                              SessionKey sessionKey,
                              byte[] iv)

### decrypt

    public void decrypt(byte[] payload,
                        int payloadIndex,
                        byte[] out,
                        int outIndex,
                        SessionKey sessionKey,
                        byte[] iv,
                        int length)

  Decrypt the data with the session key

  Parameters:
    `payload` - data to be decrypted
    `payloadIndex` - index into the payload to start decrypting
    `out` - where to store the cleartext
    `outIndex` - where in out to start writing
    `sessionKey` - private session key to decrypt to
    `iv` - IV for CBC
    `length` - how much data to decrypt

### decrypt

    public 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

  Parameters:
    `payload` - data to be decrypted
    `payloadIndex` - index into the payload to start decrypting
    `out` - where to store the cleartext
    `outIndex` - where in out to start writing
    `sessionKey` - private session key to decrypt to
    `iv` - IV for CBC
    `length` - how much data to decrypt

### encryptBlock

    public void encryptBlock(byte[] payload,
                             int inIndex,
                             SessionKey sessionKey,
                             byte[] out,
                             int outIndex)

### decryptBlock

    public void decryptBlock(byte[] payload,
                             int inIndex,
                             SessionKey sessionKey,
                             byte[] rv,
                             int outIndex)

  decrypt the data with the session key provided

  Parameters:
    `payload` - encrypted data
    `sessionKey` - private session key

### main

    public static void main(java.lang.String[] args)