Package org.apache.sshd.common.kex
Class XDH
java.lang.Object
org.apache.sshd.common.kex.AbstractDH
org.apache.sshd.common.kex.XDH
- All Implemented Interfaces:
CurveSizeIndicator
Provides Diffie-Hellman SSH key exchange algorithms for the Montgomery curves specified in RFC 8731.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MontgomeryCurveprotected byte[]protected final booleanFields inherited from class org.apache.sshd.common.kex.AbstractDH
myKeyAgree -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]Lazy-called byAbstractDH.getE()if the public key data has not been generated yet.protected byte[]Lazy-called byAbstractDH.getK()if the shared secret data has not been calculated yetintRetrieves the length of a point coordinate in bytes.voidvoidvoidsetF(byte[] f) Methods inherited from class org.apache.sshd.common.kex.AbstractDH
checkKeyAgreementNecessity, getE, getHash, getK, getKeyEncapsulation, isPublicDataAvailable, isSharedSecretAvailable, stripLeadingZeroes, toString
-
Field Details
-
curve
-
raw
protected final boolean raw -
f
protected byte[] f
-
-
Constructor Details
-
XDH
- Throws:
Exception
-
-
Method Details
-
getByteLength
public int getByteLength()Description copied from interface:CurveSizeIndicatorRetrieves the length of a point coordinate in bytes.- Specified by:
getByteLengthin interfaceCurveSizeIndicator- Returns:
- the length
-
calculateE
Description copied from class:AbstractDHLazy-called byAbstractDH.getE()if the public key data has not been generated yet.- Specified by:
calculateEin classAbstractDH- Returns:
- The calculated public key data
- Throws:
Exception- If failed to generate the relevant data
-
setF
public void setF(byte[] f) - Specified by:
setFin classAbstractDH
-
putE
- Overrides:
putEin classAbstractDH
-
putF
- Overrides:
putFin classAbstractDH
-
calculateK
Description copied from class:AbstractDHLazy-called byAbstractDH.getK()if the shared secret data has not been calculated yet- Specified by:
calculateKin classAbstractDH- Returns:
- The shared secret data
- Throws:
Exception- If failed to calculate it
-