Package com.goterl.lazysodium.interfaces
Interface Ed25519.Native
- All Known Implementing Classes:
LazySodium,LazySodiumAndroid,LazySodiumJava
- Enclosing interface:
Ed25519
public static interface Ed25519.Native
-
Method Summary
Modifier and TypeMethodDescriptionbooleancryptoCoreEd25519Add(byte[] result, byte[] p, byte[] q) Adds two given Ed25519 pointspandqand puts the representation of the result intoresult.booleancryptoCoreEd25519FromUniform(byte[] point, byte[] hash) Maps aEd25519.ED25519_HASH_BYTESbytes hash to a Ed25519 point and puts its representation topoint.booleancryptoCoreEd25519IsValidPoint(byte[] point) Returns whether the passed bytes represent a valid Ed25519 point.voidcryptoCoreEd25519Random(byte[] point) Chooses a random Ed25519 point and puts its representation topointvoidcryptoCoreEd25519ScalarAdd(byte[] result, byte[] x, byte[] y) Adds two scalarsxandymoduloLwithLbeing the order of the Ed25519 group.voidcryptoCoreEd25519ScalarComplement(byte[] result, byte[] scalar) Calculates the result R for the given scalar value such thatR + scalar = 1 (mod L)withLbeing the order of the Ed25519 group.booleancryptoCoreEd25519ScalarInvert(byte[] result, byte[] scalar) Calculates the multiplicative inverse of the given scalar value.voidcryptoCoreEd25519ScalarMul(byte[] result, byte[] x, byte[] y) Multiplies two scalarsxandymoduloLwithLbeing the order of the Ed25519 group.voidcryptoCoreEd25519ScalarNegate(byte[] result, byte[] scalar) Calculates the additive inverse of the given scalar value.voidcryptoCoreEd25519ScalarRandom(byte[] scalar) Creates a random scalar value in[0, l[withLbeing the order of the Ed25519 group.voidcryptoCoreEd25519ScalarReduce(byte[] result, byte[] scalar) Reduces a possibly larger scalar value to[0, l[withLbeing the order of the Ed25519 group.voidcryptoCoreEd25519ScalarSub(byte[] result, byte[] x, byte[] y) Subtracts two scalarsxandymoduloLwithLbeing the order of the Ed25519 group.booleancryptoCoreEd25519Sub(byte[] result, byte[] p, byte[] q) Subtracts two given Ed25519 pointspandqand puts the representation of the result intoresult.booleancryptoScalarMultEd25519BaseNoclamp(byte[] result, byte[] n) Multiplies the Ed25519 base point by the scalarnand puts the representation of the result intoresult.booleancryptoScalarMultEd25519Noclamp(byte[] result, byte[] n, byte[] point) Multiplies the given Ed25519pointby the scalarnand puts the representation of the result intoresult.
-
Method Details
-
cryptoCoreEd25519IsValidPoint
boolean cryptoCoreEd25519IsValidPoint(byte[] point) Returns whether the passed bytes represent a valid Ed25519 point.- Parameters:
point- the point to check, should beEd25519.ED25519_BYTESbytes- Returns:
- true if valid
-
cryptoCoreEd25519Random
void cryptoCoreEd25519Random(byte[] point) Chooses a random Ed25519 point and puts its representation topoint- Parameters:
point- the target array, must beEd25519.ED25519_BYTESbytes
-
cryptoCoreEd25519FromUniform
boolean cryptoCoreEd25519FromUniform(byte[] point, byte[] hash) Maps aEd25519.ED25519_HASH_BYTESbytes hash to a Ed25519 point and puts its representation topoint.- Parameters:
point- the target array, must beEd25519.ED25519_BYTESbyteshash- the hash, must beEd25519.ED25519_HASH_BYTESbytes- Returns:
- true if successful
-
cryptoScalarMultEd25519Noclamp
boolean cryptoScalarMultEd25519Noclamp(byte[] result, byte[] n, byte[] point) Multiplies the given Ed25519pointby the scalarnand puts the representation of the result intoresult.- Parameters:
result- the target array, must beEd25519.ED25519_BYTESbytesn- the scalar, must beEd25519.ED25519_SCALAR_BYTESbytespoint- the Ed25519 point, must beEd25519.ED25519_BYTESbytes- Returns:
- true if successful
-
cryptoScalarMultEd25519BaseNoclamp
boolean cryptoScalarMultEd25519BaseNoclamp(byte[] result, byte[] n) Multiplies the Ed25519 base point by the scalarnand puts the representation of the result intoresult.- Parameters:
result- the target array, must beEd25519.ED25519_BYTESbytesn- the scalar, must beEd25519.ED25519_SCALAR_BYTESbytes- Returns:
- true if successful
-
cryptoCoreEd25519Add
boolean cryptoCoreEd25519Add(byte[] result, byte[] p, byte[] q) Adds two given Ed25519 pointspandqand puts the representation of the result intoresult.- Parameters:
result- the target array, must beEd25519.ED25519_BYTESbytesp- the first Ed25519 point, must beEd25519.ED25519_BYTESbytesq- the second Ed25519 point, must beEd25519.ED25519_BYTESbytes- Returns:
- true if successful
-
cryptoCoreEd25519Sub
boolean cryptoCoreEd25519Sub(byte[] result, byte[] p, byte[] q) Subtracts two given Ed25519 pointspandqand puts the representation of the result intoresult.- Parameters:
result- the target array, must beEd25519.ED25519_BYTESbytesp- the first Ed25519 point, must beEd25519.ED25519_BYTESbytesq- the second Ed25519 point, must beEd25519.ED25519_BYTESbytes- Returns:
- true if successful
-
cryptoCoreEd25519ScalarRandom
void cryptoCoreEd25519ScalarRandom(byte[] scalar) Creates a random scalar value in[0, l[withLbeing the order of the Ed25519 group.- Parameters:
scalar- the target array, must beEd25519.ED25519_SCALAR_BYTESbytes
-
cryptoCoreEd25519ScalarReduce
void cryptoCoreEd25519ScalarReduce(byte[] result, byte[] scalar) Reduces a possibly larger scalar value to[0, l[withLbeing the order of the Ed25519 group.- Parameters:
result- the target array, must beEd25519.ED25519_SCALAR_BYTESbytesscalar- the scalar to reduce, must beEd25519.ED25519_NON_REDUCED_SCALAR_BYTESbytes
-
cryptoCoreEd25519ScalarInvert
boolean cryptoCoreEd25519ScalarInvert(byte[] result, byte[] scalar) Calculates the multiplicative inverse of the given scalar value.- Parameters:
result- the target array, must beEd25519.ED25519_SCALAR_BYTESbytesscalar- the scalar to invert, must beEd25519.ED25519_SCALAR_BYTESbytes- 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 beEd25519.ED25519_SCALAR_BYTESbytesscalar- the scalar to negate, must beEd25519.ED25519_SCALAR_BYTESbytes
-
cryptoCoreEd25519ScalarComplement
void cryptoCoreEd25519ScalarComplement(byte[] result, byte[] scalar) Calculates the result R for the given scalar value such thatR + scalar = 1 (mod L)withLbeing the order of the Ed25519 group.- Parameters:
result- the target array, must beEd25519.ED25519_SCALAR_BYTESbytesscalar- the scalar to complement, must beEd25519.ED25519_SCALAR_BYTESbytes
-
cryptoCoreEd25519ScalarAdd
void cryptoCoreEd25519ScalarAdd(byte[] result, byte[] x, byte[] y) Adds two scalarsxandymoduloLwithLbeing the order of the Ed25519 group.- Parameters:
result- the target array, must beEd25519.ED25519_SCALAR_BYTESbytesx- the first scalar, must beEd25519.ED25519_SCALAR_BYTESbytesy- the second scalar, must beEd25519.ED25519_SCALAR_BYTESbytes
-
cryptoCoreEd25519ScalarSub
void cryptoCoreEd25519ScalarSub(byte[] result, byte[] x, byte[] y) Subtracts two scalarsxandymoduloLwithLbeing the order of the Ed25519 group.- Parameters:
result- the target array, must beEd25519.ED25519_SCALAR_BYTESbytesx- the first scalar, must beEd25519.ED25519_SCALAR_BYTESbytesy- the second scalar, must beEd25519.ED25519_SCALAR_BYTESbytes
-
cryptoCoreEd25519ScalarMul
void cryptoCoreEd25519ScalarMul(byte[] result, byte[] x, byte[] y) Multiplies two scalarsxandymoduloLwithLbeing the order of the Ed25519 group.- Parameters:
result- the target array, must beEd25519.ED25519_SCALAR_BYTESbytesx- the first scalar, must beEd25519.ED25519_SCALAR_BYTESbytesy- the second scalar, must beEd25519.ED25519_SCALAR_BYTESbytes
-