Package org.apache.sshd.common.kex
Class SNTRUP761.Server
java.lang.Object
org.apache.sshd.common.kex.SNTRUP761.Server
- All Implemented Interfaces:
KeyEncapsulationMethod.Server
- Enclosing class:
SNTRUP761
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Retrieves the encapsulation of the secret.byte[]
Retrieves the secret.byte[]
init
(byte[] publicKey) Initializes the KEM with a public key received from a client and prepares an encapsulated secret.
-
Field Details
-
value
private org.bouncycastle.crypto.SecretWithEncapsulation value
-
-
Constructor Details
-
Server
Server()
-
-
Method Details
-
init
public byte[] init(byte[] publicKey) Description copied from interface:KeyEncapsulationMethod.Server
Initializes the KEM with a public key received from a client and prepares an encapsulated secret.- Specified by:
init
in interfaceKeyEncapsulationMethod.Server
- Parameters:
publicKey
- data received from the client, expected to contain the public key at the start- Returns:
- the remaining bytes of
publicKey
after the public key
-
getSecret
public byte[] getSecret()Description copied from interface:KeyEncapsulationMethod.Server
Retrieves the secret.- Specified by:
getSecret
in interfaceKeyEncapsulationMethod.Server
- Returns:
- the secret, not encapsulated
-
getEncapsulation
public byte[] getEncapsulation()Description copied from interface:KeyEncapsulationMethod.Server
Retrieves the encapsulation of the secret.- Specified by:
getEncapsulation
in interfaceKeyEncapsulationMethod.Server
- Returns:
- the encapsulation of the secret that may be sent to the client
-