Class Curve25519


  • public final class Curve25519
    extends java.lang.Object
    Implementation of Curve25519 ECDH.

    This implementation was imported to WireGuard from noise-java: https://github.com/rweather/noise-java

    This implementation is based on that from arduinolibs: https://github.com/rweather/arduinolibs

    Differences in this version are due to using 26-bit limbs for the representation instead of the 8/16/32-bit limbs in the original.

    References: http://cr.yp.to/ecdh.html, RFC 7748

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void eval​(byte[] result, int offset, byte[] privateKey, byte[] publicKey)
      Evaluates the Curve25519 curve.
      • Methods inherited from class java.lang.Object

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

      • eval

        public static void eval​(byte[] result,
                                int offset,
                                byte[] privateKey,
                                @Nullable
                                byte[] publicKey)
        Evaluates the Curve25519 curve.
        Parameters:
        result - Buffer to place the result of the evaluation into.
        offset - Offset into the result buffer.
        privateKey - The private key to use in the evaluation.
        publicKey - The public key to use in the evaluation, or null if the base point of the curve should be used.