java.lang.Object
net.i2p.crypto.CryptixAESKeyCache.KeyCacheEntry
All Implemented Interfaces:
Serializable
Enclosing class:
CryptixAESKeyCache

public static class CryptixAESKeyCache.KeyCacheEntryextends Object implements Serializable
Container for AES round keys generated during key schedule expansion.

This class holds all the pre-computed round keys required for AES encryption and decryption operations. The round keys are derived from the original AES key through the key schedule algorithm and stored in optimized integer arrays for fast access during cryptographic operations.

The entry contains:

  • Encryption round keys (Ke) - expanded keys for each encryption round
  • Decryption round keys (Kd) - inverse expanded keys for each decryption round

KeyCacheEntry objects are memory-intensive structures that benefit from caching to avoid repeated key schedule computations. Each entry contains (rounds + 1) × 4 integers for both encryption and decryption, where the number of rounds depends on the AES key size (10 rounds for 128-bit, 12 rounds for 192-bit, 14 rounds for 256-bit keys).

Thread Safety: This class is immutable after construction and safe for concurrent use by multiple threads.

Memory Usage: Each entry consumes approximately: 2 × (rounds + 1) × 4 × 4 bytes of heap memory. For AES-256 (14 rounds), this is about 448 bytes per entry.

Obsolete — Keys are now cached in SessionKey objects. Retained for legacy AES engine support.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final int[][]
    Decryption round keys.
    (package private) final int[][]
    Encryption round keys.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Allocates the round-key schedules for standard AES.
    KeyCacheEntry(int rounds, int bc)
    Allocates round-key arrays for a non-default AES variant, sizing both the encryption and the decryption schedule to the supplied round count and block size instead of the AES standard values used by CryptixAESKeyCache.createNew().
  • Method Summary

    Methods inherited from class Object

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

    • Ke

      final int[][] Ke
      Encryption round keys.
    • Kd

      final int[][] Kd
      Decryption round keys.
  • Constructor Details

    • KeyCacheEntry

      public KeyCacheEntry()
      Allocates the round-key schedules for standard AES.
    • KeyCacheEntry

      public KeyCacheEntry(int rounds, int bc)
      Allocates round-key arrays for a non-default AES variant, sizing both the encryption and the decryption schedule to the supplied round count and block size instead of the AES standard values used by CryptixAESKeyCache.createNew().
      Parameters:
      rounds - AES round count, 10 for a 128-bit key up to 14 for a 256-bit key
      bc - block size in 32-bit words, 4 for the 16-byte AES block