Package org.apache.sshd.common.kex
Class XDH
- java.lang.Object
-
- org.apache.sshd.common.kex.AbstractDH
-
- org.apache.sshd.common.kex.XDH
-
public class XDH extends AbstractDH
Provides Diffie-Hellman SSH key exchange algorithms for the Montgomery curves specified in RFC 8731.- See Also:
- RFC 8731
-
-
Field Summary
Fields Modifier and Type Field Description protected MontgomeryCurve
curve
protected byte[]
f
-
Fields inherited from class org.apache.sshd.common.kex.AbstractDH
myKeyAgree
-
-
Constructor Summary
Constructors Constructor Description XDH(MontgomeryCurve curve)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]
calculateE()
Lazy-called byAbstractDH.getE()
if the public key data has not been generated yet.protected byte[]
calculateK()
Lazy-called byAbstractDH.getK()
if the shared secret data has not been calculated yetDigest
getHash()
void
putE(Buffer buffer, byte[] e)
void
putF(Buffer buffer, byte[] f)
void
setF(byte[] f)
-
Methods inherited from class org.apache.sshd.common.kex.AbstractDH
checkKeyAgreementNecessity, getE, getK, isPublicDataAvailable, isSharedSecretAvailable, stripLeadingZeroes, toString
-
-
-
-
Field Detail
-
curve
protected MontgomeryCurve curve
-
f
protected byte[] f
-
-
Constructor Detail
-
XDH
public XDH(MontgomeryCurve curve) throws Exception
- Throws:
Exception
-
-
Method Detail
-
calculateE
protected byte[] calculateE() throws Exception
Description copied from class:AbstractDH
Lazy-called byAbstractDH.getE()
if the public key data has not been generated yet.- Specified by:
calculateE
in classAbstractDH
- Returns:
- The calculated public key data
- Throws:
Exception
- If failed to generate the relevant data
-
setF
public void setF(byte[] f)
- Specified by:
setF
in classAbstractDH
-
putE
public void putE(Buffer buffer, byte[] e)
- Overrides:
putE
in classAbstractDH
-
putF
public void putF(Buffer buffer, byte[] f)
- Overrides:
putF
in classAbstractDH
-
calculateK
protected byte[] calculateK() throws Exception
Description copied from class:AbstractDH
Lazy-called byAbstractDH.getK()
if the shared secret data has not been calculated yet- Specified by:
calculateK
in classAbstractDH
- Returns:
- The shared secret data
- Throws:
Exception
- If failed to calculate it
-
getHash
public Digest getHash() throws Exception
- Specified by:
getHash
in classAbstractDH
- Throws:
Exception
-
-