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:
    RFC 8731
    • Field Detail

      • raw

        protected final boolean raw
      • f

        protected byte[] f
    • Constructor Detail

      • XDH

        public XDH​(MontgomeryCurve curve,
                   boolean raw)
            throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • getKeySize

        public int getKeySize()
      • calculateE

        protected byte[] calculateE()
                             throws java.lang.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:
        java.lang.Exception - If failed to generate the relevant data
      • setF

        public void setF​(byte[] f)
        Specified by:
        setF in class AbstractDH
      • calculateK

        protected byte[] calculateK()
                             throws java.lang.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:
        java.lang.Exception - If failed to calculate it