Package org.apache.sshd.common.kex
Class SNTRUP761.Client
java.lang.Object
org.apache.sshd.common.kex.SNTRUP761.Client
- All Implemented Interfaces:
KeyEncapsulationMethod.Client
- Enclosing class:
SNTRUP761
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
extractSecret
(byte[] encapsulated) Extracts the secret from an encapsulation ciphertext.int
Gets the required encapsulation length in bytes.byte[]
Gets the KEM public key.void
init()
Initializes the KEM and generates a new key pair.
-
Field Details
-
extractor
private org.bouncycastle.pqc.crypto.ntruprime.SNTRUPrimeKEMExtractor extractor -
publicKey
private org.bouncycastle.pqc.crypto.ntruprime.SNTRUPrimePublicKeyParameters publicKey
-
-
Constructor Details
-
Client
Client()
-
-
Method Details
-
init
public void init()Description copied from interface:KeyEncapsulationMethod.Client
Initializes the KEM and generates a new key pair.- Specified by:
init
in interfaceKeyEncapsulationMethod.Client
-
getPublicKey
public byte[] getPublicKey()Description copied from interface:KeyEncapsulationMethod.Client
Gets the KEM public key.- Specified by:
getPublicKey
in interfaceKeyEncapsulationMethod.Client
- Returns:
- the KEM public key.
-
extractSecret
public byte[] extractSecret(byte[] encapsulated) Description copied from interface:KeyEncapsulationMethod.Client
Extracts the secret from an encapsulation ciphertext.- Specified by:
extractSecret
in interfaceKeyEncapsulationMethod.Client
- Parameters:
encapsulated
- ciphertext to process.- Returns:
- the secret from an encapsulation ciphertext.
-
getEncapsulationLength
public int getEncapsulationLength()Description copied from interface:KeyEncapsulationMethod.Client
Gets the required encapsulation length in bytes.- Specified by:
getEncapsulationLength
in interfaceKeyEncapsulationMethod.Client
- Returns:
- the length required for a valid encapsulation ciphertext.
-