java.lang.Object
com.coderslagoon.crypto.estreamj.ciphers.aes.AES
Direct Known Subclasses:
AESLean, AESMean

public abstract class AES extends Object
AES base class, used by both the lean(=small) and the mean(=fast) class; based on the work of Brian Gladman's optimizations and C code, and the Bouncy Castle translation to Java
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    protected int
     
    protected int
     
    protected int
     
    protected int
     
    protected boolean
     
    protected static final int
     
    protected static final int
     
    protected static final int
     
    protected static final int[]
     
    protected int
     
    protected static byte[]
     
    protected static byte[]
     
    protected int[][]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AES()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    decryptBlock(int[][] KW)
     
    protected abstract void
    encryptBlock(int[][] KW)
     
    void
     
    protected static final int
    FFmulX(int x)
     
    protected int[][]
    generateWorkingKey(byte[] key, int ofs, int len, boolean forEncryption)
     
    void
    init(boolean forEncryption, byte[] key, int ofs, int len)
     
    protected static final int
    inv_mcol(int x)
     
    protected static final int
    mcol(int x)
     
    int
    processBlock(byte[] in, int inOff, byte[] out, int outOff)
     
    protected static final int
    shift(int r, int shift)
     
    protected static final int
    subWord(int x)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • S

      protected static byte[] S
    • Si

      protected static byte[] Si
    • rcon

      protected static final int[] rcon
    • m1

      protected static final int m1
      See Also:
    • m2

      protected static final int m2
      See Also:
    • m3

      protected static final int m3
      See Also:
    • ROUNDS

      protected int ROUNDS
    • workingKey

      protected int[][] workingKey
    • C0

      protected int C0
    • C1

      protected int C1
    • C2

      protected int C2
    • C3

      protected int C3
    • forEncryption

      protected boolean forEncryption
    • BLOCK_SIZE

      public static final int BLOCK_SIZE
      See Also:
  • Constructor Details

    • AES

      public AES()
  • Method Details

    • shift

      protected static final int shift(int r, int shift)
    • FFmulX

      protected static final int FFmulX(int x)
    • mcol

      protected static final int mcol(int x)
    • inv_mcol

      protected static final int inv_mcol(int x)
    • subWord

      protected static final int subWord(int x)
    • erase

      public void erase()
    • generateWorkingKey

      protected int[][] generateWorkingKey(byte[] key, int ofs, int len, boolean forEncryption)
    • init

      public void init(boolean forEncryption, byte[] key, int ofs, int len)
    • processBlock

      public int processBlock(byte[] in, int inOff, byte[] out, int outOff)
    • encryptBlock

      protected abstract void encryptBlock(int[][] KW)
    • decryptBlock

      protected abstract void decryptBlock(int[][] KW)