Interface Ristretto255.Native
- All Known Implementing Classes:
LazySodium,LazySodiumJava
- Enclosing interface:
- Ristretto255
public static interface Ristretto255.Native
-
Method Summary
Modifier and TypeMethodDescriptionbooleancryptoCoreRistretto255Add(byte[] result, byte[] p, byte[] q) Adds two given Ristretto255 pointspandqand puts the representation of the result intoresult.booleancryptoCoreRistretto255FromHash(byte[] point, byte[] hash) Maps aRistretto255.RISTRETTO255_HASH_BYTESbytes hash to a Ristretto255 point and puts its representation topoint.booleancryptoCoreRistretto255IsValidPoint(byte[] point) Returns whether the passed bytes represent a valid Ristretto255 point.voidcryptoCoreRistretto255Random(byte[] point) Chooses a random Ristretto255 point and puts its representation topointvoidcryptoCoreRistretto255ScalarAdd(byte[] result, byte[] x, byte[] y) Adds two scalarsxandymoduloLwithLbeing the order of the Ristretto255 group.voidcryptoCoreRistretto255ScalarComplement(byte[] result, byte[] scalar) Calculates the result R for the given scalar value such thatR + scalar = 1 (mod L)withLbeing the order of the Ristretto255 group.booleancryptoCoreRistretto255ScalarInvert(byte[] result, byte[] scalar) Calculates the multiplicative inverse of the given scalar value.voidcryptoCoreRistretto255ScalarMul(byte[] result, byte[] x, byte[] y) Multiplies two scalarsxandymoduloLwithLbeing the order of the Ristretto255 group.voidcryptoCoreRistretto255ScalarNegate(byte[] result, byte[] scalar) Calculates the additive inverse of the given scalar value.voidcryptoCoreRistretto255ScalarRandom(byte[] scalar) Creates a random scalar value in[0, l[withLbeing the order of the Ristretto255 group.voidcryptoCoreRistretto255ScalarReduce(byte[] result, byte[] scalar) Reduces a possibly larger scalar value to[0, l[withLbeing the order of the Ristretto255 group.voidcryptoCoreRistretto255ScalarSub(byte[] result, byte[] x, byte[] y) Subtracts two scalarsxandymoduloLwithLbeing the order of the Ristretto255 group.booleancryptoCoreRistretto255Sub(byte[] result, byte[] p, byte[] q) Subtracts two given Ristretto255 pointspandqand puts the representation of the result intoresult.booleancryptoScalarmultRistretto255(byte[] result, byte[] n, byte[] point) Multiplies the given Ristretto255pointby the scalarnand puts the representation of the result intoresult.booleancryptoScalarmultRistretto255Base(byte[] result, byte[] n) Multiplies the Ristretto255 base point by the scalarnand puts the representation of the result intoresult.
-
Method Details
-
cryptoCoreRistretto255IsValidPoint
boolean cryptoCoreRistretto255IsValidPoint(byte[] point) Returns whether the passed bytes represent a valid Ristretto255 point.- Parameters:
point- the point to check, should beRistretto255.RISTRETTO255_BYTESbytes- Returns:
- true if valid
-
cryptoCoreRistretto255Random
void cryptoCoreRistretto255Random(byte[] point) Chooses a random Ristretto255 point and puts its representation topoint- Parameters:
point- the target array, must beRistretto255.RISTRETTO255_BYTESbytes
-
cryptoCoreRistretto255FromHash
boolean cryptoCoreRistretto255FromHash(byte[] point, byte[] hash) Maps aRistretto255.RISTRETTO255_HASH_BYTESbytes hash to a Ristretto255 point and puts its representation topoint.- Parameters:
point- the target array, must beRistretto255.RISTRETTO255_BYTESbyteshash- the hash, must beRistretto255.RISTRETTO255_HASH_BYTESbytes- Returns:
- true if successful
-
cryptoScalarmultRistretto255
boolean cryptoScalarmultRistretto255(byte[] result, byte[] n, byte[] point) Multiplies the given Ristretto255pointby the scalarnand puts the representation of the result intoresult.- Parameters:
result- the target array, must beRistretto255.RISTRETTO255_BYTESbytesn- the scalar, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytespoint- the Ristretto255 point, must beRistretto255.RISTRETTO255_BYTESbytes- Returns:
- true if successful
-
cryptoScalarmultRistretto255Base
boolean cryptoScalarmultRistretto255Base(byte[] result, byte[] n) Multiplies the Ristretto255 base point by the scalarnand puts the representation of the result intoresult.- Parameters:
result- the target array, must beRistretto255.RISTRETTO255_BYTESbytesn- the scalar, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytes- Returns:
- true if successful
-
cryptoCoreRistretto255Add
boolean cryptoCoreRistretto255Add(byte[] result, byte[] p, byte[] q) Adds two given Ristretto255 pointspandqand puts the representation of the result intoresult.- Parameters:
result- the target array, must beRistretto255.RISTRETTO255_BYTESbytesp- the first Ristretto255 point, must beRistretto255.RISTRETTO255_BYTESbytesq- the second Ristretto255 point, must beRistretto255.RISTRETTO255_BYTESbytes- Returns:
- true if successful
-
cryptoCoreRistretto255Sub
boolean cryptoCoreRistretto255Sub(byte[] result, byte[] p, byte[] q) Subtracts two given Ristretto255 pointspandqand puts the representation of the result intoresult.- Parameters:
result- the target array, must beRistretto255.RISTRETTO255_BYTESbytesp- the first Ristretto255 point, must beRistretto255.RISTRETTO255_BYTESbytesq- the second Ristretto255 point, must beRistretto255.RISTRETTO255_BYTESbytes- Returns:
- true if successful
-
cryptoCoreRistretto255ScalarRandom
void cryptoCoreRistretto255ScalarRandom(byte[] scalar) Creates a random scalar value in[0, l[withLbeing the order of the Ristretto255 group.- Parameters:
scalar- the target array, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytes
-
cryptoCoreRistretto255ScalarReduce
void cryptoCoreRistretto255ScalarReduce(byte[] result, byte[] scalar) Reduces a possibly larger scalar value to[0, l[withLbeing the order of the Ristretto255 group.- Parameters:
result- the target array, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytesscalar- the scalar to reduce, must beRistretto255.RISTRETTO255_NON_REDUCED_SCALAR_BYTESbytes
-
cryptoCoreRistretto255ScalarInvert
boolean cryptoCoreRistretto255ScalarInvert(byte[] result, byte[] scalar) Calculates the multiplicative inverse of the given scalar value.- Parameters:
result- the target array, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytesscalar- the scalar to invert, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytes- Returns:
- true if successful
-
cryptoCoreRistretto255ScalarNegate
void cryptoCoreRistretto255ScalarNegate(byte[] result, byte[] scalar) Calculates the additive inverse of the given scalar value.- Parameters:
result- the target array, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytesscalar- the scalar to negate, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytes
-
cryptoCoreRistretto255ScalarComplement
void cryptoCoreRistretto255ScalarComplement(byte[] result, byte[] scalar) Calculates the result R for the given scalar value such thatR + scalar = 1 (mod L)withLbeing the order of the Ristretto255 group.- Parameters:
result- the target array, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytesscalar- the scalar to complement, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytes
-
cryptoCoreRistretto255ScalarAdd
void cryptoCoreRistretto255ScalarAdd(byte[] result, byte[] x, byte[] y) Adds two scalarsxandymoduloLwithLbeing the order of the Ristretto255 group.- Parameters:
result- the target array, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytesx- the first scalar, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytesy- the second scalar, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytes
-
cryptoCoreRistretto255ScalarSub
void cryptoCoreRistretto255ScalarSub(byte[] result, byte[] x, byte[] y) Subtracts two scalarsxandymoduloLwithLbeing the order of the Ristretto255 group.- Parameters:
result- the target array, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytesx- the first scalar, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytesy- the second scalar, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytes
-
cryptoCoreRistretto255ScalarMul
void cryptoCoreRistretto255ScalarMul(byte[] result, byte[] x, byte[] y) Multiplies two scalarsxandymoduloLwithLbeing the order of the Ristretto255 group.- Parameters:
result- the target array, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytesx- the first scalar, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytesy- the second scalar, must beRistretto255.RISTRETTO255_SCALAR_BYTESbytes
-