Class MLKEM.Client
java.lang.Object
org.apache.sshd.common.kex.MLKEM.Client
- All Implemented Interfaces:
KeyEncapsulationMethod.Client
- Enclosing class:
MLKEM
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.bouncycastle.pqc.crypto.mlkem.MLKEMExtractorprivate final MLKEM.Parametersprivate org.bouncycastle.pqc.crypto.mlkem.MLKEMPublicKeyParameters -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]extractSecret(byte[] encapsulated) Extracts the secret from an encapsulation ciphertext.intGets the required encapsulation length in bytes.byte[]Gets the KEM public key.voidinit()Initializes the KEM and generates a new key pair.
-
Field Details
-
parameters
-
extractor
private org.bouncycastle.pqc.crypto.mlkem.MLKEMExtractor extractor -
publicKey
private org.bouncycastle.pqc.crypto.mlkem.MLKEMPublicKeyParameters publicKey
-
-
Constructor Details
-
Client
Client(MLKEM.Parameters parameters)
-
-
Method Details
-
init
public void init()Description copied from interface:KeyEncapsulationMethod.ClientInitializes the KEM and generates a new key pair.- Specified by:
initin interfaceKeyEncapsulationMethod.Client
-
getPublicKey
public byte[] getPublicKey()Description copied from interface:KeyEncapsulationMethod.ClientGets the KEM public key.- Specified by:
getPublicKeyin interfaceKeyEncapsulationMethod.Client- Returns:
- the KEM public key.
-
extractSecret
public byte[] extractSecret(byte[] encapsulated) Description copied from interface:KeyEncapsulationMethod.ClientExtracts the secret from an encapsulation ciphertext.- Specified by:
extractSecretin interfaceKeyEncapsulationMethod.Client- Parameters:
encapsulated- ciphertext to process.- Returns:
- the secret from an encapsulation ciphertext.
-
getEncapsulationLength
public int getEncapsulationLength()Description copied from interface:KeyEncapsulationMethod.ClientGets the required encapsulation length in bytes.- Specified by:
getEncapsulationLengthin interfaceKeyEncapsulationMethod.Client- Returns:
- the length required for a valid encapsulation ciphertext.
-