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.intRetrieves the required length of the KEM public key, in bytes.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
-
getPublicKeyLength
public int getPublicKeyLength()Description copied from interface:KeyEncapsulationMethod.ServerRetrieves the required length of the KEM public key, in bytes.- Specified by:
getPublicKeyLengthin interfaceKeyEncapsulationMethod.Server- Returns:
- the length of the key
-
init
public byte[] init(byte[] publicKey) Description copied from interface:KeyEncapsulationMethod.ServerInitializes the KEM with a public key received from a client and prepares an encapsulated secret.- Specified by:
initin interfaceKeyEncapsulationMethod.Server- Parameters:
publicKey- data received from the client, expected to contain the public key at the start- Returns:
- the remaining bytes of
publicKeyafter the public key
-
getSecret
public byte[] getSecret()Description copied from interface:KeyEncapsulationMethod.ServerRetrieves the secret.- Specified by:
getSecretin interfaceKeyEncapsulationMethod.Server- Returns:
- the secret, not encapsulated
-
getEncapsulation
public byte[] getEncapsulation()Description copied from interface:KeyEncapsulationMethod.ServerRetrieves the encapsulation of the secret.- Specified by:
getEncapsulationin interfaceKeyEncapsulationMethod.Server- Returns:
- the encapsulation of the secret that may be sent to the client
-