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
static class SNTRUP761.Server extends java.lang.Object implements KeyEncapsulationMethod.Server
-
-
Field Summary
Fields Modifier and Type Field Description private org.bouncycastle.crypto.SecretWithEncapsulation
value
-
Constructor Summary
Constructors Constructor Description Server()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getEncapsulation()
Retrieves the encapsulation of the secret.byte[]
getSecret()
Retrieves the secret.byte[]
init(byte[] publicKey)
Initializes the KEM with a public key received from a client and prepares an encapsulated secret.
-
-
-
Method Detail
-
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
-
-