Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/earthstar/deps.ts>ed.RistrettoPoint

Earthstar is a tool for private, undiscoverable, offline-first networks.
Go to Latest
class ed.RistrettoPoint
import { ed } from "https://deno.land/x/earthstar@v10.0.0/deps.ts";
const { RistrettoPoint } = ed;

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

Constructors

new
RistrettoPoint(ep: ExtendedPoint)

Methods

equals(other: RistrettoPoint): boolean
multiply(scalar: number | bigint): RistrettoPoint
multiplyUnsafe(scalar: number | bigint): RistrettoPoint
toHex(): string
toRawBytes(): Uint8Array

Encodes ristretto point to Uint8Array. https://ristretto.group/formulas/encoding.html

toString(): string

Static Methods

Converts ristretto-encoded string to ristretto point. https://ristretto.group/formulas/decoding.html

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