Interface Ed25519.Lazy

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

public static interface Ed25519.Lazy
  • Method Details

    • cryptoCoreEd25519IsValidPoint

      boolean cryptoCoreEd25519IsValidPoint(String point)
      Returns whether the passed encoded string represents a valid Ed25519 point.
      Parameters:
      point - the point to check
      Returns:
      true if valid
    • cryptoCoreEd25519Random

      Ed25519.Ed25519Point cryptoCoreEd25519Random()
      Chooses a random Ed25519 point and returns it.
      Returns:
      a random Ed25519 point
    • cryptoCoreEd25519FromUniform

      Ed25519.Ed25519Point cryptoCoreEd25519FromUniform(String hash) throws SodiumException
      Parameters:
      hash - the encoded hash
      Returns:
      the corresponding Ed25519 point
      Throws:
      SodiumException
    • cryptoCoreEd25519FromUniform

      Ed25519.Ed25519Point cryptoCoreEd25519FromUniform(byte[] hash) throws SodiumException
      Maps a Ed25519.ED25519_HASH_BYTES bytes hash to a Ed25519 point.
      Parameters:
      hash - the hash, must be Ed25519.ED25519_HASH_BYTES
      Returns:
      the corresponding Ed25519 point
      Throws:
      SodiumException
    • cryptoScalarMultEd25519Noclamp

      Ed25519.Ed25519Point cryptoScalarMultEd25519Noclamp(BigInteger n, Ed25519.Ed25519Point point) throws SodiumException
      Multiplies the given Ed25519 point by the scalar n and returns the resulting point.
      Parameters:
      n - the scalar
      point - the Ed25519 point
      Returns:
      the result
      Throws:
      SodiumException
    • cryptoScalarMultEd25519Noclamp

      Ed25519.Ed25519Point cryptoScalarMultEd25519Noclamp(String nEnc, Ed25519.Ed25519Point point) throws SodiumException
      Multiplies the given Ed25519 point by the scalar n and returns the resulting point.
      Parameters:
      nEnc - the encoded scalar bytes, in little-endian byte order
      point - the Ed25519 point
      Returns:
      the result
      Throws:
      SodiumException
    • cryptoScalarMultEd25519Noclamp

      Ed25519.Ed25519Point cryptoScalarMultEd25519Noclamp(byte[] n, Ed25519.Ed25519Point point) throws SodiumException
      Multiplies the given Ed25519 point by the scalar n and returns the resulting point.
      Parameters:
      n - the scalar, must be Ed25519.ED25519_BYTES bytes, in little-endian encoding
      point - the Ed25519 point
      Returns:
      the result
      Throws:
      SodiumException
    • cryptoScalarMultEd25519BaseNoclamp

      Ed25519.Ed25519Point cryptoScalarMultEd25519BaseNoclamp(BigInteger n) throws SodiumException
      Multiplies the Ed25519 base point by the scalar n and returns the result.
      Parameters:
      n - the scalar
      Returns:
      the result
      Throws:
      SodiumException
    • cryptoScalarMultEd25519BaseNoclamp

      Ed25519.Ed25519Point cryptoScalarMultEd25519BaseNoclamp(String nEnc) throws SodiumException
      Multiplies the Ed25519 base point by the scalar n and returns the result.
      Parameters:
      nEnc - the encoded scalar, in little-endian byte order
      Returns:
      the result
      Throws:
      SodiumException
    • cryptoScalarMultEd25519BaseNoclamp

      Ed25519.Ed25519Point cryptoScalarMultEd25519BaseNoclamp(byte[] n) throws SodiumException
      Multiplies the Ed25519 base point by the scalar n and returns the result.
      Parameters:
      n - the scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes, in little-endian encoding
      Returns:
      the result
      Throws:
      SodiumException
    • cryptoCoreEd25519Add

      Adds two given Ed25519 points p and q and returns the result.
      Parameters:
      p - the first Ed25519 point
      q - the second Ed25519 point
      Returns:
      the sum
      Throws:
      SodiumException
    • cryptoCoreEd25519Sub

      Subtracts two given Ed25519 points p and q and returns the result.
      Parameters:
      p - the first Ed25519 point
      q - the second Ed25519 point
      Returns:
      the difference
      Throws:
      SodiumException
    • cryptoCoreEd25519ScalarRandom

      BigInteger cryptoCoreEd25519ScalarRandom()
      Creates a random scalar value in [0, l[ with L being the order of the Ed25519 group.
      Returns:
      the random scalar value
    • cryptoCoreEd25519ScalarReduce

      BigInteger cryptoCoreEd25519ScalarReduce(BigInteger scalar)
      Reduces a possibly larger scalar value to [0, l[ with L being the order of the Ed25519 group.
      Parameters:
      scalar - the scalar to reduce
      Returns:
      the reduced scalar
    • cryptoCoreEd25519ScalarReduce

      BigInteger cryptoCoreEd25519ScalarReduce(String scalarEnc)
      Reduces a possibly larger scalar value to [0, l[ with L being the order of the Ed25519 group.
      Parameters:
      scalarEnc - the encoded scalar to reduce
      Returns:
      the reduced scalar
    • cryptoCoreEd25519ScalarReduce

      BigInteger cryptoCoreEd25519ScalarReduce(byte[] scalar)
      Reduces a possibly larger scalar value to [0, L[ with L being the order of the Ed25519 group.
      Parameters:
      scalar - the scalar to reduce, must be Ed25519.ED25519_NON_REDUCED_SCALAR_BYTES bytes
      Returns:
      the reduced scalar
    • cryptoCoreEd25519ScalarInvert

      BigInteger cryptoCoreEd25519ScalarInvert(BigInteger scalar) throws SodiumException
      Calculates the multiplicative inverse of the given scalar value.
      Parameters:
      scalar - the scalar to invert
      Returns:
      the multiplicative inverse
      Throws:
      SodiumException
    • cryptoCoreEd25519ScalarInvert

      BigInteger cryptoCoreEd25519ScalarInvert(String scalarEnc) throws SodiumException
      Calculates the multiplicative inverse of the given scalar value.
      Parameters:
      scalarEnc - the encoded scalar to invert
      Returns:
      the multiplicative inverse
      Throws:
      SodiumException
    • cryptoCoreEd25519ScalarInvert

      BigInteger cryptoCoreEd25519ScalarInvert(byte[] scalar) throws SodiumException
      Calculates the multiplicative inverse of the given scalar value.
      Parameters:
      scalar - the scalar to invert, must be Ed25519.ED25519_SCALAR_BYTES bytes
      Returns:
      the multiplicative inverse
      Throws:
      SodiumException
    • cryptoCoreEd25519ScalarNegate

      BigInteger cryptoCoreEd25519ScalarNegate(BigInteger scalar)
      Calculates the additive inverse of the given scalar value.
      Parameters:
      scalar - the scalar to negate
      Returns:
      the additive inverse
    • cryptoCoreEd25519ScalarNegate

      BigInteger cryptoCoreEd25519ScalarNegate(String scalarEnc)
      Calculates the additive inverse of the given scalar value.
      Parameters:
      scalarEnc - the encoded scalar to negate
      Returns:
      the additive inverse
    • cryptoCoreEd25519ScalarNegate

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

      BigInteger cryptoCoreEd25519ScalarComplement(BigInteger 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:
      scalar - the scalar to complement
      Returns:
      the complement
    • cryptoCoreEd25519ScalarComplement

      BigInteger cryptoCoreEd25519ScalarComplement(String scalarEnc)
      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:
      scalarEnc - the encoded scalar to complement
      Returns:
      the complement
    • cryptoCoreEd25519ScalarComplement

      BigInteger cryptoCoreEd25519ScalarComplement(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:
      scalar - the scalar to complement, must be Ed25519.ED25519_SCALAR_BYTES bytes
      Returns:
      the complement
    • cryptoCoreEd25519ScalarAdd

      BigInteger cryptoCoreEd25519ScalarAdd(BigInteger x, BigInteger y)
      Adds two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar
      y - the second scalar
      Returns:
      the sum
    • cryptoCoreEd25519ScalarAdd

      BigInteger cryptoCoreEd25519ScalarAdd(BigInteger x, String y)
      Adds two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar
      y - the second scalar (encoded)
      Returns:
      the sum
    • cryptoCoreEd25519ScalarAdd

      BigInteger cryptoCoreEd25519ScalarAdd(String x, BigInteger y)
      Adds two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar (encoded)
      y - the second scalar
      Returns:
      the sum
    • cryptoCoreEd25519ScalarAdd

      BigInteger cryptoCoreEd25519ScalarAdd(String x, String y)
      Adds two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar (encoded)
      y - the second scalar (encoded)
      Returns:
      the sum
    • cryptoCoreEd25519ScalarAdd

      BigInteger cryptoCoreEd25519ScalarAdd(String x, byte[] y)
      Adds two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar (encoded)
      y - the second scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
      Returns:
      the sum
    • cryptoCoreEd25519ScalarAdd

      BigInteger cryptoCoreEd25519ScalarAdd(byte[] x, String y)
      Adds two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
      y - the second scalar (encoded)
      Returns:
      the sum
    • cryptoCoreEd25519ScalarAdd

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

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

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

      BigInteger cryptoCoreEd25519ScalarSub(BigInteger x, BigInteger y)
      Subtracts two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar
      y - the second scalar
      Returns:
      the difference
    • cryptoCoreEd25519ScalarSub

      BigInteger cryptoCoreEd25519ScalarSub(BigInteger x, String y)
      Subtracts two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar
      y - the second scalar (encoded)
      Returns:
      the difference
    • cryptoCoreEd25519ScalarSub

      BigInteger cryptoCoreEd25519ScalarSub(String x, BigInteger y)
      Subtracts two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar (encoded)
      y - the second scalar
      Returns:
      the difference
    • cryptoCoreEd25519ScalarSub

      BigInteger cryptoCoreEd25519ScalarSub(String x, String y)
      Subtracts two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar (encoded)
      y - the second scalar (encoded)
      Returns:
      the difference
    • cryptoCoreEd25519ScalarSub

      BigInteger cryptoCoreEd25519ScalarSub(String x, byte[] y)
      Subtracts two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar (encoded)
      y - the second scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
      Returns:
      the difference
    • cryptoCoreEd25519ScalarSub

      BigInteger cryptoCoreEd25519ScalarSub(byte[] x, String y)
      Subtracts two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
      y - the second scalar (encoded)
      Returns:
      the difference
    • cryptoCoreEd25519ScalarSub

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

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

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

      BigInteger cryptoCoreEd25519ScalarMul(BigInteger x, BigInteger y)
      Multiplies two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar
      y - the second scalar
      Returns:
      the product
    • cryptoCoreEd25519ScalarMul

      BigInteger cryptoCoreEd25519ScalarMul(BigInteger x, String y)
      Multiplies two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar
      y - the second scalar (encoded)
      Returns:
      the product
    • cryptoCoreEd25519ScalarMul

      BigInteger cryptoCoreEd25519ScalarMul(String x, BigInteger y)
      Multiplies two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar (encoded)
      y - the second scalar
      Returns:
      the product
    • cryptoCoreEd25519ScalarMul

      BigInteger cryptoCoreEd25519ScalarMul(String x, String y)
      Multiplies two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar (encoded)
      y - the second scalar (encoded)
      Returns:
      the product
    • cryptoCoreEd25519ScalarMul

      BigInteger cryptoCoreEd25519ScalarMul(String x, byte[] y)
      Multiplies two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar (encoded)
      y - the second scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
      Returns:
      the product
    • cryptoCoreEd25519ScalarMul

      BigInteger cryptoCoreEd25519ScalarMul(byte[] x, String y)
      Multiplies two scalars x and y modulo L with L being the order of the Ed25519 group.
      Parameters:
      x - the first scalar, must be Ed25519.ED25519_SCALAR_BYTES bytes
      y - the second scalar (encoded)
      Returns:
      the product
    • cryptoCoreEd25519ScalarMul

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

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

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