Class XDH


public abstract class XDH extends AbstractDH
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

    • getKeySize

      public int getKeySize()
    • 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(Buffer buffer, byte[] e)
      Overrides:
      putE in class AbstractDH
    • putF

      public void putF(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