Class XDH

All Implemented Interfaces:
CurveSizeIndicator

public abstract class XDH extends AbstractDH implements CurveSizeIndicator
Provides Diffie-Hellman SSH key exchange algorithms for the Montgomery curves specified in RFC 8731.
See Also:
  • Field Details

    • curve

      protected final MontgomeryCurve curve
    • raw

      protected final boolean raw
    • f

      protected byte[] f
  • Constructor Details

  • Method Details

    • getByteLength

      public int getByteLength()
      Description copied from interface: CurveSizeIndicator
      Retrieves the length of a point coordinate in bytes.
      Specified by:
      getByteLength in interface CurveSizeIndicator
      Returns:
      the length
    • calculateE

      protected byte[] calculateE() throws Exception
      Description copied from class: AbstractDH
      Lazy-called by AbstractDH.getE() if the public key data has not been generated yet.
      Specified by:
      calculateE in class AbstractDH
      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 class AbstractDH
    • putE

      public void putE(org.apache.sshd.common.util.buffer.Buffer buffer, byte[] e)
      Overrides:
      putE in class AbstractDH
    • putF

      public void putF(org.apache.sshd.common.util.buffer.Buffer buffer, byte[] f)
      Overrides:
      putF in class AbstractDH
    • calculateK

      protected byte[] calculateK() throws Exception
      Description copied from class: AbstractDH
      Lazy-called by AbstractDH.getK() if the shared secret data has not been calculated yet
      Specified by:
      calculateK in class AbstractDH
      Returns:
      The shared secret data
      Throws:
      Exception - If failed to calculate it