Interface Ed25519.Native

All Known Implementing Classes:
LazySodium, LazySodiumAndroid, LazySodiumJava
Enclosing interface:
Ed25519

public static interface Ed25519.Native
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    cryptoCoreEd25519Add(byte[] result, byte[] p, byte[] q)
    Adds two given Ed25519 points p and q and puts the representation of the result into result.
    boolean
    cryptoCoreEd25519FromUniform(byte[] point, byte[] hash)
    Maps a Ed25519.ED25519_HASH_BYTES bytes hash to a Ed25519 point and puts its representation to point.
    boolean
    Returns whether the passed bytes represent a valid Ed25519 point.
    void
    Chooses a random Ed25519 point and puts its representation to point
    void
    cryptoCoreEd25519ScalarAdd(byte[] result, byte[] x, byte[] y)
    Adds two scalars x and y modulo L with L being the order of the Ed25519 group.
    void
    cryptoCoreEd25519ScalarComplement(byte[] result, byte[] scalar)
    Calculates the result R for the given scalar value such that R + scalar = 1 (mod L) with L being the order of the Ed25519 group.
    boolean
    cryptoCoreEd25519ScalarInvert(byte[] result, byte[] scalar)
    Calculates the multiplicative inverse of the given scalar value.
    void
    cryptoCoreEd25519ScalarMul(byte[] result, byte[] x, byte[] y)
    Multiplies two scalars x and y modulo L with L being the order of the Ed25519 group.
    void
    cryptoCoreEd25519ScalarNegate(byte[] result, byte[] scalar)
    Calculates the additive inverse of the given scalar value.
    void
    Creates a random scalar value in [0, l[ with L being the order of the Ed25519 group.
    void
    cryptoCoreEd25519ScalarReduce(byte[] result, byte[] scalar)
    Reduces a possibly larger scalar value to [0, l[ with L being the order of the Ed25519 group.
    void
    cryptoCoreEd25519ScalarSub(byte[] result, byte[] x, byte[] y)
    Subtracts two scalars x and y modulo L with L being the order of the Ed25519 group.
    boolean
    cryptoCoreEd25519Sub(byte[] result, byte[] p, byte[] q)
    Subtracts two given Ed25519 points p and q and puts the representation of the result into result.
    boolean
    cryptoScalarMultEd25519BaseNoclamp(byte[] result, byte[] n)
    Multiplies the Ed25519 base point by the scalar n and puts the representation of the result into result.
    boolean
    cryptoScalarMultEd25519Noclamp(byte[] result, byte[] n, byte[] point)
    Multiplies the given Ed25519 point by the scalar n and puts the representation of the result into result.
  • Method Details

    • cryptoCoreEd25519IsValidPoint

      boolean cryptoCoreEd25519IsValidPoint(byte[] point)
      Returns whether the passed bytes represent a valid Ed25519 point.
      Parameters:
      point - the point to check, should be Ed25519.ED25519_BYTES bytes
      Returns:
      true if valid
    • cryptoCoreEd25519Random

      void cryptoCoreEd25519Random(byte[] point)
      Chooses a random Ed25519 point and puts its representation to point
      Parameters:
      point - the target array, must be Ed25519.ED25519_BYTES bytes
    • cryptoCoreEd25519FromUniform

      boolean cryptoCoreEd25519FromUniform(byte[] point, byte[] hash)
      Maps a Ed25519.ED25519_HASH_BYTES bytes hash to a Ed25519 point and puts its representation to point.
      Parameters:
      point - the target array, must be Ed25519.ED25519_BYTES bytes
      hash - the hash, must be Ed25519.ED25519_HASH_BYTES bytes
      Returns:
      true if successful
    • cryptoScalarMultEd25519Noclamp

      boolean cryptoScalarMultEd25519Noclamp(byte[] result, byte[] n, byte[] point)
      Multiplies the given Ed25519 point by the scalar n and puts the representation of the result into result.
      Parameters:
      result - the target array, must be Ed25519.ED25519_BYTES bytes
      n - the scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
      point - the Ed25519 point, must be Ed25519.ED25519_BYTES bytes
      Returns:
      true if successful
    • cryptoScalarMultEd25519BaseNoclamp

      boolean cryptoScalarMultEd25519BaseNoclamp(byte[] result, byte[] n)
      Multiplies the Ed25519 base point by the scalar n and puts the representation of the result into result.
      Parameters:
      result - the target array, must be Ed25519.ED25519_BYTES bytes
      n - the scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
      Returns:
      true if successful
    • cryptoCoreEd25519Add

      boolean cryptoCoreEd25519Add(byte[] result, byte[] p, byte[] q)
      Adds two given Ed25519 points p and q and puts the representation of the result into result.
      Parameters:
      result - the target array, must be Ed25519.ED25519_BYTES bytes
      p - the first Ed25519 point, must be Ed25519.ED25519_BYTES bytes
      q - the second Ed25519 point, must be Ed25519.ED25519_BYTES bytes
      Returns:
      true if successful
    • cryptoCoreEd25519Sub

      boolean cryptoCoreEd25519Sub(byte[] result, byte[] p, byte[] q)
      Subtracts two given Ed25519 points p and q and puts the representation of the result into result.
      Parameters:
      result - the target array, must be Ed25519.ED25519_BYTES bytes
      p - the first Ed25519 point, must be Ed25519.ED25519_BYTES bytes
      q - the second Ed25519 point, must be Ed25519.ED25519_BYTES bytes
      Returns:
      true if successful
    • cryptoCoreEd25519ScalarRandom

      void cryptoCoreEd25519ScalarRandom(byte[] scalar)
      Creates a random scalar value in [0, l[ with L being the order of the Ed25519 group.
      Parameters:
      scalar - the target array, must be Ed25519.ED25519_SCALAR_BYTES bytes
    • cryptoCoreEd25519ScalarReduce

      void cryptoCoreEd25519ScalarReduce(byte[] result, byte[] scalar)
      Reduces a possibly larger scalar value to [0, l[ with L being the order of the Ed25519 group.
      Parameters:
      result - the target array, must be Ed25519.ED25519_SCALAR_BYTES bytes
      scalar - the scalar to reduce, must be Ed25519.ED25519_NON_REDUCED_SCALAR_BYTES bytes
    • cryptoCoreEd25519ScalarInvert

      boolean cryptoCoreEd25519ScalarInvert(byte[] result, byte[] scalar)
      Calculates the multiplicative inverse of the given scalar value.
      Parameters:
      result - the target array, must be Ed25519.ED25519_SCALAR_BYTES bytes
      scalar - the scalar to invert, must be Ed25519.ED25519_SCALAR_BYTES bytes
      Returns:
      true if successful
    • cryptoCoreEd25519ScalarNegate

      void cryptoCoreEd25519ScalarNegate(byte[] result, byte[] scalar)
      Calculates the additive inverse of the given scalar value.
      Parameters:
      result - the target array, must be Ed25519.ED25519_SCALAR_BYTES bytes
      scalar - the scalar to negate, must be Ed25519.ED25519_SCALAR_BYTES bytes
    • cryptoCoreEd25519ScalarComplement

      void cryptoCoreEd25519ScalarComplement(byte[] result, byte[] scalar)
      Calculates the result R for the given scalar value such that R + scalar = 1 (mod L) with L being the order of the Ed25519 group.
      Parameters:
      result - the target array, must be Ed25519.ED25519_SCALAR_BYTES bytes
      scalar - the scalar to complement, must be Ed25519.ED25519_SCALAR_BYTES bytes
    • cryptoCoreEd25519ScalarAdd

      void cryptoCoreEd25519ScalarAdd(byte[] result, byte[] x, byte[] y)
      Adds two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      result - the target array, must be Ed25519.ED25519_SCALAR_BYTES bytes
      x - the first scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
      y - the second scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
    • cryptoCoreEd25519ScalarSub

      void cryptoCoreEd25519ScalarSub(byte[] result, byte[] x, byte[] y)
      Subtracts two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      result - the target array, must be Ed25519.ED25519_SCALAR_BYTES bytes
      x - the first scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
      y - the second scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
    • cryptoCoreEd25519ScalarMul

      void cryptoCoreEd25519ScalarMul(byte[] result, byte[] x, byte[] y)
      Multiplies two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      result - the target array, must be Ed25519.ED25519_SCALAR_BYTES bytes
      x - the first scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
      y - the second scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes