Class Curve25519


  • @Alpha
    public final class Curve25519
    extends java.lang.Object
    This class implements point arithmetic on the elliptic curve Curve25519.

    This class only implements point arithmetic, if you want to use the ECDH Curve25519 function, please checkout X25519.

    This implementation is based on curve255-donna C implementation.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void curveMult​(long[] resultx, byte[] n, byte[] qBytes)
      Calculates nQ where Q is the x-coordinate of a point on the curve.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • curveMult

        public static void curveMult​(long[] resultx,
                                     byte[] n,
                                     byte[] qBytes)
                              throws java.security.InvalidKeyException
        Calculates nQ where Q is the x-coordinate of a point on the curve.
        Parameters:
        resultx - the x projective coordinate of the resulting curve point (short form).
        n - a little endian, 32-byte number.
        qBytes - a little endian, 32-byte number representing the public point' x coordinate.
        Throws:
        java.security.InvalidKeyException - iff the public key is in the banned list or its length is not 32-byte.
        java.lang.IllegalStateException - iff there is arithmetic error.