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

public abstract Class XDH

extends AbstractDH
implements CurveSizeIndicator
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.kex.CurveSizeIndicator
Imports
java.security.KeyPair, java.util.Objects, org.apache.sshd.common.util.buffer.Buffer

Provides Diffie-Hellman SSH key exchange algorithms for the Montgomery curves specified in RFC 8731.
See Also
RFC 8731

Field Summary

Modifier and TypeField and Description
protected final MontgomeryCurve
protected byte[]
f

protected final boolean
Inherited from org.apache.sshd.common.kex.AbstractDH:
myKeyAgree

Constructor Summary

AccessConstructor and Description
public
XDH(MontgomeryCurve curve, boolean raw)

Method Summary

Modifier and TypeMethod and Description
protected byte[]
calculateE()

Implements abstract org.apache.sshd.common.kex.AbstractDH.calculateE.

Lazy-called by getE() if the public key data has not been generated yet.

protected byte[]
calculateK()

Implements abstract org.apache.sshd.common.kex.AbstractDH.calculateK.

Lazy-called by getK() if the shared secret data has not been calculated yet

public int
getByteLength()

Implements org.apache.sshd.common.kex.CurveSizeIndicator.getByteLength.

Retrieves the length of a point coordinate in bytes.

public void
public void
public void
setF(byte[] f)

Implements abstract org.apache.sshd.common.kex.AbstractDH.setF.

Inherited from org.apache.sshd.common.kex.AbstractDH:
checkKeyAgreementNecessitygetEgetHashgetKgetKeyEncapsulationisPublicDataAvailableisSharedSecretAvailablestripLeadingZeroestoString

Field Detail

curveback to summary
protected final MontgomeryCurve curve
fback to summary
protected byte[] f
rawback to summary
protected final boolean raw

Constructor Detail

XDHback to summary
public XDH(MontgomeryCurve curve, boolean raw) throws Exception

Method Detail

calculateEback to summary
protected byte[] calculateE() throws Exception

Implements abstract org.apache.sshd.common.kex.AbstractDH.calculateE.

Doc from org.apache.sshd.common.kex.AbstractDH.calculateE.

Lazy-called by getE() if the public key data has not been generated yet.

Returns:byte[]

The calculated public key data

Annotations
@Override
Exceptions
Exception:
If failed to generate the relevant data
calculateKback to summary
protected byte[] calculateK() throws Exception

Implements abstract org.apache.sshd.common.kex.AbstractDH.calculateK.

Doc from org.apache.sshd.common.kex.AbstractDH.calculateK.

Lazy-called by getK() if the shared secret data has not been calculated yet

Returns:byte[]

The shared secret data

Annotations
@Override
Exceptions
Exception:
If failed to calculate it
getByteLengthback to summary
public int getByteLength()

Implements org.apache.sshd.common.kex.CurveSizeIndicator.getByteLength.

Doc from org.apache.sshd.common.kex.CurveSizeIndicator.getByteLength.

Retrieves the length of a point coordinate in bytes.

Returns:int

the length

Annotations
@Override
putEback to summary
public void putE(Buffer buffer, byte[] e)

Overrides org.apache.sshd.common.kex.AbstractDH.putE.

Annotations
@Override
putFback to summary
public void putF(Buffer buffer, byte[] f)

Overrides org.apache.sshd.common.kex.AbstractDH.putF.

Annotations
@Override
setFback to summary
public void setF(byte[] f)

Implements abstract org.apache.sshd.common.kex.AbstractDH.setF.

Annotations
@Override