java.lang.Object
org.bouncycastle.pqc.crypto.mlkem.MLKEMExtractor
Extractor for ML-KEM private key operations. Provides functionality to extract shared secrets from encapsulated data using private keys.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MLKEMEngineThe ML-KEM engine doing the work.private final MLKEMPrivateKeyParametersThe private key decapsulating the secret.Constructor Summary
ConstructorsConstructorDescriptionMLKEMExtractor(MLKEMPrivateKeyParameters privateKey) Creates a new MLKEMExtractor instance.Method Summary
All MethodsModifier and TypeMethodDescriptionbyte[]extractSecret(byte[] encapsulation) Extract the shared secret from the encapsulated data.intGet the encapsulation length.
Field Details
privateKey
The private key decapsulating the secret.engine
The ML-KEM engine doing the work.
Constructor Details
MLKEMExtractor
Creates a new MLKEMExtractor instance.- Parameters:
privateKey- the private key to use for decapsulation
Method Details
extractSecret
public byte[] extractSecret(byte[] encapsulation) Extract the shared secret from the encapsulated data.- Parameters:
encapsulation- the encapsulated data- Returns:
- the shared secret
getEncapsulationLength
public int getEncapsulationLength()Get the encapsulation length.- Returns:
- the encapsulation length in bytes