Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/earthstar/deps.ts>ed.Point

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

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

Constructors

new
Point(x: bigint, y: bigint)

Properties

optional
_WINDOW_SIZE: number

Methods

_setWindowSize(windowSize: number)
add(other: Point)
equals(other: Point): boolean
isTorsionFree(): boolean
multiply(scalar: number | bigint): Point

Constant time multiplication.

subtract(other: Point)
toHex(): string
toRawBytes(): Uint8Array
toX25519(): Uint8Array

Converts to Montgomery; aka x coordinate of curve25519. We don't have fromX25519, because we don't know sign.

u, v: curve25519 coordinates
x, y: ed25519 coordinates
(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)
(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))

https://blog.filippo.io/using-ed25519-keys-for-encryption

Static Methods

fromHex(hex: Hex, strict?)
fromPrivateKey(privateKey: PrivKey)