Skip to main content
Module

x/earthstar/deps.ts>ed

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

Classes

Extended Point works in extended coordinates: (x, y, z, t) ∋ (x=x/z, y=y/z, t=xy). Default Point works in affine coordinates: (x, y) https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates

Default Point works in affine coordinates: (x, y)

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

Variables

ed25519 is Twisted Edwards curve with equation of

Functions

Calculates ed25519 public key.

  1. private key is hashed with sha512, then first 32 bytes are taken from the hash
  2. 3 least significant bits of the first byte are cleared RFC8032 5.1.5

Signs message with privateKey. RFC8032 5.1.6

Verifies ed25519 signature against message and public key. An extended group equation is checked. RFC8032 5.1.7 Compliant with ZIP215: 0 <= sig.R/publicKey < 2**256 (can be >= curve.P) 0 <= sig.s < l Not compliant with RFC8032: it's not possible to comply to both ZIP & RFC at the same time.