-
- All Implemented Interfaces:
public final class RistrettoElementAn element of the prime-order ristretto255 group.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classRistrettoElement.Companion
-
Method Summary
Modifier and Type Method Description final CompressedRistrettocompress()Compress this element using the Ristretto encoding. final BooleanctEquals(RistrettoElement other)Constant-time equality check. final RistrettoElementctSelect(RistrettoElement that, Integer b)Constant-time selection between two RistrettoElements. final RistrettoElementctSelect(RistrettoElement that, Boolean b)Booleanequals(Object other)Equality check overridden to be constant-time. IntegerhashCode()final RistrettoElementadd(RistrettoElement q)Group addition. final RistrettoElementsubtract(RistrettoElement q)Group subtraction. final RistrettoElementnegate()Element negation. final RistrettoElementdouble()Element doubling. final RistrettoElementmultiply(Scalar s)Constant-time variable-base scalar multiplication. StringtoString()-
-
Method Detail
-
compress
final CompressedRistretto compress()
Compress this element using the Ristretto encoding.
This is the ristretto255 ENCODE function.
-
ctEquals
final Boolean ctEquals(RistrettoElement other)
Constant-time equality check.
This is the ristretto255 EQUALS function.
-
ctSelect
final RistrettoElement ctSelect(RistrettoElement that, Integer b)
Constant-time selection between two RistrettoElements.
- Parameters:
that- the other element.b- must be 0 or 1, otherwise results are undefined.
-
ctSelect
final RistrettoElement ctSelect(RistrettoElement that, Boolean b)
-
equals
Boolean equals(Object other)
Equality check overridden to be constant-time.
Fails fast if the objects are of different types.
-
add
final RistrettoElement add(RistrettoElement q)
Group addition.
- Parameters:
q- the element to add to this one.
-
subtract
final RistrettoElement subtract(RistrettoElement q)
Group subtraction.
-
negate
final RistrettoElement negate()
Element negation.
-
double
final RistrettoElement double()
Element doubling.
-
multiply
final RistrettoElement multiply(Scalar s)
Constant-time variable-base scalar multiplication.
- Parameters:
s- the Scalar to multiply by.
-
-
-
-