java.lang.Object
net.i2p.router.crypto.ratchet.MuxedPQEngine

final class MuxedPQEngineextends Object
Post-quantum hybrid decryption engine supporting both ECIES and ML-KEM with adaptive ordering.
  • Field Details

    • _context

      private final RouterContext _context
      The router context the engine runs in.
    • _log

      private final Log _log
      Logger for this class.
  • Constructor Details

    • MuxedPQEngine

      public MuxedPQEngine(RouterContext ctx)
      Create the engine for the given router context.
      Parameters:
      ctx - the router context supplying the log manager used by this engine
  • Method Details

    • getMinNSSize

      private static int getMinNSSize(EncType type)
      The minimum new session size for the given encryption type. Sizes come from ECIESAEADEngine, the single source of truth for the wire format.
      Parameters:
      type - the encryption type to get the size for
      Returns:
      the minimum new-session message size in bytes
    • decrypt

      public CloveSet decrypt(byte[] data, PrivateKey ecKey, PrivateKey pqKey, MuxedPQSKM keyManager) throws DataFormatException
      Decrypt the message with the given private keys.
      Parameters:
      data - the data to decrypt
      ecKey - must be EC, non-null
      pqKey - must be PQ, non-null
      keyManager - the key manager
      Returns:
      decrypted data or null on failure
      Throws:
      DataFormatException - if the data is malformed