Class AESPacketCipher

java.lang.Object
org.bouncycastle.crypto.engines.AESPacketCipher

public class AESPacketCipher extends Object
A collection of blockwise methods implementing AES Copied from AESEngine
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    checkKeyLength(int keyLen)
    Check the key len and fail if not valid.
    static byte[]
    createS(boolean forEncryption)
     
    static int[][]
    generateWorkingKey(boolean forEncryption, byte[] key)
    Calculate the necessary round keys The number of calculations depends on key size and block size AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits This code is written assuming those are the only possible values
    static void
    processBlock(boolean forEncryption, int[][] schedule, byte[] s, byte[] in, int inOff, byte[] out, int outOff)
    Does not allocate, does not do any bounds verification Intended to be used within larger implementation that asserts limits.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • AESPacketCipher

      public AESPacketCipher()
  • Method Details

    • createS

      public static byte[] createS(boolean forEncryption)
    • generateWorkingKey

      public static int[][] generateWorkingKey(boolean forEncryption, byte[] key)
      Calculate the necessary round keys The number of calculations depends on key size and block size AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits This code is written assuming those are the only possible values
    • processBlock

      public static void processBlock(boolean forEncryption, int[][] schedule, byte[] s, byte[] in, int inOff, byte[] out, int outOff)
      Does not allocate, does not do any bounds verification Intended to be used within larger implementation that asserts limits.
      Parameters:
      forEncryption - direction
      schedule - the key schedule
      s -
      in -
      inOff -
      out -
      outOff -
    • checkKeyLength

      public static void checkKeyLength(int keyLen) throws PacketCipherException
      Check the key len and fail if not valid.
      Parameters:
      keyLen - The key len
      Throws:
      PacketCipherException