Top Description Inners Constructors Methods
org.apache.sshd.common.kex

pack-priv final Class SNTRUP761

extends Object
Class Inheritance
Imports
java.util.Arrays, org.apache.sshd.common.random.JceRandom, org.apache.sshd.common.util.security.SecurityUtils, org.bouncycastle.crypto.AsymmetricCipherKeyPair, .SecretWithEncapsulation, org.bouncycastle.pqc.crypto.ntruprime.SNTRUPrimeKEMExtractor, .SNTRUPrimeKEMGenerator, .SNTRUPrimeKeyGenerationParameters, .SNTRUPrimeKeyPairGenerator, .SNTRUPrimeParameters, .SNTRUPrimePrivateKeyParameters, .SNTRUPrimePublicKeyParameters

A Bouncy Castle implementation of the sntrup761 key encapsulation method (KEM).

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SNTRUP761back to summary
private SNTRUP761()

Method Detail

isSupportedback to summary
pack-priv static boolean isSupported()
org.apache.sshd.common.kex back to summary

pack-priv Class SNTRUP761.Client

extends Object
implements Client
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.kex.KeyEncapsulationMethod.Client

Field Summary

Modifier and TypeField and Description
private SNTRUPrimeKEMExtractor
private SNTRUPrimePublicKeyParameters

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public byte[]
extractSecret(byte[]
ciphertext to process.
encapsulated
)

Implements org.apache.sshd.common.kex.KeyEncapsulationMethod.Client.extractSecret.

Extracts the secret from an encapsulation ciphertext.

public int
public byte[]
public void
init()

Implements org.apache.sshd.common.kex.KeyEncapsulationMethod.Client.init.

Initializes the KEM and generates a new key pair.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

extractorback to summary
private SNTRUPrimeKEMExtractor extractor
publicKeyback to summary
private SNTRUPrimePublicKeyParameters publicKey

Constructor Detail

Clientback to summary
pack-priv Client()

Method Detail

extractSecretback to summary
public byte[] extractSecret(byte[] encapsulated)

Implements org.apache.sshd.common.kex.KeyEncapsulationMethod.Client.extractSecret.

Doc from org.apache.sshd.common.kex.KeyEncapsulationMethod.Client.extractSecret.

Extracts the secret from an encapsulation ciphertext.

Parameters
encapsulated:byte[]

ciphertext to process.

Returns:byte[]

the secret from an encapsulation ciphertext.

Annotations
@Override
getEncapsulationLengthback to summary
public int getEncapsulationLength()

Implements org.apache.sshd.common.kex.KeyEncapsulationMethod.Client.getEncapsulationLength.

Doc from org.apache.sshd.common.kex.KeyEncapsulationMethod.Client.getEncapsulationLength.

Gets the required encapsulation length in bytes.

Returns:int

the length required for a valid encapsulation ciphertext.

Annotations
@Override
getPublicKeyback to summary
public byte[] getPublicKey()

Implements org.apache.sshd.common.kex.KeyEncapsulationMethod.Client.getPublicKey.

Doc from org.apache.sshd.common.kex.KeyEncapsulationMethod.Client.getPublicKey.

Gets the KEM public key.

Returns:byte[]

the KEM public key.

Annotations
@Override
initback to summary
public void init()

Implements org.apache.sshd.common.kex.KeyEncapsulationMethod.Client.init.

Doc from org.apache.sshd.common.kex.KeyEncapsulationMethod.Client.init.

Initializes the KEM and generates a new key pair.

Annotations
@Override
org.apache.sshd.common.kex back to summary

pack-priv Class SNTRUP761.Server

extends Object
implements Server
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.kex.KeyEncapsulationMethod.Server

Field Summary

Modifier and TypeField and Description
private SecretWithEncapsulation

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public byte[]
public int
getPublicKeyLength()

Implements org.apache.sshd.common.kex.KeyEncapsulationMethod.Server.getPublicKeyLength.

Retrieves the required length of the KEM public key, in bytes.

public byte[]
public byte[]
init(byte[]
data received from the client, expected to contain the public key at the start
publicKey
)

Implements org.apache.sshd.common.kex.KeyEncapsulationMethod.Server.init.

Initializes the KEM with a public key received from a client and prepares an encapsulated secret.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

valueback to summary
private SecretWithEncapsulation value

Constructor Detail

Serverback to summary
pack-priv Server()

Method Detail

getEncapsulationback to summary
public byte[] getEncapsulation()

Implements org.apache.sshd.common.kex.KeyEncapsulationMethod.Server.getEncapsulation.

Doc from org.apache.sshd.common.kex.KeyEncapsulationMethod.Server.getEncapsulation.

Retrieves the encapsulation of the secret.

Returns:byte[]

the encapsulation of the secret that may be sent to the client

Annotations
@Override
getPublicKeyLengthback to summary
public int getPublicKeyLength()

Implements org.apache.sshd.common.kex.KeyEncapsulationMethod.Server.getPublicKeyLength.

Doc from org.apache.sshd.common.kex.KeyEncapsulationMethod.Server.getPublicKeyLength.

Retrieves the required length of the KEM public key, in bytes.

Returns:int

the length of the key

Annotations
@Override
getSecretback to summary
public byte[] getSecret()

Implements org.apache.sshd.common.kex.KeyEncapsulationMethod.Server.getSecret.

Doc from org.apache.sshd.common.kex.KeyEncapsulationMethod.Server.getSecret.

Retrieves the secret.

Returns:byte[]

the secret, not encapsulated

Annotations
@Override
initback to summary
public byte[] init(byte[] publicKey)

Implements org.apache.sshd.common.kex.KeyEncapsulationMethod.Server.init.

Doc from org.apache.sshd.common.kex.KeyEncapsulationMethod.Server.init.

Initializes the KEM with a public key received from a client and prepares an encapsulated secret.

Parameters
publicKey:byte[]

data received from the client, expected to contain the public key at the start

Returns:byte[]

the remaining bytes of publicKey after the public key

Annotations
@Override