-
public interface Ristretto255.Native
-
-
Method Summary
Modifier and Type Method Description abstract booleancryptoCoreRistretto255IsValidPoint(Array<byte> point)Returns whether the passed bytes represent a valid Ristretto255 point. abstract voidcryptoCoreRistretto255Random(Array<byte> point)Chooses a random Ristretto255 point and puts its representation to {@code point}abstract booleancryptoCoreRistretto255FromHash(Array<byte> point, Array<byte> hash)Maps a RISTRETTO255_HASH_BYTES bytes hash to a Ristretto255 pointand puts its representation to {@code point}.abstract booleancryptoScalarmultRistretto255(Array<byte> result, Array<byte> n, Array<byte> point)Multiplies the given Ristretto255 {@code point}by the scalar{@code n}and puts therepresentation of the result into{@code result}.abstract booleancryptoScalarmultRistretto255Base(Array<byte> result, Array<byte> n)Multiplies the Ristretto255 base point by the scalar {@code n}and puts therepresentation of the result into{@code result}.abstract booleancryptoCoreRistretto255Add(Array<byte> result, Array<byte> p, Array<byte> q)Adds two given Ristretto255 points {@code p}and{@code q}and puts the representation ofthe result into{@code result}.abstract booleancryptoCoreRistretto255Sub(Array<byte> result, Array<byte> p, Array<byte> q)Subtracts two given Ristretto255 points {@code p}and{@code q}and puts therepresentation of the result into{@code result}.abstract voidcryptoCoreRistretto255ScalarRandom(Array<byte> scalar)Creates a random scalar value in {@code [0, l[}with{@code L}being the order of theRistretto255 group.abstract voidcryptoCoreRistretto255ScalarReduce(Array<byte> result, Array<byte> scalar)Reduces a possibly larger scalar value to {@code [0, l[}with{@code L}being the orderof the Ristretto255 group.abstract booleancryptoCoreRistretto255ScalarInvert(Array<byte> result, Array<byte> scalar)Calculates the multiplicative inverse of the given scalar value. abstract voidcryptoCoreRistretto255ScalarNegate(Array<byte> result, Array<byte> scalar)Calculates the additive inverse of the given scalar value. abstract voidcryptoCoreRistretto255ScalarComplement(Array<byte> result, Array<byte> scalar)Calculates the result R for the given scalar value such that {@code R + scalar = 1 (mod * L)}with{@code L}being the order of the Ristretto255 group.abstract voidcryptoCoreRistretto255ScalarAdd(Array<byte> result, Array<byte> x, Array<byte> y)Adds two scalars {@code x}and{@code y}modulo{@code L}with{@code L}being the orderof the Ristretto255 group.abstract voidcryptoCoreRistretto255ScalarSub(Array<byte> result, Array<byte> x, Array<byte> y)Subtracts two scalars {@code x}and{@code y}modulo{@code L}with{@code L}being theorder of the Ristretto255 group.abstract voidcryptoCoreRistretto255ScalarMul(Array<byte> result, Array<byte> x, Array<byte> y)Multiplies two scalars {@code x}and{@code y}modulo{@code L}with{@code L}being theorder of the Ristretto255 group.-
-
Method Detail
-
cryptoCoreRistretto255IsValidPoint
abstract boolean cryptoCoreRistretto255IsValidPoint(Array<byte> point)
Returns whether the passed bytes represent a valid Ristretto255 point.
- Parameters:
point- the point to check, should be RISTRETTO255_BYTES bytes
-
cryptoCoreRistretto255Random
abstract void cryptoCoreRistretto255Random(Array<byte> point)
Chooses a random Ristretto255 point and puts its representation to
{@code point}- Parameters:
point- the target array, must be RISTRETTO255_BYTES bytes
-
cryptoCoreRistretto255FromHash
abstract boolean cryptoCoreRistretto255FromHash(Array<byte> point, Array<byte> hash)
Maps a RISTRETTO255_HASH_BYTES bytes hash to a Ristretto255 pointand puts its representation to
{@code point}.- Parameters:
point- the target array, must be RISTRETTO255_BYTES byteshash- the hash, must be RISTRETTO255_HASH_BYTES bytes
-
cryptoScalarmultRistretto255
abstract boolean cryptoScalarmultRistretto255(Array<byte> result, Array<byte> n, Array<byte> point)
Multiplies the given Ristretto255
{@code point}by the scalar{@code n}and puts therepresentation of the result into{@code result}.- Parameters:
result- the target array, must be RISTRETTO255_BYTES bytesn- the scalar, must be RISTRETTO255_SCALAR_BYTES bytespoint- the Ristretto255 point, must be RISTRETTO255_BYTES bytes
-
cryptoScalarmultRistretto255Base
abstract boolean cryptoScalarmultRistretto255Base(Array<byte> result, Array<byte> n)
Multiplies the Ristretto255 base point by the scalar
{@code n}and puts therepresentation of the result into{@code result}.- Parameters:
result- the target array, must be RISTRETTO255_BYTES bytesn- the scalar, must be RISTRETTO255_SCALAR_BYTES bytes
-
cryptoCoreRistretto255Add
abstract boolean cryptoCoreRistretto255Add(Array<byte> result, Array<byte> p, Array<byte> q)
Adds two given Ristretto255 points
{@code p}and{@code q}and puts the representation ofthe result into{@code result}.- Parameters:
result- the target array, must be RISTRETTO255_BYTES bytesp- the first Ristretto255 point, must be RISTRETTO255_BYTES bytesq- the second Ristretto255 point, must be RISTRETTO255_BYTES bytes
-
cryptoCoreRistretto255Sub
abstract boolean cryptoCoreRistretto255Sub(Array<byte> result, Array<byte> p, Array<byte> q)
Subtracts two given Ristretto255 points
{@code p}and{@code q}and puts therepresentation of the result into{@code result}.- Parameters:
result- the target array, must be RISTRETTO255_BYTES bytesp- the first Ristretto255 point, must be RISTRETTO255_BYTES bytesq- the second Ristretto255 point, must be RISTRETTO255_BYTES bytes
-
cryptoCoreRistretto255ScalarRandom
abstract void cryptoCoreRistretto255ScalarRandom(Array<byte> scalar)
Creates a random scalar value in
{@code [0, l[}with{@code L}being the order of theRistretto255 group.- Parameters:
scalar- the target array, must be RISTRETTO255_SCALAR_BYTES bytes
-
cryptoCoreRistretto255ScalarReduce
abstract void cryptoCoreRistretto255ScalarReduce(Array<byte> result, Array<byte> scalar)
Reduces a possibly larger scalar value to
{@code [0, l[}with{@code L}being the orderof the Ristretto255 group.- Parameters:
result- the target array, must be RISTRETTO255_SCALAR_BYTES bytesscalar- the scalar to reduce, must be RISTRETTO255_NON_REDUCED_SCALAR_BYTES bytes
-
cryptoCoreRistretto255ScalarInvert
abstract boolean cryptoCoreRistretto255ScalarInvert(Array<byte> result, Array<byte> scalar)
Calculates the multiplicative inverse of the given scalar value.
- Parameters:
result- the target array, must be RISTRETTO255_SCALAR_BYTES bytesscalar- the scalar to invert, must be RISTRETTO255_SCALAR_BYTES bytes
-
cryptoCoreRistretto255ScalarNegate
abstract void cryptoCoreRistretto255ScalarNegate(Array<byte> result, Array<byte> scalar)
Calculates the additive inverse of the given scalar value.
- Parameters:
result- the target array, must be RISTRETTO255_SCALAR_BYTES bytesscalar- the scalar to negate, must be RISTRETTO255_SCALAR_BYTES bytes
-
cryptoCoreRistretto255ScalarComplement
abstract void cryptoCoreRistretto255ScalarComplement(Array<byte> result, Array<byte> scalar)
Calculates the result R for the given scalar value such that
{@code R + scalar = 1 (mod * L)}with{@code L}being the order of the Ristretto255 group.- Parameters:
result- the target array, must be RISTRETTO255_SCALAR_BYTES bytesscalar- the scalar to complement, must be RISTRETTO255_SCALAR_BYTES bytes
-
cryptoCoreRistretto255ScalarAdd
abstract void cryptoCoreRistretto255ScalarAdd(Array<byte> result, Array<byte> x, Array<byte> y)
Adds two scalars
{@code x}and{@code y}modulo{@code L}with{@code L}being the orderof the Ristretto255 group.- Parameters:
result- the target array, must be RISTRETTO255_SCALAR_BYTES bytesx- the first scalar, must be RISTRETTO255_SCALAR_BYTES bytesy- the second scalar, must be RISTRETTO255_SCALAR_BYTES bytes
-
cryptoCoreRistretto255ScalarSub
abstract void cryptoCoreRistretto255ScalarSub(Array<byte> result, Array<byte> x, Array<byte> y)
Subtracts two scalars
{@code x}and{@code y}modulo{@code L}with{@code L}being theorder of the Ristretto255 group.- Parameters:
result- the target array, must be RISTRETTO255_SCALAR_BYTES bytesx- the first scalar, must be RISTRETTO255_SCALAR_BYTES bytesy- the second scalar, must be RISTRETTO255_SCALAR_BYTES bytes
-
cryptoCoreRistretto255ScalarMul
abstract void cryptoCoreRistretto255ScalarMul(Array<byte> result, Array<byte> x, Array<byte> y)
Multiplies two scalars
{@code x}and{@code y}modulo{@code L}with{@code L}being theorder of the Ristretto255 group.- Parameters:
result- the target array, must be RISTRETTO255_SCALAR_BYTES bytesx- the first scalar, must be RISTRETTO255_SCALAR_BYTES bytesy- the second scalar, must be RISTRETTO255_SCALAR_BYTES bytes
-
-
-
-