class Ed25519::RistrettoPoint
- Ed25519::RistrettoPoint
- Reference
- Object
Overview
** Each ed25519/ExtendedPoint has 8 different equivalent points. This can be a source of bugs for protocols like ring signatures. Ristretto was created to solve this. Ristretto point operates in X:Y:Z:T extended coordinates like ExtendedPoint, but it should work in its own namespace: do not combine those two. https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448 /
Defined in:
ed25519/ristretto_point.crConstant Summary
-
BASE =
RistrettoPoint.new(ExtendedPoint::BASE)
-
ZERO =
RistrettoPoint.new(ExtendedPoint::ZERO)
Constructors
-
.from_hex(hex : Hex) : RistrettoPoint
** Converts ristretto-encoded string to ristretto point.
-
.hash_to_curve(hex : Hex) : RistrettoPoint
** Takes uniform output of 64-bit hash function like sha512 and converts it to
RistrettoPoint
. -
.new(ep : ExtendedPoint)
Private property to discourage combining ExtendedPoint + RistrettoPoint Always use Ristretto encoding/decoding instead.
Instance Method Summary
- #==(other : RistrettoPoint) : Bool
- #add(other : RistrettoPoint) : RistrettoPoint
- #ep : ExtendedPoint
- #ep=(ep : ExtendedPoint)
-
#equals(other : RistrettoPoint) : Bool
Compare one point to another.
- #multiply(scalar : Int) : RistrettoPoint
- #multiply_unsafe(scalar : Int) : RistrettoPoint
- #subtract(other : RistrettoPoint) : RistrettoPoint
- #to_hex : String
-
#to_raw_bytes : Bytes
** Encodes ristretto point to Bytes.
- #to_string : String
Constructor Detail
** Converts ristretto-encoded string to ristretto point. https://ristretto.group/formulas/decoding.html @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding /
**
Takes uniform output of 64-bit hash function like sha512 and converts it to RistrettoPoint
.
The hash-to-group operation applies Elligator twice and adds the results.
Note: this is one-way map, there is no conversion from point to hash.
https://ristretto.group/formulas/elligator.html
@param hex 64-bit output of a hash function
/
Private property to discourage combining ExtendedPoint + RistrettoPoint Always use Ristretto encoding/decoding instead.
Instance Method Detail
** Encodes ristretto point to Bytes. https ://ristretto.group/formulas/encoding.html /