java.lang.Object
net.i2p.router.crypto.ratchet.MuxedPQEngine
Post-quantum hybrid decryption engine supporting both ECIES and ML-KEM with adaptive ordering.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RouterContextThe router context the engine runs in.private final LogLogger for this class.Constructor Summary
ConstructorsConstructorDescriptionCreate the engine for the given router context.Method Summary
Modifier and TypeMethodDescriptiondecrypt(byte[] data, PrivateKey ecKey, PrivateKey pqKey, MuxedPQSKM keyManager) Decrypt the message with the given private keys.private static intgetMinNSSize(EncType type) The minimum new session size for the given encryption type.
Field Details
_context
The router context the engine runs in._log
Logger for this class.
Constructor Details
MuxedPQEngine
Create the engine for the given router context.- Parameters:
ctx- the router context supplying the log manager used by this engine
Method Details
getMinNSSize
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 decryptecKey- must be EC, non-nullpqKey- must be PQ, non-nullkeyManager- the key manager- Returns:
- decrypted data or null on failure
- Throws:
DataFormatException- if the data is malformed