Sign In

@noble/curves

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@noble/curves - npm Package Compare versions

Comparing version
2.2.0
to
2.3.0
+96
abstract/der.d.ts
/**
* ASN.1 DER (Distinguished Encoding Rules) helpers for ECDSA signatures.
* Only implements the tiny subset needed for `SEQUENCE(INTEGER r, INTEGER s)`.
* @module
*/
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { type TArg, type TRet } from '../utils.ts';
/**
* @param m - Error message.
* @example
* Throw a DER-specific error when signature parsing encounters invalid bytes.
*
* ```ts
* new DERErr('bad der');
* ```
*/
export declare class DERErr extends Error {
constructor(m?: string);
}
/** DER helper namespace used by ECDSA signature parsing and encoding. */
export type IDER = {
/**
* DER-specific error constructor.
* @param m - Error message.
* @returns DER-specific error instance.
*/
Err: typeof DERErr;
/** Low-level tag-length-value helpers used by DER encoders. */
_tlv: {
/**
* Encode one TLV record.
* @param tag - ASN.1 tag byte.
* @param data - Hex-encoded value payload.
* @returns Encoded TLV string.
*/
encode: (tag: number, data: string) => string;
/**
* Decode one TLV record and return the value plus leftover bytes.
* @param tag - Expected ASN.1 tag byte.
* @param data - Remaining DER bytes.
* @returns Parsed value plus leftover bytes.
*/
decode(tag: number, data: TArg<Uint8Array>): TRet<{
v: Uint8Array;
l: Uint8Array;
}>;
};
/** Positive-integer DER helpers used by ECDSA signature encoding. */
_int: {
/**
* Encode one positive bigint as a DER INTEGER.
* @param num - Positive integer to encode.
* @returns Encoded DER INTEGER.
*/
encode(num: bigint): string;
/**
* Decode one DER INTEGER into a bigint.
* @param data - DER INTEGER bytes.
* @returns Decoded bigint.
*/
decode(data: TArg<Uint8Array>): bigint;
};
/**
* Parse a DER signature into `{ r, s }`.
* @param bytes - DER signature bytes.
* @returns Parsed signature components.
*/
toSig(bytes: TArg<Uint8Array>): {
r: bigint;
s: bigint;
};
/**
* Encode `{ r, s }` as a DER signature.
* @param sig - Signature components.
* @returns DER-encoded signature hex.
*/
hexFromSig(sig: {
r: bigint;
s: bigint;
}): string;
};
/**
* ASN.1 DER encoding utilities. ASN is very complex & fragile. Format:
*
* [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S]
*
* Docs: {@link https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/ | Let's Encrypt ASN.1 guide} and
* {@link https://luca.ntop.org/Teaching/Appunti/asn1.html | Luca Deri's ASN.1 notes}.
* @example
* ASN.1 DER encoding utilities.
*
* ```ts
* const der = DER.hexFromSig({ r: 1n, s: 2n });
* ```
*/
export declare const DER: IDER;
/**
* ASN.1 DER (Distinguished Encoding Rules) helpers for ECDSA signatures.
* Only implements the tiny subset needed for `SEQUENCE(INTEGER r, INTEGER s)`.
* @module
*/
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { abignumber, abytes, asafenumber, astring, bytesToNumberBE, numberToHexUnpadded, validateObject, } from "../utils.js";
const _0n = /* @__PURE__ */ BigInt(0);
/**
* @param m - Error message.
* @example
* Throw a DER-specific error when signature parsing encounters invalid bytes.
*
* ```ts
* new DERErr('bad der');
* ```
*/
export class DERErr extends Error {
constructor(m = '') {
super(m);
}
}
// Plain const so the freezes can live inside the pure initializer of the `DER` export below:
// bare top-level `Object.freeze(...)` calls would defeat tree-shaking for every importer.
const _DER = {
// asn.1 DER encoding utils
Err: DERErr,
// Basic building block is TLV (Tag-Length-Value)
_tlv: {
encode: (tag, data) => {
const { Err: E } = _DER;
asafenumber(tag, 'tag');
if (tag < 0 || tag > 255)
throw new E('tlv.encode: wrong tag');
astring(data, 'data');
// Internal helper: callers hand this already-validated hex payload, so we only enforce
// byte alignment here instead of re-validating every nibble.
if (data.length & 1)
throw new E('tlv.encode: unpadded data');
const dataLen = data.length / 2;
const len = numberToHexUnpadded(dataLen);
if ((len.length / 2) & 0b1000_0000)
throw new E('tlv.encode: long form length too big');
// length of length with long form flag
const lenLen = dataLen > 127 ? numberToHexUnpadded((len.length / 2) | 0b1000_0000) : '';
const t = numberToHexUnpadded(tag);
return t + lenLen + len + data;
},
// v - value, l - left bytes (unparsed)
decode(tag, data) {
const { Err: E } = _DER;
data = abytes(data, undefined, 'DER data');
let pos = 0;
if (tag < 0 || tag > 255)
throw new E('tlv.decode: wrong tag');
if (data.length < 2 || data[pos++] !== tag)
throw new E('tlv.decode: wrong tlv');
const first = data[pos++];
// First bit of first length byte is the short/long form flag.
const isLong = !!(first & 0b1000_0000);
let length = 0;
if (!isLong)
length = first;
else {
// Long form: [longFlag(1bit), lengthLength(7bit), length (BE)]
const lenLen = first & 0b0111_1111;
if (!lenLen)
throw new E('tlv.decode(long): indefinite length not supported');
// This would overflow u32 in JS.
if (lenLen > 4)
throw new E('tlv.decode(long): byte length is too big');
const lengthBytes = data.subarray(pos, pos + lenLen);
if (lengthBytes.length !== lenLen)
throw new E('tlv.decode: length bytes not complete');
if (lengthBytes[0] === 0)
throw new E('tlv.decode(long): zero leftmost byte');
for (const b of lengthBytes)
length = (length << 8) | b;
pos += lenLen;
if (length < 128)
throw new E('tlv.decode(long): not minimal encoding');
}
const v = data.subarray(pos, pos + length);
if (v.length !== length)
throw new E('tlv.decode: wrong value length');
return { v, l: data.subarray(pos + length) };
},
},
// https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,
// since we always use positive integers here. It must always be empty:
// - add zero byte if exists
// - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
_int: {
encode(num) {
const { Err: E } = _DER;
abignumber(num);
if (num < _0n)
throw new E('integer: negative integers are not allowed');
let hex = numberToHexUnpadded(num);
// Pad with zero byte if negative flag is present
if (Number.parseInt(hex[0], 16) & 0b1000)
hex = '00' + hex;
if (hex.length & 1)
throw new E('unexpected DER parsing assertion: unpadded hex');
return hex;
},
decode(data) {
const { Err: E } = _DER;
if (data.length < 1)
throw new E('invalid signature integer: empty');
if (data[0] & 0b1000_0000)
throw new E('invalid signature integer: negative');
// Single-byte zero `00` is the canonical DER INTEGER encoding for zero.
if (data.length > 1 && data[0] === 0x00 && !(data[1] & 0b1000_0000))
throw new E('invalid signature integer: unnecessary leading zero');
return bytesToNumberBE(data);
},
},
toSig(bytes) {
// parse DER signature
const { Err: E, _int: int, _tlv: tlv } = _DER;
const data = abytes(bytes, undefined, 'signature');
const { v: seqBytes, l: seqLeftBytes } = tlv.decode(0x30, data);
if (seqLeftBytes.length)
throw new E('invalid signature: left bytes after parsing');
const { v: rBytes, l: rLeftBytes } = tlv.decode(0x02, seqBytes);
const { v: sBytes, l: sLeftBytes } = tlv.decode(0x02, rLeftBytes);
if (sLeftBytes.length)
throw new E('invalid signature: left bytes after parsing');
return { r: int.decode(rBytes), s: int.decode(sBytes) };
},
hexFromSig(sig) {
const { _tlv: tlv, _int: int } = _DER;
validateObject(sig, { r: 'bigint', s: 'bigint' }, {}, 'sig');
const rs = tlv.encode(0x02, int.encode(sig.r));
const ss = tlv.encode(0x02, int.encode(sig.s));
const seq = rs + ss;
return tlv.encode(0x30, seq);
},
};
/**
* ASN.1 DER encoding utilities. ASN is very complex & fragile. Format:
*
* [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S]
*
* Docs: {@link https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/ | Let's Encrypt ASN.1 guide} and
* {@link https://luca.ntop.org/Teaching/Appunti/asn1.html | Luca Deri's ASN.1 notes}.
* @example
* ASN.1 DER encoding utilities.
*
* ```ts
* const der = DER.hexFromSig({ r: 1n, s: 2n });
* ```
*/
export const DER = /* @__PURE__ */ (() => {
Object.freeze(_DER._tlv);
Object.freeze(_DER._int);
return Object.freeze(_DER);
})();
/**
* ASN.1 DER (Distinguished Encoding Rules) helpers for ECDSA signatures.
* Only implements the tiny subset needed for `SEQUENCE(INTEGER r, INTEGER s)`.
* @module
*/
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import {
abignumber,
abytes,
asafenumber,
astring,
bytesToNumberBE,
numberToHexUnpadded,
validateObject,
type TArg,
type TRet,
} from '../utils.ts';
const _0n = /* @__PURE__ */ BigInt(0);
/**
* @param m - Error message.
* @example
* Throw a DER-specific error when signature parsing encounters invalid bytes.
*
* ```ts
* new DERErr('bad der');
* ```
*/
export class DERErr extends Error {
constructor(m = '') {
super(m);
}
}
/** DER helper namespace used by ECDSA signature parsing and encoding. */
export type IDER = {
// asn.1 DER encoding utils
/**
* DER-specific error constructor.
* @param m - Error message.
* @returns DER-specific error instance.
*/
Err: typeof DERErr;
// Basic building block is TLV (Tag-Length-Value)
/** Low-level tag-length-value helpers used by DER encoders. */
_tlv: {
/**
* Encode one TLV record.
* @param tag - ASN.1 tag byte.
* @param data - Hex-encoded value payload.
* @returns Encoded TLV string.
*/
encode: (tag: number, data: string) => string;
// v - value, l - left bytes (unparsed)
/**
* Decode one TLV record and return the value plus leftover bytes.
* @param tag - Expected ASN.1 tag byte.
* @param data - Remaining DER bytes.
* @returns Parsed value plus leftover bytes.
*/
decode(tag: number, data: TArg<Uint8Array>): TRet<{ v: Uint8Array; l: Uint8Array }>;
};
// https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,
// since we always use positive integers here. It must always be empty:
// - add zero byte if exists
// - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
/** Positive-integer DER helpers used by ECDSA signature encoding. */
_int: {
/**
* Encode one positive bigint as a DER INTEGER.
* @param num - Positive integer to encode.
* @returns Encoded DER INTEGER.
*/
encode(num: bigint): string;
/**
* Decode one DER INTEGER into a bigint.
* @param data - DER INTEGER bytes.
* @returns Decoded bigint.
*/
decode(data: TArg<Uint8Array>): bigint;
};
/**
* Parse a DER signature into `{ r, s }`.
* @param bytes - DER signature bytes.
* @returns Parsed signature components.
*/
toSig(bytes: TArg<Uint8Array>): { r: bigint; s: bigint };
/**
* Encode `{ r, s }` as a DER signature.
* @param sig - Signature components.
* @returns DER-encoded signature hex.
*/
hexFromSig(sig: { r: bigint; s: bigint }): string;
};
// Plain const so the freezes can live inside the pure initializer of the `DER` export below:
// bare top-level `Object.freeze(...)` calls would defeat tree-shaking for every importer.
const _DER: IDER = {
// asn.1 DER encoding utils
Err: DERErr,
// Basic building block is TLV (Tag-Length-Value)
_tlv: {
encode: (tag: number, data: string): string => {
const { Err: E } = _DER;
asafenumber(tag, 'tag');
if (tag < 0 || tag > 255) throw new E('tlv.encode: wrong tag');
astring(data, 'data');
// Internal helper: callers hand this already-validated hex payload, so we only enforce
// byte alignment here instead of re-validating every nibble.
if (data.length & 1) throw new E('tlv.encode: unpadded data');
const dataLen = data.length / 2;
const len = numberToHexUnpadded(dataLen);
if ((len.length / 2) & 0b1000_0000) throw new E('tlv.encode: long form length too big');
// length of length with long form flag
const lenLen = dataLen > 127 ? numberToHexUnpadded((len.length / 2) | 0b1000_0000) : '';
const t = numberToHexUnpadded(tag);
return t + lenLen + len + data;
},
// v - value, l - left bytes (unparsed)
decode(tag: number, data: TArg<Uint8Array>): TRet<{ v: Uint8Array; l: Uint8Array }> {
const { Err: E } = _DER;
data = abytes(data, undefined, 'DER data');
let pos = 0;
if (tag < 0 || tag > 255) throw new E('tlv.decode: wrong tag');
if (data.length < 2 || data[pos++] !== tag) throw new E('tlv.decode: wrong tlv');
const first = data[pos++];
// First bit of first length byte is the short/long form flag.
const isLong = !!(first & 0b1000_0000);
let length = 0;
if (!isLong) length = first;
else {
// Long form: [longFlag(1bit), lengthLength(7bit), length (BE)]
const lenLen = first & 0b0111_1111;
if (!lenLen) throw new E('tlv.decode(long): indefinite length not supported');
// This would overflow u32 in JS.
if (lenLen > 4) throw new E('tlv.decode(long): byte length is too big');
const lengthBytes = data.subarray(pos, pos + lenLen);
if (lengthBytes.length !== lenLen) throw new E('tlv.decode: length bytes not complete');
if (lengthBytes[0] === 0) throw new E('tlv.decode(long): zero leftmost byte');
for (const b of lengthBytes) length = (length << 8) | b;
pos += lenLen;
if (length < 128) throw new E('tlv.decode(long): not minimal encoding');
}
const v = data.subarray(pos, pos + length);
if (v.length !== length) throw new E('tlv.decode: wrong value length');
return { v, l: data.subarray(pos + length) } as TRet<{ v: Uint8Array; l: Uint8Array }>;
},
},
// https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,
// since we always use positive integers here. It must always be empty:
// - add zero byte if exists
// - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
_int: {
encode(num: bigint): string {
const { Err: E } = _DER;
abignumber(num);
if (num < _0n) throw new E('integer: negative integers are not allowed');
let hex = numberToHexUnpadded(num);
// Pad with zero byte if negative flag is present
if (Number.parseInt(hex[0], 16) & 0b1000) hex = '00' + hex;
if (hex.length & 1) throw new E('unexpected DER parsing assertion: unpadded hex');
return hex;
},
decode(data: TArg<Uint8Array>): bigint {
const { Err: E } = _DER;
if (data.length < 1) throw new E('invalid signature integer: empty');
if (data[0] & 0b1000_0000) throw new E('invalid signature integer: negative');
// Single-byte zero `00` is the canonical DER INTEGER encoding for zero.
if (data.length > 1 && data[0] === 0x00 && !(data[1] & 0b1000_0000))
throw new E('invalid signature integer: unnecessary leading zero');
return bytesToNumberBE(data);
},
},
toSig(bytes: TArg<Uint8Array>): { r: bigint; s: bigint } {
// parse DER signature
const { Err: E, _int: int, _tlv: tlv } = _DER;
const data = abytes(bytes, undefined, 'signature');
const { v: seqBytes, l: seqLeftBytes } = tlv.decode(0x30, data);
if (seqLeftBytes.length) throw new E('invalid signature: left bytes after parsing');
const { v: rBytes, l: rLeftBytes } = tlv.decode(0x02, seqBytes);
const { v: sBytes, l: sLeftBytes } = tlv.decode(0x02, rLeftBytes);
if (sLeftBytes.length) throw new E('invalid signature: left bytes after parsing');
return { r: int.decode(rBytes), s: int.decode(sBytes) };
},
hexFromSig(sig: { r: bigint; s: bigint }): string {
const { _tlv: tlv, _int: int } = _DER;
validateObject(sig, { r: 'bigint', s: 'bigint' }, {}, 'sig');
const rs = tlv.encode(0x02, int.encode(sig.r));
const ss = tlv.encode(0x02, int.encode(sig.s));
const seq = rs + ss;
return tlv.encode(0x30, seq);
},
};
/**
* ASN.1 DER encoding utilities. ASN is very complex & fragile. Format:
*
* [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S]
*
* Docs: {@link https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/ | Let's Encrypt ASN.1 guide} and
* {@link https://luca.ntop.org/Teaching/Appunti/asn1.html | Luca Deri's ASN.1 notes}.
* @example
* ASN.1 DER encoding utilities.
*
* ```ts
* const der = DER.hexFromSig({ r: 1n, s: 2n });
* ```
*/
export const DER: IDER = /* @__PURE__ */ (() => {
Object.freeze(_DER._tlv);
Object.freeze(_DER._int);
return Object.freeze(_DER);
})();
+29
-11

@@ -139,3 +139,3 @@ /**

* Build Miller-loop precomputes for one G2 point.
* @param p - G2 point to precompute.
* @param p - Valid non-ZERO G2 point to precompute.
* @returns Pairing precompute table.

@@ -192,3 +192,4 @@ */

* Optional RNG override used by helper constructors.
* Receives the requested byte length and returns random bytes.
* @param len - Requested byte length.
* @returns Random bytes.
*/

@@ -277,3 +278,5 @@ randomBytes?: (len?: number) => TRet<Uint8Array>;

ateLoopSize: bigint;
xNegative: boolean;
twistType: BlsTwistType;
postPrecompute?: BlsPostPrecomputeFn;
};

@@ -324,2 +327,4 @@ }

* Verify one signature against one public key and hashed message.
* Malformed encoded signatures or keys may throw during point decoding; `false` means
* well-formed inputs failed the pairing equation.
* @param signature - Signature point or encoded signature.

@@ -344,2 +349,4 @@ * @param message - Hashed message point.

* Add many public keys into one aggregate point.
* Encoded inputs are decoded through `fromBytes()`; point instances are treated as already
* validated caller-owned objects to keep aggregation linear in additions.
* @param publicKeys - Public keys to aggregate.

@@ -352,2 +359,4 @@ * @returns Aggregated public-key point. This is raw point addition and does not add proof of

* Add many signatures into one aggregate point.
* Encoded inputs are decoded through `fromBytes()`; point instances are treated as already
* validated caller-owned objects to keep aggregation linear in additions.
* @param signatures - Signatures to aggregate.

@@ -387,4 +396,5 @@ * @returns Aggregated signature point. This is raw point addition and does not change the proof

* import { bn254 } from '@noble/curves/bn254.js';
* // Pair a G1 point with a G2 point without the higher-level signer helpers.
* const gt = bn254.pairing(bn254.G1.Point.BASE, bn254.G2.Point.BASE);
* // Rebuild the pairing-only helper from a concrete curve's public pieces.
* const pair = blsBasic(bn254.fields, bn254.G1.Point, bn254.G2.Point, bn254.params);
* const gt = pair.pairing(pair.G1.Point.BASE, pair.G2.Point.BASE);
* ```

@@ -408,8 +418,17 @@ */

* import { bls12_381 } from '@noble/curves/bls12-381.js';
* const sigs = bls12_381.longSignatures;
* // Use the full BLS helper set when you need hashing, keygen, signing, and verification.
* const { secretKey, publicKey } = sigs.keygen();
* const msg = sigs.hash(new TextEncoder().encode('hello noble'));
* const sig = sigs.sign(msg, secretKey);
* const isValid = sigs.verify(sig, msg, publicKey);
* // Rebuild a signer namespace from a concrete curve.
* // Applications usually import bls12_381 directly.
* const rebuilt = bls(
* bls12_381.fields,
* bls12_381.G1.Point,
* bls12_381.G2.Point,
* bls12_381.params,
* {
* hasherOpts: bls12_381.G2.defaults,
* hasherOptsG1: bls12_381.G1.defaults,
* hasherOptsG2: bls12_381.G2.defaults,
* },
* {}
* );
* const { secretKey, publicKey } = rebuilt.longSignatures.keygen();
* ```

@@ -419,2 +438,1 @@ */

export {};
//# sourceMappingURL=bls.d.ts.map

@@ -18,3 +18,3 @@ /**

/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { abytes, notImplemented, randomBytes } from "../utils.js";
import { aarray, abytes, notImplemented, randomBytes, validateObject, } from "../utils.js";
import {} from "./curve.js";

@@ -53,8 +53,105 @@ import { createHasher, } from "./hash-to-curve.js";

function createBlsPairing(fields, G1, G2, params) {
const { Fr, Fp2, Fp12 } = fields;
validateObject(fields, { Fp: 'object', Fr: 'object', Fp2: 'object', Fp12: 'object' }, { Fp6: 'object' }, 'fields');
if (typeof G1 !== 'function')
throw new TypeError('"G1_Point" expected point constructor, got type=' + typeof G1);
if (typeof G2 !== 'function')
throw new TypeError('"G2_Point" expected point constructor, got type=' + typeof G2);
validateObject(params, { ateLoopSize: 'bigint', xNegative: 'boolean', twistType: 'string' }, { randomBytes: 'function', postPrecompute: 'function' }, 'params');
const { Fp, Fr, Fp2, Fp12 } = fields;
const { twistType, ateLoopSize, xNegative, postPrecompute } = params;
const fp2 = (c0, c1) => ({ c0, c1 });
const fp2f = ({ c0, c1 }) => Object.freeze({ c0, c1 });
const add2 = (a, b) => fp2(Fp.add(a.c0, b.c0), Fp.add(a.c1, b.c1));
const sub2 = (a, b) => fp2(Fp.sub(a.c0, b.c0), Fp.sub(a.c1, b.c1));
const mul2 = (a, b) => {
const t0 = Fp.mul(a.c0, b.c0);
const t1 = Fp.mul(a.c1, b.c1);
return fp2(Fp.sub(t0, t1), Fp.sub(Fp.mul(Fp.add(a.c0, a.c1), Fp.add(b.c0, b.c1)), Fp.add(t0, t1)));
};
const mul2ByFp = (a, rhs) => fp2(Fp.mul(a.c0, rhs), Fp.mul(a.c1, rhs));
// Delegates to the tower's mulByNonresidue: it has fast paths for ξ = u+1 / ξ = a+u
// (adds/scalar-muls instead of a full Karatsuba Fp2 multiplication).
const mul2ByNonresidue = (a) => Fp2.mulByNonresidue(a);
const mul014ByLine = ({ c0: f0, c1: f1 }, o0, l1, l4, Px, Py) => {
const o1 = mul2ByFp(l1, Px);
const o4 = mul2ByFp(l4, Py);
const { c0: a0, c1: a1, c2: a2 } = f0;
const { c0: b0, c1: b1, c2: b2 } = f1;
// t0 = Fp6.mul01(f0, o0, o1)
const t0_0 = mul2(a0, o0);
const t0_1 = mul2(a1, o1);
const t0_c0 = add2(mul2ByNonresidue(sub2(mul2(add2(a1, a2), o1), t0_1)), t0_0);
const t0_c1 = sub2(sub2(mul2(add2(o0, o1), add2(a0, a1)), t0_0), t0_1);
const t0_c2 = add2(sub2(mul2(add2(a0, a2), o0), t0_0), t0_1);
// t1 = Fp6.mul1(f1, o4)
const t1_c0 = mul2ByNonresidue(mul2(b2, o4));
const t1_c1 = mul2(b0, o4);
const t1_c2 = mul2(b1, o4);
// t2 = Fp6.mul01(Fp6.add(f0, f1), o0, Fp2.add(o1, o4))
const s0 = add2(a0, b0);
const s1 = add2(a1, b1);
const s2 = add2(a2, b2);
const o14 = add2(o1, o4);
const t2_0 = mul2(s0, o0);
const t2_1 = mul2(s1, o14);
const t2_c0 = add2(mul2ByNonresidue(sub2(mul2(add2(s1, s2), o14), t2_1)), t2_0);
const t2_c1 = sub2(sub2(mul2(add2(o0, o14), add2(s0, s1)), t2_0), t2_1);
const t2_c2 = add2(sub2(mul2(add2(s0, s2), o0), t2_0), t2_1);
return Object.freeze({
c0: Object.freeze({
c0: fp2f(add2(mul2ByNonresidue(t1_c2), t0_c0)),
c1: fp2f(add2(t1_c0, t0_c1)),
c2: fp2f(add2(t1_c1, t0_c2)),
}),
c1: Object.freeze({
c0: fp2f(sub2(sub2(t2_c0, t0_c0), t1_c0)),
c1: fp2f(sub2(sub2(t2_c1, t0_c1), t1_c1)),
c2: fp2f(sub2(sub2(t2_c2, t0_c2), t1_c2)),
}),
});
};
// Like mul014ByLine, params are named after the sparse slot they end up in: l0 is scaled by
// Py into o0, l3 is scaled by Px into o3, o4 is used as-is.
const mul034ByLine = ({ c0: f0, c1: f1 }, l0, l3, o4, Px, Py) => {
const o0 = mul2ByFp(l0, Py);
const o3 = mul2ByFp(l3, Px);
const { c0: a0, c1: a1, c2: a2 } = f0;
const { c0: b0, c1: b1, c2: b2 } = f1;
// a = f0 * o0
const a_c0 = mul2(a0, o0);
const a_c1 = mul2(a1, o0);
const a_c2 = mul2(a2, o0);
// b = Fp6.mul01(f1, o3, o4)
const b0m = mul2(b0, o3);
const b1m = mul2(b1, o4);
const b_c0 = add2(mul2ByNonresidue(sub2(mul2(add2(b1, b2), o4), b1m)), b0m);
const b_c1 = sub2(sub2(mul2(add2(o3, o4), add2(b0, b1)), b0m), b1m);
const b_c2 = add2(sub2(mul2(add2(b0, b2), o3), b0m), b1m);
// e = Fp6.mul01(Fp6.add(f0, f1), Fp2.add(o0, o3), o4)
const s0 = add2(a0, b0);
const s1 = add2(a1, b1);
const s2 = add2(a2, b2);
const o03 = add2(o0, o3);
const e0m = mul2(s0, o03);
const e1m = mul2(s1, o4);
const e_c0 = add2(mul2ByNonresidue(sub2(mul2(add2(s1, s2), o4), e1m)), e0m);
const e_c1 = sub2(sub2(mul2(add2(o03, o4), add2(s0, s1)), e0m), e1m);
const e_c2 = add2(sub2(mul2(add2(s0, s2), o03), e0m), e1m);
return Object.freeze({
c0: Object.freeze({
c0: fp2f(add2(mul2ByNonresidue(b_c2), a_c0)),
c1: fp2f(add2(b_c0, a_c1)),
c2: fp2f(add2(b_c1, a_c2)),
}),
c1: Object.freeze({
c0: fp2f(sub2(sub2(e_c0, a_c0), b_c0)),
c1: fp2f(sub2(sub2(e_c1, a_c1), b_c1)),
c2: fp2f(sub2(sub2(e_c2, a_c2), b_c2)),
}),
});
};
// Applies sparse multiplication as line function
let lineFunction;
if (twistType === 'multiplicative') {
lineFunction = (c0, c1, c2, f, Px, Py) => Fp12.mul014(f, c0, Fp2.mul(c1, Px), Fp2.mul(c2, Py));
lineFunction = (c0, c1, c2, f, Px, Py) => mul014ByLine(f, c0, c1, c2, Px, Py);
}

@@ -64,3 +161,3 @@ else if (twistType === 'divisive') {

// precompute calculations.
lineFunction = (c0, c1, c2, f, Px, Py) => Fp12.mul034(f, Fp2.mul(c2, Py), Fp2.mul(c1, Px), c0);
lineFunction = (c0, c1, c2, f, Px, Py) => mul034ByLine(f, c2, c1, c0, Px, Py);
}

@@ -110,2 +207,4 @@ else

const calcPairingPrecomputes = (point) => {
if (!(point instanceof G2))
throw new TypeError('"point" expected G2 point, got type=' + typeof point);
const p = point;

@@ -132,2 +231,8 @@ const { x, y } = p.toAffine();

function millerLoopBatch(pairs, withFinalExponent = false) {
aarray(pairs, 'pairs', (pair, title) => {
aarray(pair, title);
if (pair.length !== 3)
throw new TypeError(`"${title}" expected precompute tuple`);
aarray(pair[0], title + '[0]');
});
let f12 = Fp12.ONE;

@@ -137,3 +242,5 @@ if (pairs.length) {

for (let i = 0; i < ellLen; i++) {
f12 = Fp12.sqr(f12); // This allows us to do sqr only one time for all pairings
// sqr only one time for all pairings; skip sqr(ONE) at i=0
if (i !== 0)
f12 = Fp12.sqr(f12);
// NOTE: we apply multiple pairings in parallel here

@@ -153,4 +260,12 @@ for (const [ell, Px, Py] of pairs) {

function pairingBatch(pairs, withFinalExponent = true) {
aarray(pairs, 'pairs');
const res = [];
for (const { g1, g2 } of pairs) {
for (let i = 0; i < pairs.length; i++) {
const pair = pairs[i];
validateObject(pair, { g1: 'object', g2: 'object' }, {}, 'pairs[' + i + ']');
const { g1, g2 } = pair;
if (!(g1 instanceof G1))
throw new TypeError('"pairs[' + i + '].g1" expected G1 point, got type=' + typeof g1);
if (!(g2 instanceof G2))
throw new TypeError('"pairs[' + i + '].g2" expected G2 point, got type=' + typeof g2);
// Mathematically, a zero pairing term contributes GT.ONE. We still reject it here because

@@ -172,2 +287,6 @@ // this API mainly backs BLS verification, where ZERO inputs usually mean broken hash /

function pairing(Q, P, withFinalExponent = true) {
if (!(Q instanceof G1))
throw new TypeError('"Q" expected G1 point, got type=' + typeof Q);
if (!(P instanceof G2))
throw new TypeError('"P" expected G2 point, got type=' + typeof P);
return pairingBatch([{ g1: Q, g2: P }], withFinalExponent);

@@ -208,2 +327,3 @@ }

}
const sigCoder = SignatureCoder;
function normPub(point) {

@@ -213,3 +333,3 @@ return point instanceof PubPoint ? point : PubPoint.fromBytes(point);

function normSig(point) {
return point instanceof SigPoint ? point : SigPoint.fromBytes(point);
return point instanceof SigPoint ? point : sigCoder.fromBytes(point);
}

@@ -252,2 +372,3 @@ // Sign/verify here take points already hashed onto the signature subgroup.

const sec = PubPoint.Fn.fromBytes(secretKey);
// BLS/BN point APIs allow infinity for compatibility; raw message bytes still fail amsg().
amsg(message).assertValidity();

@@ -286,3 +407,3 @@ return message.multiply(sec);

const sig = normSig(signature);
const nMessages = items.map((i) => i.message);
const nMessages = items.map((i) => amsg(i.message));
const nPublicKeys = items.map((i) => normPub(i.publicKey));

@@ -335,6 +456,7 @@ // NOTE: this works only for exact same object

abytes(messageBytes);
const opts = DST ? { DST } : undefined;
// Only omitted DST uses the default; explicit empty DST must reach normDST validation.
const opts = DST === undefined ? undefined : { DST };
return hashToSigCurve(messageBytes, opts);
},
Signature: Object.freeze({ ...SignatureCoder }),
Signature: Object.freeze({ ...sigCoder }),
}) /*satisfies Signer */;

@@ -358,4 +480,5 @@ }

* import { bn254 } from '@noble/curves/bn254.js';
* // Pair a G1 point with a G2 point without the higher-level signer helpers.
* const gt = bn254.pairing(bn254.G1.Point.BASE, bn254.G2.Point.BASE);
* // Rebuild the pairing-only helper from a concrete curve's public pieces.
* const pair = blsBasic(bn254.fields, bn254.G1.Point, bn254.G2.Point, bn254.params);
* const gt = pair.pairing(pair.G1.Point.BASE, pair.G2.Point.BASE);
* ```

@@ -386,3 +509,5 @@ */

ateLoopSize: params.ateLoopSize,
xNegative: params.xNegative,
twistType: params.twistType,
postPrecompute: params.postPrecompute,
}),

@@ -398,2 +523,3 @@ utils: Object.freeze({

const base = blsBasic(fields, G1_Point, G2_Point, params);
validateObject(hasherParams, { hasherOpts: 'object', hasherOptsG1: 'object', hasherOptsG2: 'object' }, { mapToG1: 'function', mapToG2: 'function' }, 'hasherParams');
// Missing map hooks intentionally fail closed via notImplemented on first hash use.

@@ -427,8 +553,17 @@ const G1Hasher = createHasher(G1_Point, hasherParams.mapToG1 === undefined ? notImplemented : hasherParams.mapToG1, {

* import { bls12_381 } from '@noble/curves/bls12-381.js';
* const sigs = bls12_381.longSignatures;
* // Use the full BLS helper set when you need hashing, keygen, signing, and verification.
* const { secretKey, publicKey } = sigs.keygen();
* const msg = sigs.hash(new TextEncoder().encode('hello noble'));
* const sig = sigs.sign(msg, secretKey);
* const isValid = sigs.verify(sig, msg, publicKey);
* // Rebuild a signer namespace from a concrete curve.
* // Applications usually import bls12_381 directly.
* const rebuilt = bls(
* bls12_381.fields,
* bls12_381.G1.Point,
* bls12_381.G2.Point,
* bls12_381.params,
* {
* hasherOpts: bls12_381.G2.defaults,
* hasherOptsG1: bls12_381.G1.defaults,
* hasherOptsG2: bls12_381.G2.defaults,
* },
* {}
* );
* const { secretKey, publicKey } = rebuilt.longSignatures.keygen();
* ```

@@ -449,2 +584,1 @@ */

}
//# sourceMappingURL=bls.js.map
/**
* Methods for elliptic curve multiplication by scalars.
* Contains wNAF, pippenger.
* Contains wNAF-based ScalarMultiplier, pippenger.
* @module

@@ -93,3 +93,4 @@ */

/**
* Massively speeds up `p.multiply(n)` by using precompute tables (caching). See {@link wNAF}.
* Massively speeds up `p.multiply(n)` by using precompute tables (caching).
* See {@link ScalarMultiplier}.
* Cache state lives in internal WeakMaps keyed by point identity, not on the point object.

@@ -200,20 +201,2 @@ * Repeating `precompute(...)` for the same point identity replaces the remembered window size

/**
* Computes both candidates first, but the final selection still branches on `condition`, so this
* is not a strict constant-time CMOV primitive.
* @param condition - Whether to negate the point.
* @param item - Point-like value.
* @returns Original or negated value.
* @example
* Keep the point or return its negation based on one boolean branch.
*
* ```ts
* import { negateCt } from '@noble/curves/abstract/curve.js';
* import { p256 } from '@noble/curves/nist.js';
* const maybeNegated = negateCt(true, p256.Point.BASE);
* ```
*/
export declare function negateCt<T extends {
negate: () => T;
}>(condition: boolean, item: T): T;
/**
* Takes a bunch of Projective Points but executes only one

@@ -237,21 +220,52 @@ * inversion on all of them. Inversion is very slow operation,

export declare function normalizeZ<P extends CurvePoint<any, P>, PC extends CurvePointCons<P>>(c: PC, points: P[]): P[];
/** RNG interface used for scalar / nonce blinding. */
export type RandomBytes = (bytesLength?: number) => TRet<Uint8Array>;
/**
* Elliptic curve multiplication of Point by scalar. Fragile.
* Table generation takes **30MB of ram and 10ms on high-end CPU**,
* but may take much longer on slow devices. Actual generation will happen on
* first call of `multiply()`. By default, `BASE` point is precomputed.
* Probes an RNG once, at construction time: returns `undefined` when it is unavailable —
* throws or returns malformed bytes — so callers can downgrade to their unblinded /
* deterministic constant-time fallback. Blinding is defense-in-depth (DPA/template
* hardening), not a correctness or key-secrecy requirement, so availability-based
* downgrade is acceptable.
*
* Scalars should always be less than curve order: this should be checked inside of a curve itself.
* Creates precomputation tables for fast multiplication:
* - private scalar is split by fixed size windows of W bits
* - every window point is collected from window's table & added to accumulator
* - since windows are different, same point inside tables won't be accessed more than once per calc
* - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)
* - +1 window is neccessary for wNAF
* - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication
* The downgrade decision is deliberately static. After a successful probe the RNG becomes
* part of the trusted contract: later misbehavior must fail closed in per-call validation
* (throw), never downgrade — a dynamic fallback would let a tampered RNG silently strip
* blinding on demand. A probe can only ever classify broken environments, not adversarial
* RNGs: a stateful RNG can always behave while probed and misbehave later.
* @param randomBytes - RNG to probe, or `undefined` when the environment provides none.
* @param length - Byte length requested from the probe call.
* @returns The RNG when the probe produced `length` valid bytes; `undefined` otherwise.
* @example
* Probe an RNG once before enabling scalar blinding.
*
* TODO: research returning a 2d JS array of windows instead of a single window.
* This would allow windows to be in different memory locations.
* ```ts
* import { probeRandomBytes } from '@noble/curves/abstract/curve.js';
* import { randomBytes } from '@noble/hashes/utils.js';
* const rng = probeRandomBytes(randomBytes, 16);
* ```
*/
export declare function probeRandomBytes(randomBytes: TArg<RandomBytes | undefined>, length: number): TRet<RandomBytes | undefined>;
/** Result of a constant-time multiply: real point `p`, fake accumulator `f` (discarded). */
type MulResult<P> = {
p: P;
f: P;
};
/**
* Elliptic curve multiplication of Point by scalar.
* Routes between cached-table, fixed-window, and one-shot wNAF paths; entry points validate
* their own scalars (`mulCT`/`mulCTBlinded`: `1 <= s < Fn.ORDER`; `mulUnsafe`: up to the
* `Fn.ORDER^4` DoS cap via {@link mulAddUnsafe}).
* Table generation is expensive and happens on first call of `multiply()`
* (or eagerly via `precompute(W, false)`). By default, `BASE` point is precomputed.
*
* Cached algorithm is signed fixed-window wNAF:
* - table stores, for every window w, the multiples `[1..2^(W−1)]⋅2^(w⋅W)⋅P` — all doublings
* are baked in, so a multiplication is exactly one table addition per window
* - window count is fixed (`ceil(bits/W) + 1`), so the point-operation count is scalar-independent
* (basis of the constant-time path)
* - for a 256-bit curve and W=6: 44⋅32 = 1408 table points, 44 additions per multiply
* - secret scalars are additionally blinded (see {@link ScalarMultiplier.mulCTBlinded}), which
* widens tables by 128 bits
* @param Point - Point constructor.
* @param bits - Scalar bit length.
* @param randomBytes - RNG used for scalar blinding; required by the blinded secret path.
* @example

@@ -261,71 +275,94 @@ * Elliptic curve multiplication of Point by scalar.

* ```ts
* import { wNAF } from '@noble/curves/abstract/curve.js';
* import { ScalarMultiplier } from '@noble/curves/abstract/curve.js';
* import { p256 } from '@noble/curves/nist.js';
* const ladder = new wNAF(p256.Point, p256.Point.Fn.BITS);
* const mul = new ScalarMultiplier(p256.Point);
* ```
*/
export declare class wNAF<PC extends PC_ANY> {
export declare class ScalarMultiplier<PC extends PC_ANY> {
private readonly Point;
private readonly BASE;
private readonly ZERO;
private readonly Fn;
private readonly randomBytes?;
private readonly wnafPrecomputes;
private baseCanBeBlinded;
readonly bits: number;
constructor(Point: PC, bits: number);
_unsafeLadder(elm: PC_P<PC>, n: bigint, p?: PC_P<PC>): PC_P<PC>;
constructor(Point: PC, randomBytes?: RandomBytes);
/**
* Creates a wNAF precomputation window. Used for caching.
* Default window size is set by `utils.precompute()` and is equal to 8.
* Number of precomputed points depends on the curve size:
* 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:
* - 𝑊 is the window size
* - 𝑛 is the bitlength of the curve order.
* For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.
* Creates a signed fixed-window wNAF precomputation table: for every window w, the
* multiples `[1..2^(W−1)]⋅2^(w⋅W)⋅P`, flattened. All doublings are baked into the table,
* so cached multiplication is additions-only. `windows = ceil(bits/W) + 1`: the extra
* window absorbs the final carry of signed-digit recoding.
* For a 256-bit curve and W=6, the table is 44⋅32 = 1408 points.
* @param point - Point instance
* @param W - window size
* @returns precomputed point tables flattened to a single array
* @param bits - scalar bitlength the table must cover
*/
private precomputeWindow;
private buildWnafTable;
/**
* Implements ec multiplication using precomputed tables and w-ary non-adjacent form.
* More compact implementation:
* https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541
* Implements ec multiplication using precomputed signed fixed-window wNAF tables.
* Constant-time: fixed window count with one table addition per window — zero digits feed
* the fake accumulator — and no doublings; the lookup scans the whole window slice.
* Scalar bounds are validated by the public entry points ({@link ScalarMultiplier.mulCT},
* {@link ScalarMultiplier.mulCTBlinded}, {@link ScalarMultiplier.mulUnsafe});
* signedWindowDigits throws if `n` exceeds the table.
* @returns real and fake (for const-time) points
*/
private wNAF;
private wnafCachedCT;
private getWnafPrecomputes;
private assertPoint;
private validateMulInput;
private runCT;
mulCT(point: PC_P<PC>, scalar: bigint, transform?: Mapper<PC_P<PC>>): MulResult<PC_P<PC>>;
mulCTBlinded(point: PC_P<PC>, scalar: bigint, transform?: Mapper<PC_P<PC>>): MulResult<PC_P<PC>>;
/**
* Implements unsafe EC multiplication using precomputed tables
* and w-ary non-adjacent form.
* @param acc - accumulator point to add result of multiplication
* @returns point
* Constant-time multiplication `n*point` for an un-precomputed point, via a small fixed window.
* A cached wNAF table only pays off when reused; a flat 2^FW_WINDOW table (`size-1` adds) is
* far cheaper to build for a single use. The point-operation sequence is independent of `n`:
* build the table, then per window exactly FW_WINDOW doublings, a data-oblivious scan over
* every table entry, and one addition (adds the identity when the window digit is 0 — never
* skipped).
*
* `n` must be `< 2^bits`. Assumes complete addition (adding the identity costs the same as any
* add), which holds for the Weierstrass/Edwards point types used here. The table is left in
* projective form (no normalizeZ): normalizing this small a table costs more than the
* mixed-add savings it would buy for a single multiply.
* @returns real point `p`; `f` duplicates it only to match {@link wnafCachedCT}'s return shape
* (this path needs no fake accumulator — its op-count is already scalar-independent).
*/
private wNAFUnsafe;
private getPrecomputes;
cached(point: PC_P<PC>, scalar: bigint, transform?: Mapper<PC_P<PC>>): {
p: PC_P<PC>;
f: PC_P<PC>;
};
unsafe(point: PC_P<PC>, scalar: bigint, transform?: Mapper<PC_P<PC>>, prev?: PC_P<PC>): PC_P<PC>;
createCache(P: PC_P<PC>, W: number): void;
hasCache(elm: PC_P<PC>): boolean;
private fixedWindowCT;
private shouldBlind;
mulSecret(point: PC_P<PC>, scalar: bigint, cofactor: bigint, transform?: Mapper<PC_P<PC>>): MulResult<PC_P<PC>>;
mulUnsafe(point: PC_P<PC>, scalar: bigint, transform?: Mapper<PC_P<PC>>): PC_P<PC>;
setWindowSize(point: PC_P<PC>, W: number): void;
hasWindowSize(point: PC_P<PC>): boolean;
}
/**
* Endomorphism-specific multiplication for Koblitz curves.
* Cost: 128 dbl, 0-256 adds.
* @param Point - Point constructor.
* @param point - Input point.
* @param k1 - First non-negative absolute scalar chunk.
* @param k2 - Second non-negative absolute scalar chunk.
* @returns Partial multiplication results.
* Combined multi-scalar multiplication `Σ scalars[i]⋅points[i]` via interleaved width-4 wNAF
* (Strauss–Shamir). Every input gets its own table of odd multiples `[1P, 3P, 5P, 7P]` and
* signed-digit recoding, but all walks share one doubling chain, so total cost is
* `~bits` doublings + `L⋅bits/5` additions instead of `L⋅bits` doublings for separate
* multiplications. Intended for the 2-4 point shapes of signature verification
* (`R = u1⋅G + u2⋅P`); use {@link pippenger} for larger batches.
*
* Not constant-time: only for public inputs. Scalars must satisfy `0 <= s < Fn.ORDER`;
* fold negative signs into the points before calling.
* @param c - Point constructor.
* @param points - Array of curve points.
* @param scalars - Array of non-negative scalars, same length as points.
* @param allowOversized - Replace the `s < Fn.ORDER` scalar check with a `Fn.ORDER^4` DoS cap.
* Off by default. For scalars that must NOT be reduced mod ORDER: torsion checks
* (`Fn.ORDER⋅P ≟ O`) and cofactor-clearing multiples. Walk length grows with `bitLen(s)`.
* @returns Combined multiplication result; identity for empty input.
* @throws If the point set or scalar set is invalid. {@link Error}
* @example
* Endomorphism-specific multiplication for Koblitz curves.
* Combined multi-scalar multiplication via Strauss–Shamir.
*
* ```ts
* import { mulEndoUnsafe } from '@noble/curves/abstract/curve.js';
* import { secp256k1 } from '@noble/curves/secp256k1.js';
* const parts = mulEndoUnsafe(secp256k1.Point, secp256k1.Point.BASE, 3n, 5n);
* import { mulAddUnsafe } from '@noble/curves/abstract/curve.js';
* import { p256 } from '@noble/curves/nist.js';
* const G = p256.Point.BASE;
* const R = mulAddUnsafe(p256.Point, [G, G.double()], [2n, 3n]); // 2⋅G + 3⋅(2⋅G)
* ```
*/
export declare function mulEndoUnsafe<P extends CurvePoint<any, P>, PC extends CurvePointCons<P>>(Point: PC, point: P, k1: bigint, k2: bigint): {
p1: P;
p2: P;
};
export declare function mulAddUnsafe<P extends CurvePoint<any, P>, PC extends CurvePointCons<P>>(c: PC, points: P[], scalars: bigint[], allowOversized?: boolean): P;
/**

@@ -335,3 +372,9 @@ * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).

* For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL.
* Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0.
* Point-operation count is scalar-independent (for same L), even when 1 point + scalar, or when
* scalar = 0 — but bucket indices are scalar windows, so the memory-access pattern is
* scalar-dependent: do not rely on this for secret scalars.
*
* A repaired LFG bucket-set variant from ePrint 2024/750 was benchmarked on BLS12-381 G1
* against this implementation: ~1.4x faster at 2048 points and ~1.1-1.25x faster at
* 4096-32768 points, at the cost of extra recoding and multiplier-table complexity.
* @param c - Curve Point constructor

@@ -353,20 +396,33 @@ * @param points - array of L curve points

/**
* Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
* Interleaved wNAF multi-scalar multiplication (MSM, Pa + Qb + Rc + ...) over a FIXED set
* of points: each point gets a one-time table of odd multiples
* `[1P, 3P, ..., (2^(W−1)−1)P]`, and the returned closure evaluates MSMs against those
* tables. All scalars share one doubling chain (Straus 1964) — one doubling per scalar bit
* plus one signed table addition per nonzero width-W wNAF digit (density ~1/(W+1)) — the
* "interleaving" method of Möller, "Algorithms for multi-exponentiation" (SAC 2001).
*
* Table memory is `L⋅2^(W−2)` points, capped at ~2 GiB. Prefer this over {@link pippenger}
* when the same points are reused across many MSMs (fixed-base commitments etc.) and up to a
* few hundred points; prefer pippenger for one-shot MSMs or thousands of points, where
* bucketing beats per-point tables.
*
* Not constant-time (zero digits are skipped): public inputs only.
* @param c - Curve Point constructor
* @param points - array of L curve points
* @param windowSize - Precompute window size.
* @returns Function which multiplies points with scalars. The closure accepts
* `scalars.length <= points.length`, and omitted trailing scalars are treated as zero.
* @param points - array of L curve points, captured by the returned closure
* @param windowSize - window width W in bits, from 2 to Fn.BITS; also capped so the
* per-closure tables stay under ~2 GiB
* @returns Function which multiplies points with scalars. The closure accepts at most
* `points.length` scalars, and omitted trailing scalars are treated as zero.
* @throws If the point set or precompute window is invalid. {@link Error}
* @example
* Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
* Interleaved wNAF multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
*
* ```ts
* import { precomputeMSMUnsafe } from '@noble/curves/abstract/curve.js';
* import { interleavedMSMUnsafe } from '@noble/curves/abstract/curve.js';
* import { p256 } from '@noble/curves/nist.js';
* const msm = precomputeMSMUnsafe(p256.Point, [p256.Point.BASE], 4);
* const msm = interleavedMSMUnsafe(p256.Point, [p256.Point.BASE], 4);
* const point = msm([3n]);
* ```
*/
export declare function precomputeMSMUnsafe<P extends CurvePoint<any, P>, PC extends CurvePointCons<P>>(c: PC, points: P[], windowSize: number): (scalars: bigint[]) => P;
export declare function interleavedMSMUnsafe<P extends CurvePoint<any, P>, PC extends CurvePointCons<P>>(c: PC, points: P[], windowSize: number): (scalars: bigint[]) => P;
/** Minimal curve parameters needed to construct a Weierstrass or Edwards curve. */

@@ -404,3 +460,3 @@ export type ValidCurveParams<T> = {

* @param CURVE - Curve parameters.
* @param curveOpts - Optional field overrides:
* @param curveOpts - Optional field overrides. See {@link FpFn}:
* - `Fp` (optional): Optional base-field override.

@@ -429,3 +485,3 @@ * - `Fn` (optional): Optional scalar-field override.

}>;
type KeygenFn = (seed?: Uint8Array, isCompressed?: boolean) => {
type KeygenFn = (seed?: Uint8Array) => {
secretKey: Uint8Array;

@@ -450,2 +506,1 @@ publicKey: Uint8Array;

export {};
//# sourceMappingURL=curve.d.ts.map
/**
* Methods for elliptic curve multiplication by scalars.
* Contains wNAF, pippenger.
* Contains wNAF-based ScalarMultiplier, pippenger.
* @module
*/
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { bitLen, bitMask, validateObject } from "../utils.js";
import { aarray, abool, afunction, aobject, bitLen, bitMask, bytesToNumberBE, inRange, isBytes, isPosBig, validateObject, } from "../utils.js";
import { Field, FpInvertBatch, validateField } from "./modular.js";
const _0n = /* @__PURE__ */ BigInt(0);
const _1n = /* @__PURE__ */ BigInt(1);
const _4n = /* @__PURE__ */ BigInt(4);
const BLIND_BYTES = 16;
const BLIND_BITS = 128;
// Fixed-window width for the constant-time multiply of un-precomputed points (W===1).
// A flat 2^FW_WINDOW table has a small, scalar-independent build cost that amortizes over a single
// multiply, unlike the larger per-point wNAF tables that only pay off when cached.
const FW_WINDOW = 5;
// Precompute tables are capped at ~2 GiB of estimated heap. Rejecting larger windows up front
// turns a typo'd window size into an immediate error instead of a multi-GB allocation (or an
// effective hang) when the lazy table is built on first multiply.
const TABLE_BYTES_MAX = /* @__PURE__ */ (() => 2 ** 31)();
/**

@@ -29,17 +40,10 @@ * Validates the static surface of a point constructor.

if (typeof pc !== 'function')
throw new TypeError('Point must be a constructor');
// validateObject only accepts plain objects, so copy the constructor statics into one bag first.
validateObject({
Fp: pc.Fp,
Fn: pc.Fn,
fromAffine: pc.fromAffine,
fromBytes: pc.fromBytes,
fromHex: pc.fromHex,
}, {
Fp: 'object',
Fn: 'object',
fromAffine: 'function',
fromBytes: 'function',
fromHex: 'function',
});
throw new TypeError('"Point" expected constructor, got type=' + typeof Point);
afunction(pc.fromAffine, 'Point.fromAffine');
afunction(pc.fromBytes, 'Point.fromBytes');
afunction(pc.fromHex, 'Point.fromHex');
// Generic helpers (ScalarMultiplier, normalizeZ, MSM) dereference BASE / ZERO:
// fail here with a typed error instead of an `undefined` access later.
aobject(pc.BASE, 'Point.BASE');
aobject(pc.ZERO, 'Point.ZERO');
validateField(pc.Fp);

@@ -49,21 +53,2 @@ validateField(pc.Fn);

/**
* Computes both candidates first, but the final selection still branches on `condition`, so this
* is not a strict constant-time CMOV primitive.
* @param condition - Whether to negate the point.
* @param item - Point-like value.
* @returns Original or negated value.
* @example
* Keep the point or return its negation based on one boolean branch.
*
* ```ts
* import { negateCt } from '@noble/curves/abstract/curve.js';
* import { p256 } from '@noble/curves/nist.js';
* const maybeNegated = negateCt(true, p256.Point.BASE);
* ```
*/
export function negateCt(condition, item) {
const neg = item.negate();
return condition ? neg : item;
}
/**
* Takes a bunch of Projective Points but executes only one

@@ -87,43 +72,67 @@ * inversion on all of them. Inversion is very slow operation,

export function normalizeZ(c, points) {
// Match MSM helpers: reject malformed public inputs before reading projective internals.
validatePointCons(c);
validateMSMPoints(points, c);
// Identity points (Z=0) rely on an implicit contract: FpInvertBatch without `passZero`
// yields `undefined` for zero inputs, and `toAffine(undefined)` falls back to its internal
// is0 handling instead of using the batch inverse.
const invertedZs = FpInvertBatch(c.Fp, points.map((p) => p.Z));
return points.map((p, i) => c.fromAffine(p.toAffine(invertedZs[i])));
}
function validateW(W, bits) {
if (!Number.isSafeInteger(W) || W <= 0 || W > bits)
throw new Error('invalid window size, expected [1..' + bits + '], got W=' + W);
function validateW(W, bits, min = 1) {
if (!Number.isSafeInteger(W) || W < min || W > bits)
throw new Error('invalid window size, expected [' + min + '..' + bits + '], got W=' + W);
}
function calcWOpts(W, scalarBits) {
validateW(W, scalarBits);
const windows = Math.ceil(scalarBits / W) + 1; // W=8 33. Not 32, because we skip zero
const windowSize = 2 ** (W - 1); // W=8 128. Not 256, because we skip zero
const maxNumber = 2 ** W; // W=8 256
const mask = bitMask(W); // W=8 255 == mask 0b11111111
const shiftBy = BigInt(W); // W=8 8
return { windows, windowSize, mask, maxNumber, shiftBy };
// Rough per-point heap estimate for the {@link TABLE_BYTES_MAX} cap: up to 4 projective/extended
// coordinates of Fp.BYTES each, plus bigint/object overhead. Callers pass the point count of the
// largest table the checked parameters can produce.
function validateTableBytes(numPoints, fpBytes) {
const bytes = numPoints * (4 * fpBytes + 128);
if (bytes > TABLE_BYTES_MAX)
throw new Error('invalid window size: table would need ~' +
Math.ceil(bytes / 2 ** 20) +
' MiB, max ' +
TABLE_BYTES_MAX / 2 ** 20 +
' MiB');
}
function calcOffsets(n, window, wOpts) {
const { windowSize, mask, maxNumber, shiftBy } = wOpts;
let wbits = Number(n & mask); // extract W bits.
let nextN = n >> shiftBy; // shift number by W bits.
// What actually happens here:
// const highestBit = Number(mask ^ (mask >> 1n));
// let wbits2 = wbits - 1; // skip zero
// if (wbits2 & highestBit) { wbits2 ^= Number(mask); // (~);
// split if bits > max: +224 => 256-32
if (wbits > windowSize) {
// we skip zero, which means instead of `>= size-1`, we do `> size`
wbits -= maxNumber; // -32, can be maxNumber - wbits, but then we need to set isNeg here.
nextN += _1n; // +256 (carry)
/**
* Probes an RNG once, at construction time: returns `undefined` when it is unavailable —
* throws or returns malformed bytes — so callers can downgrade to their unblinded /
* deterministic constant-time fallback. Blinding is defense-in-depth (DPA/template
* hardening), not a correctness or key-secrecy requirement, so availability-based
* downgrade is acceptable.
*
* The downgrade decision is deliberately static. After a successful probe the RNG becomes
* part of the trusted contract: later misbehavior must fail closed in per-call validation
* (throw), never downgrade — a dynamic fallback would let a tampered RNG silently strip
* blinding on demand. A probe can only ever classify broken environments, not adversarial
* RNGs: a stateful RNG can always behave while probed and misbehave later.
* @param randomBytes - RNG to probe, or `undefined` when the environment provides none.
* @param length - Byte length requested from the probe call.
* @returns The RNG when the probe produced `length` valid bytes; `undefined` otherwise.
* @example
* Probe an RNG once before enabling scalar blinding.
*
* ```ts
* import { probeRandomBytes } from '@noble/curves/abstract/curve.js';
* import { randomBytes } from '@noble/hashes/utils.js';
* const rng = probeRandomBytes(randomBytes, 16);
* ```
*/
export function probeRandomBytes(randomBytes, length) {
if (randomBytes === undefined)
return undefined;
afunction(randomBytes, 'randomBytes');
try {
const probe = randomBytes(length);
if (!isBytes(probe) || probe.length !== length)
return undefined;
}
const offsetStart = window * windowSize;
const offset = offsetStart + Math.abs(wbits) - 1; // -1 because we skip zero; ignore when isZero
const isZero = wbits === 0; // is current window slice a 0?
const isNeg = wbits < 0; // is current window slice negative?
const isNegF = window % 2 !== 0; // fake branch noise only
const offsetF = offsetStart; // fake branch noise only
return { nextN, offset, isZero, isNeg, isNegF, offsetF };
catch {
return undefined;
}
return randomBytes;
}
function validateMSMPoints(points, c) {
if (!Array.isArray(points))
throw new Error('array expected');
aarray(points, 'points');
points.forEach((p, i) => {

@@ -134,46 +143,114 @@ if (!(p instanceof c))

}
function validateMSMScalars(scalars, field) {
// Default bound is field membership (0 <= s < field.ORDER); a `maxScalar` override widens it
// to 0 <= s < maxScalar for callers that accept oversized scalars.
function validateMSMScalars(scalars, field, maxScalar) {
if (!Array.isArray(scalars))
throw new Error('array of scalars expected');
scalars.forEach((s, i) => {
if (!field.isValid(s))
const ok = maxScalar === undefined ? field.isValid(s) : isPosBig(s) && s < maxScalar;
if (!ok)
throw new Error('invalid scalar at index ' + i);
});
}
// Since points in different groups cannot be equal (different object constructor),
// we can have single place to store precomputes.
// Allows to make points frozen / immutable.
const pointPrecomputes = new WeakMap();
const pointWindowSizes = new WeakMap();
function getW(P) {
// To disable precomputes:
// return 1;
// `1` is also the uncached sentinel: use the ladder / non-precomputed path.
function getWindowSize(P) {
// `1` is the uncached sentinel: use the non-precomputed (wNAF / fixed-window) path.
return pointWindowSizes.get(P) || 1;
}
function assert0(n) {
// Internal invariant: a non-zero remainder here means the wNAF window decomposition or loop
// count is inconsistent, not that the original caller provided a bad scalar.
/** Table of odd multiples [1P, 3P, ..., (2⋅size−1)P]; width-W wNAF uses size = 2^(W−2). */
function oddMultiples(p, size) {
const dbl = p.double();
const t = [p];
for (let j = 1; j < size; j++)
t.push(t[j - 1].add(dbl));
return t;
}
/**
* Width-W wNAF signed-digit recoding (W >= 2), LSB-first: digits are 0 or odd with
* |digit| < 2^(W−1); nonzero density ~1/(W+1) (a nonzero digit is followed by W−1 zeros).
*/
function wnafDigits(n, W) {
const size = 2 ** W;
const half = size / 2;
const mask = BigInt(size - 1);
const d = [];
while (n > _0n) {
let w = 0;
if (n & _1n) {
w = Number(n & mask); // n mod 2^W, odd
if (w >= half)
w -= size; // signed residue
n -= BigInt(w); // n - w ≡ 0 mod 2^W: next W−1 digits are zero
}
d.push(w);
n >>= _1n;
}
return d;
}
/**
* Fixed-position signed-window recoding for precomputed wNAF: `n = Σ digits[w]⋅2^(w⋅W)` with
* digits in `[−2^(W−1)+1, 2^(W−1)]`. Digit count is fixed by `windows` (callers reserve one
* extra window for the final carry), so recoding length does not depend on the scalar.
*/
function signedWindowDigits(n, W, windows) {
const size = 2 ** W;
const half = size / 2;
const mask = BigInt(size - 1);
const shiftBy = BigInt(W);
const d = [];
for (let w = 0; w < windows; w++) {
let v = Number(n & mask);
n >>= shiftBy;
if (v > half) {
v -= size; // negative digit, carry into the next window
n += _1n;
}
d.push(v);
}
// Internal invariant: leftover bits mean the window count did not cover the scalar.
if (n !== _0n)
throw new Error('invalid wNAF');
throw new Error('invalid wnaf');
return d;
}
/**
* Elliptic curve multiplication of Point by scalar. Fragile.
* Table generation takes **30MB of ram and 10ms on high-end CPU**,
* but may take much longer on slow devices. Actual generation will happen on
* first call of `multiply()`. By default, `BASE` point is precomputed.
* Shared vartime walk over per-scalar wNAF digit streams: one doubling of a single shared
* accumulator per bit position of the longest recoding, one signed table addition per
* nonzero digit. `tables[i]` must hold the odd multiples of the i-th point.
*/
function wnafWalk(zero, tables, digits) {
let max = 0;
for (const d of digits)
max = Math.max(max, d.length);
let acc = zero;
for (let bit = max - 1; bit >= 0; bit--) {
if (bit !== max - 1)
acc = acc.double();
for (let i = 0; i < digits.length; i++) {
const w = digits[i][bit]; // reads past shorter recodings yield undefined, skipped below
if (w) {
const item = tables[i][(Math.abs(w) - 1) >> 1];
acc = acc.add(w < 0 ? item.negate() : item);
}
}
}
return acc;
}
/**
* Elliptic curve multiplication of Point by scalar.
* Routes between cached-table, fixed-window, and one-shot wNAF paths; entry points validate
* their own scalars (`mulCT`/`mulCTBlinded`: `1 <= s < Fn.ORDER`; `mulUnsafe`: up to the
* `Fn.ORDER^4` DoS cap via {@link mulAddUnsafe}).
* Table generation is expensive and happens on first call of `multiply()`
* (or eagerly via `precompute(W, false)`). By default, `BASE` point is precomputed.
*
* Scalars should always be less than curve order: this should be checked inside of a curve itself.
* Creates precomputation tables for fast multiplication:
* - private scalar is split by fixed size windows of W bits
* - every window point is collected from window's table & added to accumulator
* - since windows are different, same point inside tables won't be accessed more than once per calc
* - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)
* - +1 window is neccessary for wNAF
* - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication
*
* TODO: research returning a 2d JS array of windows instead of a single window.
* This would allow windows to be in different memory locations.
* Cached algorithm is signed fixed-window wNAF:
* - table stores, for every window w, the multiples `[1..2^(W−1)]⋅2^(w⋅W)⋅P` — all doublings
* are baked in, so a multiplication is exactly one table addition per window
* - window count is fixed (`ceil(bits/W) + 1`), so the point-operation count is scalar-independent
* (basis of the constant-time path)
* - for a 256-bit curve and W=6: 44⋅32 = 1408 table points, 44 additions per multiply
* - secret scalars are additionally blinded (see {@link ScalarMultiplier.mulCTBlinded}), which
* widens tables by 128 bits
* @param Point - Point constructor.
* @param bits - Scalar bit length.
* @param randomBytes - RNG used for scalar blinding; required by the blinded secret path.
* @example

@@ -183,192 +260,294 @@ * Elliptic curve multiplication of Point by scalar.

* ```ts
* import { wNAF } from '@noble/curves/abstract/curve.js';
* import { ScalarMultiplier } from '@noble/curves/abstract/curve.js';
* import { p256 } from '@noble/curves/nist.js';
* const ladder = new wNAF(p256.Point, p256.Point.Fn.BITS);
* const mul = new ScalarMultiplier(p256.Point);
* ```
*/
export class wNAF {
export class ScalarMultiplier {
Point;
BASE;
ZERO;
Fn;
randomBytes;
wnafPrecomputes = new WeakMap();
baseCanBeBlinded;
bits;
// Parametrized with a given Point class (not individual point)
constructor(Point, bits) {
constructor(Point, randomBytes) {
validatePointCons(Point);
// Probe the RNG once (see {@link probeRandomBytes}): in environments without working
// randomness (e.g. no WebCrypto), shouldBlind() then routes secret multiplication to the
// unblinded constant-time path instead of throwing on every multiply(). The shape of
// returned bytes is still validated on every blinded call, where breakage fails closed.
this.randomBytes = probeRandomBytes(randomBytes, BLIND_BYTES);
this.Point = Point;
this.BASE = Point.BASE;
this.ZERO = Point.ZERO;
this.Fn = Point.Fn;
this.bits = bits;
this.bits = Point.Fn.BITS;
}
// non-const time multiplication ladder
_unsafeLadder(elm, n, p = this.ZERO) {
let d = elm;
while (n > _0n) {
if (n & _1n)
p = p.add(d);
d = d.double();
n >>= _1n;
}
return p;
}
/**
* Creates a wNAF precomputation window. Used for caching.
* Default window size is set by `utils.precompute()` and is equal to 8.
* Number of precomputed points depends on the curve size:
* 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:
* - 𝑊 is the window size
* - 𝑛 is the bitlength of the curve order.
* For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.
* Creates a signed fixed-window wNAF precomputation table: for every window w, the
* multiples `[1..2^(W−1)]⋅2^(w⋅W)⋅P`, flattened. All doublings are baked into the table,
* so cached multiplication is additions-only. `windows = ceil(bits/W) + 1`: the extra
* window absorbs the final carry of signed-digit recoding.
* For a 256-bit curve and W=6, the table is 44⋅32 = 1408 points.
* @param point - Point instance
* @param W - window size
* @returns precomputed point tables flattened to a single array
* @param bits - scalar bitlength the table must cover
*/
precomputeWindow(point, W) {
const { windows, windowSize } = calcWOpts(W, this.bits);
const points = [];
let p = point;
let base = p;
for (let window = 0; window < windows; window++) {
base = p;
points.push(base);
// i=1, bc we skip 0
for (let i = 1; i < windowSize; i++) {
base = base.add(p);
points.push(base);
buildWnafTable(point, W, bits) {
// W needs no re-validation: its only source is setWindowSize(), which enforces
// 1 <= W <= Fn.BITS <= bits (the blinded path only ever widens bits) and caps the
// resulting table at ~2 GiB (sized against the wider blinded layout).
const windows = Math.ceil(bits / W) + 1;
const half = 2 ** (W - 1);
const comp = [];
let base = point;
for (let w = 0; w < windows; w++) {
let acc = base;
for (let i = 0; i < half; i++) {
comp.push(acc);
acc = acc.add(base);
}
p = base.double();
base = comp[comp.length - 1].double(); // 2⋅(2^(W−1)⋅base) = next window's base
}
return points;
return { W, bits, windows, comp };
}
/**
* Implements ec multiplication using precomputed tables and w-ary non-adjacent form.
* More compact implementation:
* https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541
* Implements ec multiplication using precomputed signed fixed-window wNAF tables.
* Constant-time: fixed window count with one table addition per window — zero digits feed
* the fake accumulator — and no doublings; the lookup scans the whole window slice.
* Scalar bounds are validated by the public entry points ({@link ScalarMultiplier.mulCT},
* {@link ScalarMultiplier.mulCTBlinded}, {@link ScalarMultiplier.mulUnsafe});
* signedWindowDigits throws if `n` exceeds the table.
* @returns real and fake (for const-time) points
*/
wNAF(W, precomputes, n) {
// Scalar should be smaller than field order
if (!this.Fn.isValid(n))
throw new Error('invalid scalar');
// Accumulators
wnafCachedCT(precomputes, n) {
const { W, windows, comp } = precomputes;
const half = 2 ** (W - 1);
const digits = signedWindowDigits(n, W, windows);
let p = this.ZERO;
let f = this.BASE;
// This code was first written with assumption that 'f' and 'p' will never be infinity point:
// since each addition is multiplied by 2 ** W, it cannot cancel each other. However,
// there is negate now: it is possible that negated element from low value
// would be the same as high element, which will create carry into next window.
// It's not obvious how this can fail, but still worth investigating later.
const wo = calcWOpts(W, this.bits);
for (let window = 0; window < wo.windows; window++) {
// (n === _0n) is handled and not early-exited. isEven and offsetF are used for noise
const { nextN, offset, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window, wo);
n = nextN;
if (isZero) {
// bits are 0: add garbage to fake point
// Important part for const-time getPublicKey: add random "noise" point to f.
f = f.add(negateCt(isNegF, precomputes[offsetF]));
}
else {
// bits are 1: add to result point
p = p.add(negateCt(isNeg, precomputes[offset]));
}
for (let w = 0; w < windows; w++) {
const digit = digits[w];
const start = w * half;
// Data-oblivious select: touch every entry of the window before the digit branch.
const idx = Math.abs(digit) - 1; // -1 for zero digits: matches nothing, `sel` unused
let sel = comp[start];
for (let i = 1; i < half; i++)
sel = i === idx ? comp[start + i] : sel;
const neg = sel.negate(); // compute both signs; the digit only picks one
if (digit === 0)
f = f.add(comp[start]);
else
p = p.add(digit < 0 ? neg : sel);
}
assert0(n);
// Return both real and fake points so JIT keeps the noise path alive.
// Known caveat: negate/carry interactions can still drive `f` to infinity even when `p` is not,
// which weakens the noise path and leaves this only "less const-time" by about one bigint mul.
return { p, f };
}
/**
* Implements unsafe EC multiplication using precomputed tables
* and w-ary non-adjacent form.
* @param acc - accumulator point to add result of multiplication
* @returns point
*/
wNAFUnsafe(W, precomputes, n, acc = this.ZERO) {
const wo = calcWOpts(W, this.bits);
for (let window = 0; window < wo.windows; window++) {
if (n === _0n)
break; // Early-exit, skip 0 value
const { nextN, offset, isZero, isNeg } = calcOffsets(n, window, wo);
n = nextN;
if (isZero) {
// Window bits are 0: skip processing.
// Move to next window.
continue;
}
else {
const item = precomputes[offset];
acc = acc.add(isNeg ? item.negate() : item); // Re-using acc allows to save adds in MSM
}
}
assert0(n);
return acc;
}
getPrecomputes(W, point, transform) {
// Cache key is only point identity plus the remembered window size; callers must not reuse the
// same point with incompatible `transform(...)` layouts and expect a separate cache entry.
let comp = pointPrecomputes.get(point);
// Cache key is point identity plus (W, bits); at most two entries exist per point (public-width
// `Fn.BITS` and blinded `Fn.BITS + BLIND_BITS`). Callers must not reuse the same point with
// incompatible `transform(...)` layouts and expect a separate cache entry.
getWnafPrecomputes(W, point, bits, transform) {
let entries = this.wnafPrecomputes.get(point);
let comp = entries?.find((entry) => entry.W === W && entry.bits === bits);
if (!comp) {
comp = this.precomputeWindow(point, W);
if (W !== 1) {
// Doing transform outside of if brings 15% perf hit
if (typeof transform === 'function')
comp = transform(comp);
pointPrecomputes.set(point, comp);
comp = this.buildWnafTable(point, W, bits);
if (typeof transform === 'function')
comp = { ...comp, comp: transform(comp.comp) };
if (!entries) {
entries = [];
this.wnafPrecomputes.set(point, entries);
}
entries.push(comp);
}
return comp;
}
cached(point, scalar, transform) {
const W = getW(point);
return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar);
assertPoint(point) {
if (!(point instanceof this.Point))
throw new TypeError('"point" expected Point instance, got type=' + typeof point);
}
unsafe(point, scalar, transform, prev) {
const W = getW(point);
// Shared prologue of the constant-time entry points. Rejects scalar 0: in key/signature-style
// callers a zero scalar means broken upstream plumbing, and concrete Points already reject it.
// Uses inRange instead of Fn.isValidNot0: validateField() only certifies the arithmetic subset.
validateMulInput(point, scalar) {
this.assertPoint(point);
if (!inRange(scalar, _1n, this.Point.Fn.ORDER))
throw new Error('invalid scalar');
}
// Constant-time dispatch shared by mulCT / mulCTBlinded. Un-precomputed points (W===1, e.g.
// ECDH peer keys) skip building a throwaway cached table in favor of a small fixed-window
// multiply. `n` must be < 2^bits.
runCT(point, n, bits, transform) {
const W = getWindowSize(point);
if (W === 1)
return this._unsafeLadder(point, scalar, prev); // For W=1 ladder is ~x2 faster
return this.wNAFUnsafe(W, this.getPrecomputes(W, point, transform), scalar, prev);
return this.fixedWindowCT(point, n, bits);
return this.wnafCachedCT(this.getWnafPrecomputes(W, point, bits, transform), n);
}
// We calculate precomputes for elliptic curve point multiplication
// using windowed method. This specifies window size and
// stores precomputed values. Usually only base point would be precomputed.
createCache(P, W) {
mulCT(point, scalar, transform) {
this.validateMulInput(point, scalar);
return this.runCT(point, scalar, this.bits, transform);
}
mulCTBlinded(point, scalar, transform) {
this.validateMulInput(point, scalar);
// Blinding computes n = scalar + blind*Fn.ORDER, then n*P via a constant-time multiply. This
// equals scalar*P only when Fn.ORDER*P == O; callers guarantee that via shouldBlind() (always
// for cofactor-1 curves; for cofactored curves only BASE, and only after checking BASE*n == O).
// Fail before building the (large) precompute table if randomness is unavailable.
if (this.randomBytes === undefined)
throw new Error('randomBytes is required for scalar blinding');
const bits = this.Point.Fn.BITS + BLIND_BITS;
const blind = this.randomBytes(BLIND_BYTES);
if (!isBytes(blind) || blind.length !== BLIND_BYTES)
throw new Error('randomBytes returned invalid byte array');
// Force the top two bits of the 128-bit blind to 10xxxxxx, so blind is in [2^127, 1.5*2^127):
// * `| 0x80` (bit 127 = 1) is the load-bearing part: it guarantees blind >= 2^127, so the blind
// is always a full-width, nonzero factor and the scalar is masked even with a degenerate RNG.
// * `& 0x3f` (bit 126 = 0) is a safety margin: it caps blind < 1.5*2^127, keeping
// blind*Fn.ORDER + scalar < 0.75*2^(nBits+128), i.e. ~half a window below the 2^(nBits+128)
// ceiling. Not strictly required for the bound (see below), but it reserves headroom so the
// guarantee does not rest on the tight `Fn.ORDER < 2^Fn.BITS` fact and the final carry window
// only ever holds a small carry, never a full digit.
blind[0] = (blind[0] & 0x3f) | 0x80;
// Even at the extreme (blind < 2^128, scalar < Fn.ORDER < 2^nBits): n <= 2^128*Fn.ORDER - 1 <
// 2^(nBits+128), so n stays below 2^bits and within the blinded table's
// window count. Both cached CT kernels run a fixed number of windows/rows with one point-add
// each, so the add count is independent of scalar (constant-time).
const n = scalar + bytesToNumberBE(blind) * this.Point.Fn.ORDER;
return this.runCT(point, n, bits, transform);
}
/**
* Constant-time multiplication `n*point` for an un-precomputed point, via a small fixed window.
* A cached wNAF table only pays off when reused; a flat 2^FW_WINDOW table (`size-1` adds) is
* far cheaper to build for a single use. The point-operation sequence is independent of `n`:
* build the table, then per window exactly FW_WINDOW doublings, a data-oblivious scan over
* every table entry, and one addition (adds the identity when the window digit is 0 — never
* skipped).
*
* `n` must be `< 2^bits`. Assumes complete addition (adding the identity costs the same as any
* add), which holds for the Weierstrass/Edwards point types used here. The table is left in
* projective form (no normalizeZ): normalizing this small a table costs more than the
* mixed-add savings it would buy for a single multiply.
* @returns real point `p`; `f` duplicates it only to match {@link wnafCachedCT}'s return shape
* (this path needs no fake accumulator — its op-count is already scalar-independent).
*/
fixedWindowCT(point, n, bits) {
const W = FW_WINDOW;
const size = 1 << W;
const mask = bitMask(W);
// Flat table [O, point, 2*point, ..., (size-1)*point].
const table = new Array(size);
table[0] = this.ZERO;
for (let i = 1; i < size; i++)
table[i] = table[i - 1].add(point);
// Horner MSB->LSB. windows*W >= bits and n < 2^bits, so every bit of n is consumed.
const windows = Math.ceil(bits / W);
let acc = this.ZERO;
for (let window = windows - 1; window >= 0; window--) {
// W doublings per window; skipped for the first (topmost) window, where acc is still the
// identity. The skip is scalar-independent: it depends only on the loop index.
if (window !== windows - 1)
for (let d = 0; d < W; d++)
acc = acc.double();
const digit = Number((n >> BigInt(window * W)) & mask);
// Data-oblivious select: touch every entry, same as wnafCachedCT.
let sel = table[0];
for (let i = 1; i < size; i++)
sel = i === digit ? table[i] : sel;
acc = acc.add(sel); // one add per window, even for digit 0
}
return { p: acc, f: acc };
}
shouldBlind(point, cofactor) {
// No usable RNG (probed in the constructor): blinding is impossible, use the plain CT path.
if (this.randomBytes === undefined)
return false;
if (cofactor === _1n)
return true;
if (point !== this.BASE)
return false;
if (this.baseCanBeBlinded === undefined)
this.baseCanBeBlinded = this.mulUnsafe(this.BASE, this.Point.Fn.ORDER).is0();
return this.baseCanBeBlinded;
}
mulSecret(point, scalar, cofactor, transform) {
return this.shouldBlind(point, cofactor)
? this.mulCTBlinded(point, scalar, transform)
: this.mulCT(point, scalar, transform);
}
mulUnsafe(point, scalar, transform) {
this.assertPoint(point);
if (!isPosBig(scalar))
throw new Error('invalid scalar');
const W = getWindowSize(point);
// W === 1 (un-precomputed): one-shot width-4 wNAF via {@link mulAddUnsafe} with L=1 —
// a cached table would be thrown away after one use. `allowOversized` swaps the
// `s < Fn.ORDER` check for mulAddUnsafe's `Fn.ORDER^4` DoS cap.
//
// Oversized scalar could happen when:
// a) user passes large scalar on their own (rare)
// b) `assertValidity()` calls `isTorsionFree()`, which multiplies point by `Fn.ORDER`
if (W === 1 || scalar >= this.Point.Fn.ORDER)
return mulAddUnsafe(this.Point, [point], [scalar], true);
// Precomputed points reuse the CT kernel (fake accumulator discarded): with W=6 only
// ~1/64 of window-adds are skippable, so a dedicated vartime kernel saved just ~6% on
// this path while doubling the cached-table code surface.
const precomputes = this.getWnafPrecomputes(W, point, this.bits, transform);
return this.wnafCachedCT(precomputes, scalar).p;
}
// Remembers the window size used for precomputed wNAF multiplication of the given point
// and drops any previously built tables. Usually only the base point is precomputed.
// W=1 resets the point to the un-precomputed (table-less) paths.
// W is additionally capped so tables stay under ~2 GiB ({@link TABLE_BYTES_MAX}).
setWindowSize(point, W) {
this.assertPoint(point);
validateW(W, this.bits);
pointWindowSizes.set(P, W);
pointPrecomputes.delete(P);
// Size against the widest table this W can produce: the blinded path adds BLIND_BITS.
const windows = Math.ceil((this.bits + BLIND_BITS) / W) + 1;
validateTableBytes(windows * 2 ** (W - 1), this.Point.Fp.BYTES);
pointWindowSizes.set(point, W);
this.wnafPrecomputes.delete(point);
}
hasCache(elm) {
return getW(elm) !== 1;
// True when a window size is set: tables themselves are built lazily on first multiply.
hasWindowSize(point) {
return getWindowSize(point) !== 1;
}
}
/**
* Endomorphism-specific multiplication for Koblitz curves.
* Cost: 128 dbl, 0-256 adds.
* @param Point - Point constructor.
* @param point - Input point.
* @param k1 - First non-negative absolute scalar chunk.
* @param k2 - Second non-negative absolute scalar chunk.
* @returns Partial multiplication results.
* Combined multi-scalar multiplication `Σ scalars[i]⋅points[i]` via interleaved width-4 wNAF
* (Strauss–Shamir). Every input gets its own table of odd multiples `[1P, 3P, 5P, 7P]` and
* signed-digit recoding, but all walks share one doubling chain, so total cost is
* `~bits` doublings + `L⋅bits/5` additions instead of `L⋅bits` doublings for separate
* multiplications. Intended for the 2-4 point shapes of signature verification
* (`R = u1⋅G + u2⋅P`); use {@link pippenger} for larger batches.
*
* Not constant-time: only for public inputs. Scalars must satisfy `0 <= s < Fn.ORDER`;
* fold negative signs into the points before calling.
* @param c - Point constructor.
* @param points - Array of curve points.
* @param scalars - Array of non-negative scalars, same length as points.
* @param allowOversized - Replace the `s < Fn.ORDER` scalar check with a `Fn.ORDER^4` DoS cap.
* Off by default. For scalars that must NOT be reduced mod ORDER: torsion checks
* (`Fn.ORDER⋅P ≟ O`) and cofactor-clearing multiples. Walk length grows with `bitLen(s)`.
* @returns Combined multiplication result; identity for empty input.
* @throws If the point set or scalar set is invalid. {@link Error}
* @example
* Endomorphism-specific multiplication for Koblitz curves.
* Combined multi-scalar multiplication via Strauss–Shamir.
*
* ```ts
* import { mulEndoUnsafe } from '@noble/curves/abstract/curve.js';
* import { secp256k1 } from '@noble/curves/secp256k1.js';
* const parts = mulEndoUnsafe(secp256k1.Point, secp256k1.Point.BASE, 3n, 5n);
* import { mulAddUnsafe } from '@noble/curves/abstract/curve.js';
* import { p256 } from '@noble/curves/nist.js';
* const G = p256.Point.BASE;
* const R = mulAddUnsafe(p256.Point, [G, G.double()], [2n, 3n]); // 2⋅G + 3⋅(2⋅G)
* ```
*/
export function mulEndoUnsafe(Point, point, k1, k2) {
let acc = point;
let p1 = Point.ZERO;
let p2 = Point.ZERO;
while (k1 > _0n || k2 > _0n) {
if (k1 & _1n)
p1 = p1.add(acc);
if (k2 & _1n)
p2 = p2.add(acc);
acc = acc.double();
k1 >>= _1n;
k2 >>= _1n;
}
return { p1, p2 };
export function mulAddUnsafe(c, points, scalars, allowOversized = false) {
validatePointCons(c);
validateMSMPoints(points, c);
abool(allowOversized, 'allowOversized');
// Oversized cap is ORDER^4: hard bound to mitigate DoS, walk length grows with bitLen(s).
validateMSMScalars(scalars, c.Fn, allowOversized ? c.Fn.ORDER ** _4n : undefined);
if (points.length !== scalars.length)
throw new Error('arrays of points and scalars must have equal length');
const tables = points.map((p) => oddMultiples(p, 4));
const digits = scalars.map((n) => wnafDigits(n, 4));
return wnafWalk(c.ZERO, tables, digits);
}

@@ -379,3 +558,9 @@ /**

* For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL.
* Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0.
* Point-operation count is scalar-independent (for same L), even when 1 point + scalar, or when
* scalar = 0 — but bucket indices are scalar windows, so the memory-access pattern is
* scalar-dependent: do not rely on this for secret scalars.
*
* A repaired LFG bucket-set variant from ePrint 2024/750 was benchmarked on BLS12-381 G1
* against this implementation: ~1.4x faster at 2048 points and ~1.1-1.25x faster at
* 4096-32768 points, at the cost of extra recoding and multiplier-table complexity.
* @param c - Curve Point constructor

@@ -396,8 +581,4 @@ * @param points - array of L curve points

export function pippenger(c, points, scalars) {
// If we split scalars by some window (let's say 8 bits), every chunk will only
// take 256 buckets even if there are 4096 scalars, also re-uses double.
// TODO:
// - https://eprint.iacr.org/2024/750.pdf
// - https://tches.iacr.org/index.php/TCHES/article/view/10287
// 0 is accepted in scalars
validatePointCons(c);
const fieldN = c.Fn;

@@ -410,4 +591,6 @@ validateMSMPoints(points, c);

throw new Error('arrays of points and scalars must have equal length');
// if (plength === 0) throw new Error('array must be of length >= 2');
const zero = c.ZERO;
// Without this, the window loop below would still run ~Fn.BITS doublings of ZERO.
if (plength === 0)
return zero;
const wbits = bitLen(BigInt(plength));

@@ -446,90 +629,45 @@ let windowSize = 1; // bits

/**
* Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
* Interleaved wNAF multi-scalar multiplication (MSM, Pa + Qb + Rc + ...) over a FIXED set
* of points: each point gets a one-time table of odd multiples
* `[1P, 3P, ..., (2^(W−1)−1)P]`, and the returned closure evaluates MSMs against those
* tables. All scalars share one doubling chain (Straus 1964) — one doubling per scalar bit
* plus one signed table addition per nonzero width-W wNAF digit (density ~1/(W+1)) — the
* "interleaving" method of Möller, "Algorithms for multi-exponentiation" (SAC 2001).
*
* Table memory is `L⋅2^(W−2)` points, capped at ~2 GiB. Prefer this over {@link pippenger}
* when the same points are reused across many MSMs (fixed-base commitments etc.) and up to a
* few hundred points; prefer pippenger for one-shot MSMs or thousands of points, where
* bucketing beats per-point tables.
*
* Not constant-time (zero digits are skipped): public inputs only.
* @param c - Curve Point constructor
* @param points - array of L curve points
* @param windowSize - Precompute window size.
* @returns Function which multiplies points with scalars. The closure accepts
* `scalars.length <= points.length`, and omitted trailing scalars are treated as zero.
* @param points - array of L curve points, captured by the returned closure
* @param windowSize - window width W in bits, from 2 to Fn.BITS; also capped so the
* per-closure tables stay under ~2 GiB
* @returns Function which multiplies points with scalars. The closure accepts at most
* `points.length` scalars, and omitted trailing scalars are treated as zero.
* @throws If the point set or precompute window is invalid. {@link Error}
* @example
* Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
* Interleaved wNAF multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
*
* ```ts
* import { precomputeMSMUnsafe } from '@noble/curves/abstract/curve.js';
* import { interleavedMSMUnsafe } from '@noble/curves/abstract/curve.js';
* import { p256 } from '@noble/curves/nist.js';
* const msm = precomputeMSMUnsafe(p256.Point, [p256.Point.BASE], 4);
* const msm = interleavedMSMUnsafe(p256.Point, [p256.Point.BASE], 4);
* const point = msm([3n]);
* ```
*/
export function precomputeMSMUnsafe(c, points, windowSize) {
/**
* Performance Analysis of Window-based Precomputation
*
* Base Case (256-bit scalar, 8-bit window):
* - Standard precomputation requires:
* - 31 additions per scalar × 256 scalars = 7,936 ops
* - Plus 255 summary additions = 8,191 total ops
* Note: Summary additions can be optimized via accumulator
*
* Chunked Precomputation Analysis:
* - Using 32 chunks requires:
* - 255 additions per chunk
* - 256 doublings
* - Total: (255 × 32) + 256 = 8,416 ops
*
* Memory Usage Comparison:
* Window Size | Standard Points | Chunked Points
* ------------|-----------------|---------------
* 4-bit | 520 | 15
* 8-bit | 4,224 | 255
* 10-bit | 13,824 | 1,023
* 16-bit | 557,056 | 65,535
*
* Key Advantages:
* 1. Enables larger window sizes due to reduced memory overhead
* 2. More efficient for smaller scalar counts:
* - 16 chunks: (16 × 255) + 256 = 4,336 ops
* - ~2x faster than standard 8,191 ops
*
* Limitations:
* - Not suitable for plain precomputes (requires 256 constant doublings)
* - Performance degrades with larger scalar counts:
* - Optimal for ~256 scalars
* - Less efficient for 4096+ scalars (Pippenger preferred)
*/
export function interleavedMSMUnsafe(c, points, windowSize) {
validatePointCons(c);
const fieldN = c.Fn;
validateW(windowSize, fieldN.BITS);
// Signed odd digits need at least width 2 (W=2 is plain NAF with a single-entry table).
validateW(windowSize, fieldN.BITS, 2);
validateMSMPoints(points, c);
const zero = c.ZERO;
const tableSize = 2 ** windowSize - 1; // table size (without zero)
const chunks = Math.ceil(fieldN.BITS / windowSize); // chunks of item
const MASK = bitMask(windowSize);
const tables = points.map((p) => {
const res = [];
for (let i = 0, acc = p; i < tableSize; i++) {
res.push(acc);
acc = acc.add(p);
}
return res;
});
validateTableBytes(points.length * 2 ** (windowSize - 2), c.Fp.BYTES);
const tables = points.map((p) => oddMultiples(p, 2 ** (windowSize - 2)));
return (scalars) => {
validateMSMScalars(scalars, fieldN);
if (scalars.length > points.length)
throw new Error('array of scalars must be smaller than array of points');
let res = zero;
for (let i = 0; i < chunks; i++) {
// No need to double if accumulator is still zero.
if (res !== zero)
for (let j = 0; j < windowSize; j++)
res = res.double();
const shiftBy = BigInt(chunks * windowSize - (i + 1) * windowSize);
for (let j = 0; j < scalars.length; j++) {
const n = scalars[j];
const curr = Number((n >> shiftBy) & MASK);
if (!curr)
continue; // skip zero scalars chunks
res = res.add(tables[j][curr - 1]);
}
}
return res;
throw new Error('array of scalars must not be larger than array of points');
return wnafWalk(c.ZERO, tables, scalars.map((n) => wnafDigits(n, windowSize)));
};

@@ -557,3 +695,3 @@ }

* @param CURVE - Curve parameters.
* @param curveOpts - Optional field overrides:
* @param curveOpts - Optional field overrides. See {@link FpFn}:
* - `Fp` (optional): Optional base-field override.

@@ -580,2 +718,4 @@ * - `Fn` (optional): Optional scalar-field override.

export function createCurveFields(type, CURVE, curveOpts = {}, FpFnLE) {
if (type !== 'weierstrass' && type !== 'edwards')
throw new Error('expected curve type "weierstrass" or "edwards"');
if (FpFnLE === undefined)

@@ -585,5 +725,7 @@ FpFnLE = type === 'edwards';

throw new Error(`expected valid ${type} CURVE object`);
// Validate before reading Fp/Fn so explicit null fails with an options-object error.
validateObject(curveOpts);
for (const p of ['p', 'n', 'h']) {
const val = CURVE[p];
if (!(typeof val === 'bigint' && val > _0n))
if (!(isPosBig(val) && val !== _0n))
throw new Error(`CURVE.${p} must be positive bigint`);

@@ -623,2 +765,1 @@ }

}
//# sourceMappingURL=curve.js.map

@@ -92,2 +92,4 @@ /**

};
/** RNG override used for scalar blinding. */
randomBytes: (bytesLength?: number) => TRet<Uint8Array>;
}>;

@@ -111,2 +113,6 @@ /**

mapToCurve: (scalar: bigint[]) => AffinePoint<bigint>;
/** Optional conversion from this Edwards curve to a birational/isogenous Montgomery curve. */
toMontgomery: (point: EdwardsPoint) => TRet<Uint8Array>;
/** Optional secret-key conversion for the same Montgomery curve as `toMontgomery`. */
toMontgomerySecret: (secretKey: TArg<Uint8Array>) => TRet<Uint8Array>;
/** Optional prehash function used before signing or verifying messages. */

@@ -158,2 +164,4 @@ prehash: FHash;

* - `zip215` (optional): Whether to accept ZIP-215 encodings.
* @throws Malformed argument or option types may throw; `false` means well-formed inputs
* failed verification. {@link Error}
* @returns Whether the signature is valid.

@@ -180,2 +188,3 @@ */

* Converts ed public key to x public key.
* Throws when the Edwards curve has no supported Montgomery conversion.
*

@@ -200,2 +209,3 @@ * There is NO `fromMontgomery`:

* Converts ed secret key to x secret key.
* Throws when the Edwards curve has no supported Montgomery conversion.
* @example

@@ -232,3 +242,3 @@ * Converts ed secret key to x secret key.

* validation here adds about 10-15ms to heavyweight imports like ed448.
* The returned constructor also eagerly marks `Point.BASE` for W=8
* The returned constructor also eagerly marks `Point.BASE` for W=6
* precompute caching. Some code paths still assume

@@ -326,2 +336,1 @@ * `Fp.BYTES === Fn.BYTES`, so mismatched byte lengths are not fully audited here.

export declare function eddsa(Point: EdwardsPointCons, cHash: TArg<FHash>, eddsaOpts?: TArg<EdDSAOpts>): EdDSA;
//# sourceMappingURL=edwards.d.ts.map

@@ -9,7 +9,7 @@ /**

import { abool, abytes, aInRange, asafenumber, bytesToHex, bytesToNumberLE, concatBytes, copyBytes, hexToBytes, isBytes, notImplemented, validateObject, randomBytes as wcRandomBytes, } from "../utils.js";
import { createCurveFields, createKeygen, normalizeZ, wNAF, } from "./curve.js";
import {} from "./modular.js";
import { createCurveFields, createKeygen, normalizeZ, ScalarMultiplier, validatePointCons, } from "./curve.js";
import { FpLegendre } from "./modular.js";
// Be friendly to bad ECMAScript parsers by not using bigint literals
// prettier-ignore
const _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _8n = /* @__PURE__ */ BigInt(8);
const _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _4n = /* @__PURE__ */ BigInt(4), _8n = /* @__PURE__ */ BigInt(8);
// Affine Edwards-equation check only; this does not prove subgroup membership, canonical

@@ -32,3 +32,3 @@ // encoding, prime-order base-point requirements, or identity exclusion.

* validation here adds about 10-15ms to heavyweight imports like ed448.
* The returned constructor also eagerly marks `Point.BASE` for W=8
* The returned constructor also eagerly marks `Point.BASE` for W=6
* precompute caching. Some code paths still assume

@@ -47,2 +47,3 @@ * `Fp.BYTES === Fn.BYTES`, so mismatched byte lengths are not fully audited here.

export function edwards(params, extraOpts = {}) {
validateObject(extraOpts, {}, {}, 'extraOpts');
const opts = extraOpts;

@@ -53,9 +54,20 @@ const validated = createCurveFields('edwards', params, opts, opts.FpFnLE);

const { h: cofactor } = CURVE;
validateObject(opts, {}, { uvRatio: 'function' });
// Important:
// There are some places where Fp.BYTES is used instead of nByteLength.
// So far, everything has been tested with curves of Fp.BYTES == nByteLength.
// TODO: test and find curves which behave otherwise.
const MASK = _2n << (BigInt(Fn.BYTES * 8) - _1n);
const modP = (n) => Fp.create(n); // Function overrides
// The unified add-2008-hwcd formulas (see EdwardsPoint.add/double) are complete —
// exception-free for every input pair — only when a is a square and d a non-square in Fp
// (Bernstein–Birkner–Joye–Lange–Peters, "Twisted Edwards curves", thm 3.3). The constant-time
// kernels in curve.ts assume completeness, so an incomplete curve could silently produce
// wrong results on exceptional inputs. Fail construction instead.
if (FpLegendre(Fp, CURVE.a) !== 1)
throw new Error('edwards: CURVE.a must be a square in Fp for complete addition formulas');
if (FpLegendre(Fp, CURVE.d) !== -1)
throw new Error('edwards: CURVE.d must be a non-square in Fp for complete addition formulas');
validateObject(opts, {}, { uvRatio: 'function', randomBytes: 'function' });
const randomBytes = opts.randomBytes === undefined ? wcRandomBytes : opts.randomBytes;
// Coordinate and ZIP-215 bounds follow the base-field byte container, not scalar bytes.
const MASK = _2n << (BigInt(Fp.BYTES * 8) - _1n);
function isOdd(n) {
if (!Fp.isOdd)
throw new Error('Field does not have .isOdd()');
return Fp.isOdd(n);
}
// sqrt(u/v)

@@ -76,2 +88,8 @@ const uvRatio = opts.uvRatio === undefined

throw new Error('bad curve params: generator point');
// Multiplication by param `a` sits on the double() / add() hot paths. For the common twists
// a=-1 (ed25519, jubjub) and a=1 (ed448) the full field multiplication is replaced with
// negation / identity. Selection depends only on public curve constants.
const mulA = Fp.eql(CURVE.a, Fp.neg(Fp.ONE)) ? (x) => Fp.neg(x)
: Fp.eql(CURVE.a, Fp.ONE) ? (x) => x
: (x) => Fp.mul(CURVE.a, x); // prettier-ignore
/**

@@ -93,9 +111,5 @@ * Asserts coordinate is valid: 0 <= n < MASK.

class Point {
// base / generator point
static BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy));
// zero / infinity / identity point
static ZERO = new Point(_0n, _1n, _1n, _0n); // 0, 1, 1, 0
// math field
static BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE, Fp.mul(CURVE.Gx, CURVE.Gy));
static ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ONE, Fp.ZERO);
static Fp = Fp;
// scalar field
static Fn = Fn;

@@ -127,3 +141,3 @@ X;

acoord('y', y);
return new Point(x, y, _1n, modP(x * y));
return new Point(x, y, Fp.ONE, Fp.mul(x, y));
}

@@ -148,15 +162,15 @@ // Uses algo from RFC8032 5.1.3.

// ax²+y²=1+dx²y² => y²-1=dx²y²-ax² => y²-1=x²(dy²-a) => x²=(y²-1)/(dy²-a)
const y2 = modP(y * y); // denominator is always non-0 mod p.
const u = modP(y2 - _1n); // u = y² - 1
const v = modP(d * y2 - a); // v = d y² + 1.
const y2 = Fp.sqr(y); // denominator is always non-0 mod p.
const u = Fp.sub(y2, Fp.ONE); // u = y² - 1
const v = Fp.sub(Fp.mulN(d, y2), a); // v = d y² - a.
let { isValid, value: x } = uvRatio(u, v); // √(u/v)
if (!isValid)
throw new Error('bad point: invalid y coordinate');
const isXOdd = (x & _1n) === _1n; // There are 2 square roots. Use x_0 bit to select proper
const isXOdd = isOdd(x); // There are 2 square roots. Use x_0 bit to select proper
const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit
if (!zip215 && x === _0n && isLastByteOdd)
if (!zip215 && Fp.is0(x) && isLastByteOdd)
// if x=0 and x_0 = 1, fail
throw new Error('bad point: x=0 and x_0=1');
if (isLastByteOdd !== isXOdd)
x = modP(-x); // if x_0 != x mod 2, set x = p-x
x = Fp.neg(x); // if x_0 != x mod 2, set x = p-x
return Point.fromAffine({ x, y });

@@ -173,4 +187,4 @@ }

}
precompute(windowSize = 8, isLazy = true) {
wnaf.createCache(this, windowSize);
precompute(windowSize = 6, isLazy = true) {
wnaf.setWindowSize(this, windowSize);
if (!isLazy)

@@ -193,15 +207,15 @@ this.multiply(_2n); // random number

const { X, Y, Z, T } = p;
const X2 = modP(X * X); // X²
const Y2 = modP(Y * Y); // Y²
const Z2 = modP(Z * Z); // Z²
const Z4 = modP(Z2 * Z2); // Z⁴
const aX2 = modP(X2 * a); // aX²
const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z²
const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y²
if (left !== right)
const X2 = Fp.sqr(X); // X²
const Y2 = Fp.sqr(Y); // Y²
const Z2 = Fp.sqr(Z); // Z²
const Z4 = Fp.sqr(Z2); // Z⁴
const aX2 = Fp.mul(X2, a); // aX²
const left = Fp.mul(Fp.add(aX2, Y2), Z2); // (aX² + Y²)Z²
const right = Fp.add(Z4, Fp.mul(d, Fp.mul(X2, Y2))); // Z⁴ + dX²Y²
if (!Fp.eql(left, right))
throw new Error('bad point: equation left != right (1)');
// In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T
const XY = modP(X * Y);
const ZT = modP(Z * T);
if (XY !== ZT)
const XY = Fp.mul(X, Y);
const ZT = Fp.mul(Z, T);
if (!Fp.eql(XY, ZT))
throw new Error('bad point: equation left != right (2)');

@@ -214,7 +228,7 @@ }

const { X: X2, Y: Y2, Z: Z2 } = other;
const X1Z2 = modP(X1 * Z2);
const X2Z1 = modP(X2 * Z1);
const Y1Z2 = modP(Y1 * Z2);
const Y2Z1 = modP(Y2 * Z1);
return X1Z2 === X2Z1 && Y1Z2 === Y2Z1;
const X1Z2 = Fp.mul(X1, Z2);
const X2Z1 = Fp.mul(X2, Z1);
const Y1Z2 = Fp.mul(Y1, Z2);
const Y2Z1 = Fp.mul(Y2, Z1);
return Fp.eql(X1Z2, X2Z1) && Fp.eql(Y1Z2, Y2Z1);
}

@@ -226,3 +240,3 @@ is0() {

// Flips point sign to a negative one (-x, y in affine coords)
return new Point(modP(-this.X), this.Y, this.Z, modP(-this.T));
return new Point(Fp.neg(this.X), this.Y, this.Z, Fp.neg(this.T));
}

@@ -233,17 +247,16 @@ // Fast algo for doubling Extended Point.

double() {
const { a } = CURVE;
const { X: X1, Y: Y1, Z: Z1 } = this;
const A = modP(X1 * X1); // A = X12
const B = modP(Y1 * Y1); // B = Y12
const C = modP(_2n * modP(Z1 * Z1)); // C = 2*Z12
const D = modP(a * A); // D = a*A
const x1y1 = X1 + Y1;
const E = modP(modP(x1y1 * x1y1) - A - B); // E = (X1+Y1)2-A-B
const G = D + B; // G = D+B
const F = G - C; // F = G-C
const H = D - B; // H = D-B
const X3 = modP(E * F); // X3 = E*F
const Y3 = modP(G * H); // Y3 = G*H
const T3 = modP(E * H); // T3 = E*H
const Z3 = modP(F * G); // Z3 = F*G
const A = Fp.sqr(X1); // A = X12
const B = Fp.sqr(Y1); // B = Y12
const C = Fp.mul(Fp.sqr(Z1), _2n); // C = 2*Z12
const D = mulA(A); // D = a*A
const x1y1 = Fp.addN(X1, Y1);
const E = Fp.sub(Fp.subN(Fp.sqr(x1y1), A), B); // E = (X1+Y1)2-A-B
const G = Fp.addN(D, B); // G = D+B
const F = Fp.subN(G, C); // F = G-C
const H = Fp.subN(D, B); // H = D-B
const X3 = Fp.mul(E, F); // X3 = E*F
const Y3 = Fp.mul(G, H); // Y3 = G*H
const T3 = Fp.mul(E, H); // T3 = E*H
const Z3 = Fp.mul(F, G); // Z3 = F*G
return new Point(X3, Y3, Z3, T3);

@@ -256,17 +269,18 @@ }

aedpoint(other);
const { a, d } = CURVE;
const { d } = CURVE;
const { X: X1, Y: Y1, Z: Z1, T: T1 } = this;
const { X: X2, Y: Y2, Z: Z2, T: T2 } = other;
const A = modP(X1 * X2); // A = X1*X2
const B = modP(Y1 * Y2); // B = Y1*Y2
const C = modP(T1 * d * T2); // C = T1*d*T2
const D = modP(Z1 * Z2); // D = Z1*Z2
const E = modP((X1 + Y1) * (X2 + Y2) - A - B); // E = (X1+Y1)*(X2+Y2)-A-B
const F = D - C; // F = D-C
const G = D + C; // G = D+C
const H = modP(B - a * A); // H = B-a*A
const X3 = modP(E * F); // X3 = E*F
const Y3 = modP(G * H); // Y3 = G*H
const T3 = modP(E * H); // T3 = E*H
const Z3 = modP(F * G); // Z3 = F*G
const A = Fp.mul(X1, X2); // A = X1*X2
const B = Fp.mul(Y1, Y2); // B = Y1*Y2
const C = Fp.mul(Fp.mulN(T1, d), T2); // C = T1*d*T2
const D = Fp.mul(Z1, Z2); // D = Z1*Z2
// E = (X1+Y1)*(X2+Y2)-A-B
const E = Fp.sub(Fp.subN(Fp.mulN(Fp.addN(X1, Y1), Fp.addN(X2, Y2)), A), B);
const F = Fp.subN(D, C); // F = D-C
const G = Fp.addN(D, C); // G = D+C
const H = Fp.sub(B, mulA(A)); // H = B-a*A
const X3 = Fp.mul(E, F); // X3 = E*F
const Y3 = Fp.mul(G, H); // Y3 = G*H
const T3 = Fp.mul(E, H); // T3 = E*H
const Z3 = Fp.mul(F, G); // Z3 = F*G
return new Point(X3, Y3, Z3, T3);

@@ -288,4 +302,4 @@ }

throw new RangeError('invalid scalar: expected 1 <= sc < curve.n');
const { p, f } = wnaf.cached(this, scalar, (p) => normalizeZ(Point, p));
return normalizeZ(Point, [p, f])[0];
const { p, f } = wnaf.mulSecret(this, scalar, cofactor, normalize);
return normalize([p, f])[0];
}

@@ -305,3 +319,3 @@ // Non-constant-time multiplication. Uses double-and-add algorithm.

return this;
return wnaf.unsafe(this, scalar, (p) => normalizeZ(Point, p));
return wnaf.mulUnsafe(this, scalar, normalize);
}

@@ -318,3 +332,3 @@ // Checks if point is of small order.

isTorsionFree() {
return wnaf.unsafe(this, CURVE.n).is0();
return wnaf.mulUnsafe(this, CURVE.n).is0();
}

@@ -326,12 +340,14 @@ // Converts Extended point to default (x, y) coordinates.

let iz = invertedZ;
if (iz != null && typeof iz !== 'bigint')
throw new TypeError('"invertedZ" expected bigint, got type=' + typeof iz);
const { X, Y, Z } = p;
const is0 = p.is0();
if (iz == null)
iz = is0 ? _8n : Fp.inv(Z); // 8 was chosen arbitrarily
const x = modP(X * iz);
const y = modP(Y * iz);
iz = is0 ? Fp.create(_8n) : Fp.inv(Z);
const x = Fp.mul(X, iz);
const y = Fp.mul(Y, iz);
const zz = Fp.mul(Z, iz);
if (is0)
return { x: _0n, y: _1n };
if (zz !== _1n)
return { x: Fp.ZERO, y: Fp.ONE };
if (!Fp.eql(zz, Fp.ONE))
throw new Error('invZ was invalid');

@@ -343,2 +359,9 @@ return { x, y };

return this;
// 2.8-3.8x speed-up vs naive
if (cofactor === _2n)
return this.double();
if (cofactor === _4n)
return this.double().double();
if (cofactor === _8n)
return this.double().double().double();
return this.multiplyUnsafe(cofactor);

@@ -352,3 +375,3 @@ }

// When compressing, it's enough to store y and use the last byte to encode sign of x
bytes[bytes.length - 1] |= x & _1n ? 0x80 : 0;
bytes[bytes.length - 1] |= isOdd(x) ? 0x80 : 0;
return bytes;

@@ -363,3 +386,2 @@ }

}
const wnaf = new wNAF(Point, Fn.BITS);
// Keep constructor work cheap: subgroup/generator validation belongs to the caller's curve

@@ -374,6 +396,8 @@ // parameters, and doing the extra checks here adds about 10-15ms to heavy module imports.

// }
// Tiny toy curves can have scalar fields narrower than 8 bits. Skip the
// eager W=8 cache there instead of rejecting an otherwise valid constructor.
if (Fn.BITS >= 8)
Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms.
const normalize = (points) => normalizeZ(Point, points);
const wnaf = new ScalarMultiplier(Point, randomBytes);
// Enable W=6 wNAF precomputes. Slows down first publicKey computation.
// Disable for tiny toy curves, with scalar fields < 6 bits.
if (wnaf.bits >= 6)
Point.BASE.precompute(6);
Object.freeze(Point.prototype);

@@ -509,2 +533,3 @@ Object.freeze(Point);

export function eddsa(Point, cHash, eddsaOpts = {}) {
validatePointCons(Point);
if (typeof cHash !== 'function')

@@ -521,2 +546,4 @@ throw new Error('"hash" function param is required');

mapToCurve: 'function',
toMontgomery: 'function',
toMontgomerySecret: 'function',
});

@@ -535,2 +562,4 @@ const { prehash } = opts;

const randomBytes = opts.randomBytes === undefined ? wcRandomBytes : opts.randomBytes;
const toMontgomery = opts.toMontgomery;
const toMontgomerySecret = opts.toMontgomerySecret;
const adjustScalarBytes = opts.adjustScalarBytes === undefined

@@ -584,2 +613,3 @@ ? (bytes) => bytes

function sign(msg, secretKey, options = {}) {
validateObject(options, {}, {}, 'options');
msg = abytes(msg, undefined, 'message');

@@ -612,2 +642,4 @@ if (prehash)

function verify(sig, msg, publicKey, options = verifyOpts) {
// Validate before destructuring so explicit null follows the standard options error.
validateObject(options);
// Preserve the wrapper-selected default for `{}` / `{ zip215: undefined }`, not just omitted opts.

@@ -683,25 +715,12 @@ const { context } = options;

isValidPublicKey,
/**
* Converts ed public key to x public key. Uses formula:
* - ed25519:
* - `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)`
* - `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))`
* - ed448:
* - `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)`
* - `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))`
*/
/** Converts an Edwards public key to a companion Montgomery public key. */
toMontgomery(publicKey) {
const { y } = Point.fromBytes(publicKey);
const size = lengths.publicKey;
const is25519 = size === 32;
if (!is25519 && size !== 57)
throw new Error('only defined for 25519 and 448');
const u = is25519 ? Fp.div(_1n + y, _1n - y) : Fp.div(y - _1n, y + _1n);
return Fp.toBytes(u);
if (toMontgomery === undefined)
throw new Error('Montgomery conversion is not supported for this curve');
return toMontgomery(Point.fromBytes(publicKey));
},
toMontgomerySecret(secretKey) {
const size = lengths.secretKey;
abytes(secretKey, size);
const hashed = hash(secretKey.subarray(0, size));
return adjustScalarBytes(hashed).subarray(0, size);
if (toMontgomerySecret === undefined)
throw new Error('Montgomery conversion is not supported for this curve');
return toMontgomerySecret(secretKey);
},

@@ -721,2 +740,1 @@ };

}
//# sourceMappingURL=edwards.js.map

@@ -6,4 +6,4 @@ /**

*/
import type { TArg } from '../utils.ts';
import type { IField } from './modular.ts';
import { type TArg } from '../utils.ts';
import { type IField } from './modular.ts';
/** Array-like coefficient storage that can be mutated in place. */

@@ -38,3 +38,2 @@ export interface MutableArrayLike<T> {

* @returns `true` when the value is a power of two.
* @throws If `x` is not a valid unsigned 32-bit integer. {@link Error}
* @example

@@ -77,3 +76,2 @@ * Validate that an FFT size is a power of two.

* @returns Base-2 logarithm. For `n = 0`, the current implementation returns `-1`.
* @throws If `n` is not a valid unsigned 32-bit integer. {@link Error}
* @example

@@ -154,5 +152,5 @@ * Compute the radix-2 stage count for one transform size.

/**
* We limit roots up to 2**31, which is a lot: 2-billion polynomimal should be rare.
* We limit roots up to 2**31, which is a lot: 2-billion polynomial should be rare.
* @param field - Field implementation.
* @param generator - Optional generator override.
* @param generator - Optional trusted non-quadratic-residue override for callers that already know the field.
* @returns Roots-of-unity cache.

@@ -233,3 +231,3 @@ * @example

*
* - DIT (Decimation-in-Time): Bottom-Up (leaves to root), Cool-Turkey
* - DIT (Decimation-in-Time): Bottom-Up (leaves to root), Cooley-Tukey
* - DIF (Decimation-in-Frequency): Top-Down (root to leaves), Gentleman-Sande

@@ -246,4 +244,12 @@ *

* Negacyclic NTT: Rq = Zq[x]/(x^n+1). butterfly_DIT+loop_DIF, at least for mlkem / mldsa
*
* `invertButterflies` indexes roots by a per-butterfly-group counter (`grp`): forward
* (`dit: false`) reads `roots[grp]` with grp = 1..; inverse (`dit: true`) reads `roots[N - grp]`
* with grp restarting at 1. With `skipStages: 0` one table serves both directions (ωᴺ = 1 makes
* the reversed walk self-inverse). With `skipStages > 0` the inverse walk starts at `N - 1`
* instead of continuing where the skipped stages would have left off, so the caller must supply
* a table shaped for that (ML-KEM: `ζ^BitRev7(i)` over all N=256 indices, whose aliased upper
* half is exactly the FIPS 203 inverse walk).
* @param F - Field operations.
* @param coreOpts - FFT configuration:
* @param coreOpts - FFT configuration. See {@link FFTCoreOpts}:
* - `N`: Transform size. Must be a power of two.

@@ -445,2 +451,1 @@ * - `roots`: Stage roots for the selected transform size.

export declare function poly<T, P extends PolyStorage<T>>(field: TArg<IField<T>>, roots: RootsOfUnity, create: CreatePolyFn<P, T>, fft?: FFTMethods<T>, length?: number): PolyFn<P, T>;
//# sourceMappingURL=fft.d.ts.map

@@ -1,5 +0,14 @@

function checkU32(n) {
/**
* Experimental implementation of NTT / FFT (Fast Fourier Transform) over finite fields.
* API may change at any time. The code has not been audited. Feature requests are welcome.
* @module
*/
import { aarray, validateObject } from "../utils.js";
import { validateField } from "./modular.js";
function checkU32(n, title = 'n') {
// 0xff_ff_ff_ff
if (typeof n !== 'number')
throw new TypeError(`wrong u32 integer "${title}": expected number, got type=${typeof n}`);
if (!Number.isSafeInteger(n) || n < 0 || n > 0xffffffff)
throw new Error('wrong u32 integer:' + n);
throw new RangeError(`wrong u32 integer "${title}": expected 0..4294967295, got ${n}`);
return n;

@@ -11,3 +20,2 @@ }

* @returns `true` when the value is a power of two.
* @throws If `x` is not a valid unsigned 32-bit integer. {@link Error}
* @example

@@ -21,3 +29,3 @@ * Validate that an FFT size is a power of two.

export function isPowerOfTwo(x) {
checkU32(x);
checkU32(x, 'x');
return (x & (x - 1)) === 0 && x !== 0;

@@ -60,2 +68,4 @@ }

checkU32(n);
if (typeof bits !== 'number')
throw new TypeError('"bits" expected number, got type=' + typeof bits);
if (!Number.isSafeInteger(bits) || bits < 0 || bits > 32)

@@ -73,3 +83,2 @@ throw new Error(`expected integer 0 <= bits <= 32, got ${bits}`);

* @returns Base-2 logarithm. For `n = 0`, the current implementation returns `-1`.
* @throws If `n` is not a valid unsigned 32-bit integer. {@link Error}
* @example

@@ -102,2 +111,6 @@ * Compute the radix-2 stage count for one transform size.

export function bitReversalInplace(values) {
if (!values ||
typeof values !== 'object' ||
typeof values.length !== 'number')
throw new TypeError('"values" expected array-like, got type=' + typeof values);
const n = values.length;

@@ -130,2 +143,3 @@ // Size-1 FFT is the identity, so bit-reversal must stay a no-op there instead of rejecting it.

export function bitReversalPermutation(values) {
aarray(values, 'values');
return bitReversalInplace(values.slice());

@@ -141,5 +155,5 @@ }

/**
* We limit roots up to 2**31, which is a lot: 2-billion polynomimal should be rare.
* We limit roots up to 2**31, which is a lot: 2-billion polynomial should be rare.
* @param field - Field implementation.
* @param generator - Optional generator override.
* @param generator - Optional trusted non-quadratic-residue override for callers that already know the field.
* @returns Roots-of-unity cache.

@@ -157,2 +171,5 @@ * @example

export function rootsOfUnity(field, generator) {
validateField(field);
if (generator !== undefined && typeof generator !== 'bigint')
throw new TypeError('"generator" expected bigint, got type=' + typeof generator);
// Factor field.ORDER-1 as oddFactor * 2^powerOfTwo

@@ -173,3 +190,3 @@ let oddFactor = field.ORDER - _1n;

const checkBits = (bits) => {
checkU32(bits);
checkU32(bits, 'bits');
if (bits > 31 || bits > powerOfTwo)

@@ -184,5 +201,14 @@ throw new Error('rootsOfUnity: wrong bits ' + bits + ' powerOfTwo=' + powerOfTwo);

continue; // Skip if we've already computed roots for this power
const above = rootsCache[power + 1];
const rootsAtPower = [];
for (let j = 0, cur = field.ONE; j < 2 ** power; j++, cur = field.mul(cur, omegas[power]))
rootsAtPower.push(cur);
if (above) {
// ω_{2^p} = ω_{2^{p+1}}², so the smaller table is the even-index stride of the bigger
// one: only the largest requested power pays for the multiplication chain.
for (let j = 0; j < 2 ** power; j++)
rootsAtPower.push(above[2 * j]);
}
else {
for (let j = 0, cur = field.ONE; j < 2 ** power; j++, cur = field.mul(cur, omegas[power]))
rootsAtPower.push(cur);
}
rootsCache[power] = rootsAtPower;

@@ -196,3 +222,3 @@ }

// NOTE: we use bits instead of power, because power = 2**bits,
// but power is not neccesary isPowerOfTwo(power)!
// but power is not necessarily isPowerOfTwo(power)!
return {

@@ -219,3 +245,6 @@ info: { G, powerOfTwo, oddFactor },

else {
const res = field.invertBatch(this.roots(b));
// ωᴺ = 1, so inv(ωᵏ) = ωᴺ⁻ᵏ: the inverse table is the reversed roots table.
// Value-identical to field.invertBatch(roots), but skips its 3N muls + inversion.
const r = this.roots(b);
const res = [r[0]].concat(r.slice(1).reverse());
inverseCache.set(b, res);

@@ -236,3 +265,3 @@ return res;

*
* - DIT (Decimation-in-Time): Bottom-Up (leaves to root), Cool-Turkey
* - DIT (Decimation-in-Time): Bottom-Up (leaves to root), Cooley-Tukey
* - DIF (Decimation-in-Frequency): Top-Down (root to leaves), Gentleman-Sande

@@ -249,4 +278,12 @@ *

* Negacyclic NTT: Rq = Zq[x]/(x^n+1). butterfly_DIT+loop_DIF, at least for mlkem / mldsa
*
* `invertButterflies` indexes roots by a per-butterfly-group counter (`grp`): forward
* (`dit: false`) reads `roots[grp]` with grp = 1..; inverse (`dit: true`) reads `roots[N - grp]`
* with grp restarting at 1. With `skipStages: 0` one table serves both directions (ωᴺ = 1 makes
* the reversed walk self-inverse). With `skipStages > 0` the inverse walk starts at `N - 1`
* instead of continuing where the skipped stages would have left off, so the caller must supply
* a table shaped for that (ML-KEM: `ζ^BitRev7(i)` over all N=256 indices, whose aliased upper
* half is exactly the FIPS 203 inverse walk).
* @param F - Field operations.
* @param coreOpts - FFT configuration:
* @param coreOpts - FFT configuration. See {@link FFTCoreOpts}:
* - `N`: Transform size. Must be a power of two.

@@ -273,6 +310,13 @@ * - `roots`: Stage roots for the selected transform size.

export const FFTCore = (F, coreOpts) => {
validateObject(coreOpts, { N: 'number', roots: 'object', dit: 'boolean' }, { invertButterflies: 'boolean', skipStages: 'number', brp: 'boolean' }, 'coreOpts');
const { N, roots, dit, invertButterflies = false, skipStages = 0, brp = true } = coreOpts;
checkU32(N, 'coreOpts.N');
const bits = log2(N);
if (!isPowerOfTwo(N))
throw new Error('FFT: Polynomial size should be power of two');
checkU32(skipStages, 'coreOpts.skipStages');
const maxSkipStages = bits === 0 ? 0 : bits - 1;
// Skipping every stage leaves only boundary layout changes, not a valid FFT loop shape.
if (skipStages > maxSkipStages)
throw new Error(`FFT: wrong skipStages: expected 0 <= skipStages <= ${maxSkipStages}`);
// Wrong-sized root tables can stay in-bounds for some loop shapes and silently compute nonsense.

@@ -282,3 +326,2 @@ if (roots.length !== N)

const isDit = dit !== invertButterflies;
isDit;
return (values) => {

@@ -345,13 +388,29 @@ if (values.length !== N)

export function FFT(roots, opts) {
const getLoop = (N, roots, brpInput = false, brpOutput = false) => {
// Loops are cached per (size, direction, brp flags): FFTCore construction validates options
// and allocates closures, which costs more than a small transform itself. The cached loop
// closes over the root table active at first use; `roots.clear()` rebuilds value-identical
// tables, so a stale reference stays correct.
const loops = new Map();
const getLoop = (N, rootsTable, key) => {
const cached = loops.get(key);
if (cached)
return cached;
const brpInput = !!(key & 2);
const brpOutput = !!(key & 1);
let loop;
if (brpInput && brpOutput) {
// we cannot optimize this case, but lets support it anyway
return (values) => FFTCore(opts, { N, roots, dit: false, brp: false })(bitReversalInplace(values));
const core = FFTCore(opts, { N, roots: rootsTable, dit: false, brp: false });
loop = (values) => core(bitReversalInplace(values));
}
if (brpInput)
return FFTCore(opts, { N, roots, dit: true, brp: false });
if (brpOutput)
return FFTCore(opts, { N, roots, dit: false, brp: false });
return FFTCore(opts, { N, roots, dit: true, brp: true }); // all natural
else if (brpInput)
loop = FFTCore(opts, { N, roots: rootsTable, dit: true, brp: false });
else if (brpOutput)
loop = FFTCore(opts, { N, roots: rootsTable, dit: false, brp: false });
else
loop = FFTCore(opts, { N, roots: rootsTable, dit: true, brp: true }); // all natural
loops.set(key, loop);
return loop;
};
const loopKey = (bits, isInverse, brpInput, brpOutput) => (bits << 3) | (isInverse ? 4 : 0) | (brpInput ? 2 : 0) | (brpOutput ? 1 : 0);
return {

@@ -363,3 +422,4 @@ direct(values, brpInput = false, brpOutput = false) {

const bits = log2(N);
return getLoop(N, roots.roots(bits), brpInput, brpOutput)(values.slice());
const key = loopKey(bits, false, brpInput, brpOutput);
return getLoop(N, roots.roots(bits), key)(values.slice());
},

@@ -371,3 +431,4 @@ inverse(values, brpInput = false, brpOutput = false) {

const bits = log2(N);
const res = getLoop(N, roots.inverse(bits), brpInput, brpOutput)(values.slice());
const key = loopKey(bits, true, brpInput, brpOutput);
const res = getLoop(N, roots.inverse(bits), key)(values.slice());
const ivm = opts.inv(BigInt(values.length)); // scale

@@ -385,2 +446,3 @@ // we can get brp output if we use dif instead of dit!

export function poly(field, roots, create, fft, length) {
validateField(field);
const F = field;

@@ -401,12 +463,14 @@ const _create = create ||

};
const checkLength = (...lst) => {
if (!lst.length)
return 0;
for (const i of lst)
if (!isPoly(i))
throw new Error('poly: not polynomial: ' + i);
const L = lst[0].length;
for (let i = 1; i < lst.length; i++)
if (lst[i].length !== L)
throw new Error(`poly: mismatched lengths ${L} vs ${lst[i].length}`);
const checkPoly = (title, value) => {
if (!isPoly(value))
throw new TypeError(`"${title}" expected polynomial, got type=${typeof value}`);
};
const checkLength = (a, b) => {
checkPoly('a', a);
const L = a.length;
if (b !== undefined) {
checkPoly('b', b);
if (b.length !== L)
throw new Error(`poly: mismatched lengths ${L} vs ${b.length}`);
}
if (length !== undefined && L !== length)

@@ -416,5 +480,7 @@ throw new Error(`poly: expected fixed length ${length}, got ${L}`);

};
function findOmegaIndex(x, n, brp = false) {
const bits = log2(n);
const omega = brp ? roots.brp(bits) : roots.roots(bits);
function findOmegaIndex(x, n, brp = false, weights) {
if (!isPowerOfTwo(n))
throw new Error('poly.lagrange: expected power of two length, got ' + n);
// Explicit weights define the interpolation domain, including the Kronecker-δ shortcut.
const omega = weights || (brp ? roots.brp(log2(n)) : roots.roots(log2(n)));
for (let i = 0; i < n; i++)

@@ -497,2 +563,4 @@ if (F.eql(x, omega[i]))

convolve(a, b) {
checkPoly('a', a);
checkPoly('b', b);
const len = nextPowerOfTwo(a.length + b.length - 1);

@@ -502,3 +570,8 @@ return this.mul(this.extend(a, len), this.extend(b, len));

shift(p, factor) {
const out = _create(checkLength(p));
checkPoly('p', p);
const out = _create(p.length);
if (length !== undefined && p.length !== length)
throw new Error(`poly: expected fixed length ${length}, got ${p.length}`);
if (!p.length)
return out;
out[0] = p[0];

@@ -546,2 +619,4 @@ for (let i = 1, power = F.ONE; i < p.length; i++) {

basis: (x, n, brp = false, weights) => {
if (!isPowerOfTwo(n))
throw new Error('poly.lagrange: expected power of two length, got ' + n);
const bits = log2(n);

@@ -551,3 +626,3 @@ const cache = weights || (brp ? roots.brp(bits) : roots.roots(bits)); // [ω⁰, ω¹, ..., ωⁿ⁻¹]

// Fast Kronecker-δ shortcut
const idx = findOmegaIndex(x, n, brp);
const idx = findOmegaIndex(x, n, brp, weights);
if (idx !== -1) {

@@ -581,3 +656,5 @@ out[idx] = F.ONE;

vanishing(roots) {
checkLength(roots);
checkPoly('roots', roots);
if (length !== undefined && roots.length !== length)
throw new Error(`poly: expected fixed length ${length}, got ${roots.length}`);
const out = _create(roots.length + 1, F.ZERO);

@@ -595,2 +672,1 @@ out[0] = F.ONE;

}
//# sourceMappingURL=fft.js.map

@@ -5,101 +5,265 @@ import { randomBytes, type TArg, type TRet } from '../utils.ts';

import { type IField } from './modular.ts';
/** Cryptographically secure random byte generator. */
export type RNG = typeof randomBytes;
/** Serialized participant identifier. Identifiers are hex to make comparison easier. */
export type Identifier = string;
/** Serialized point commitment. */
export type Commitment = Uint8Array;
/** Serialized scalar coefficient. */
export type Coefficient = Uint8Array;
/** Serialized Schnorr signature. */
export type Signature = Uint8Array;
/** Threshold participant counts. */
export type Signers = {
/** Minimum number of signers required to produce a signature. */
min: number;
/** Maximum number of participants in the key set. */
max: number;
};
/** Serialized secret key bytes. */
export type SecretKey = Uint8Array;
/** Byte array alias used by FROST public packages. */
export type Bytes = Uint8Array;
type Point = Uint8Array;
/** Public DKG round-1 broadcast plus proof of knowledge. */
export type DKG_Round1 = {
/** Sender identifier. */
identifier: Identifier;
/** VSS commitment points. */
commitment: TRet<Commitment[]>;
/** Signature proving knowledge of the sender's secret coefficient. */
proofOfKnowledge: TRet<Signature>;
};
/** Public DKG round-2 recipient share package. */
export type DKG_Round2 = {
/** Sender identifier. */
identifier: Identifier;
/** Signing share for one receiver. */
signingShare: TRet<Bytes>;
};
/** Internal mutable DKG state package. */
export type DKG_Secret = {
/** Local participant identifier as a scalar. */
identifier: bigint;
/** Local secret polynomial coefficients while DKG is in progress. */
coefficients?: bigint[];
/** Local VSS commitment points. */
commitment: TRet<Point[]>;
/** Threshold participant counts. */
signers: Signers;
/** Cached round2 packages from the first successful round2 call. */
round2Cache?: Record<Identifier, DKG_Round2>;
/** Current DKG state-machine step. */
step?: 1 | 2 | 3;
};
/** Shared public FROST package for one key set. */
export type FrostPublic = {
/** Threshold participant counts. */
signers: Signers;
/** Serialized commitment points; `commitments[0]` is the group public key. */
commitments: TRet<Bytes[]>;
/** Map from participant identifier to serialized verifying-share point. */
verifyingShares: TRet<Record<Identifier, Bytes>>;
};
/** Secret FROST share for one participant. */
export type FrostSecret = {
/** Participant identifier. */
identifier: Identifier;
/** Serialized scalar signing share. */
signingShare: TRet<Bytes>;
};
/** Combined public and secret FROST packages for one participant. */
export type Key = {
/** Shared public package. */
public: FrostPublic;
/** Participant secret package. */
secret: FrostSecret;
};
/** Trusted-dealer output containing public data and all participant shares. */
export type DealerShares = {
/** Shared public package. */
public: FrostPublic;
/** Map from participant identifier to its secret share. */
secretShares: Record<Identifier, FrostSecret>;
};
/** Private nonce scalars used once during signing. */
export type Nonces = {
/** Serialized hiding nonce scalar. */
hiding: TRet<Bytes>;
/** Serialized binding nonce scalar. */
binding: TRet<Bytes>;
};
/** Public nonce commitments broadcast for one signing attempt. */
export type NonceCommitments = {
/** Participant identifier. */
identifier: Identifier;
/** Serialized hiding nonce point. */
hiding: TRet<Bytes>;
/** Serialized binding nonce point. */
binding: TRet<Bytes>;
};
/** Generated nonce package containing private nonces and public commitments. */
export type GenNonce = {
/** Private nonce scalars. */
nonces: Nonces;
/** Public nonce commitments. */
commitments: NonceCommitments;
};
/** Point interface required by the generic FROST implementation. */
export interface FROSTPoint<T extends CurvePoint<any, T>> extends CurvePoint<any, T> {
/**
* Adds another point.
* @param rhs - Point to add.
* @returns Point sum.
*/
add(rhs: T): T;
/**
* Multiplies by a scalar.
* @param rhs - Scalar multiplier.
* @returns Scalar multiplication result.
*/
multiply(rhs: bigint): T;
/**
* Compares two points.
* @param rhs - Point to compare.
* @returns Whether points are equal.
*/
equals(rhs: T): boolean;
/**
* Serializes a point.
* @param compressed - Whether to use compressed encoding.
* @returns Encoded point bytes.
*/
toBytes(compressed?: boolean): Bytes;
/**
* Clears the point cofactor.
* @returns Cofactor-cleared point.
*/
clearCofactor(): T;
}
/** Point constructor surface required by FROST. */
export interface FROSTPointConstructor<T extends FROSTPoint<T>> extends CurvePointCons<T> {
/**
* Parses a point from bytes.
* @param a - Encoded point bytes.
* @returns Parsed point.
*/
fromBytes(a: Bytes): T;
/** Scalar field used by the point group. */
Fn: IField<bigint>;
}
/** Construction options for a concrete FROST ciphersuite. */
export type FrostOpts<P extends FROSTPoint<P>> = {
/** Ciphersuite name. */
readonly name: string;
/** Point constructor for the signing group. */
readonly Point: FROSTPointConstructor<P>;
/** Optional scalar-field override. */
readonly Fn?: IField<bigint>;
/** Optional suite hook that tightens canonical decoding with subgroup / identity checks. */
/**
* Optional suite hook that tightens canonical decoding with subgroup / identity checks.
* @param p - Point to validate.
*/
readonly validatePoint?: (p: P) => void;
/** Optional public-key parser. Implementations MUST preserve the same subgroup / identity policy
* as `validatePoint`, because this bypasses generic canonical decoding in `parsePoint()`. */
/**
* Optional public-key parser. Implementations MUST preserve the same subgroup / identity policy
* as `validatePoint`, because this bypasses generic canonical decoding in `parsePoint()`.
* @param bytes - Encoded public key.
* @returns Parsed public point.
*/
readonly parsePublicKey?: (bytes: TArg<Uint8Array>) => P;
/**
* Hash function used by the suite.
* @param msg - Message bytes to hash.
* @returns Hash output bytes.
*/
readonly hash: (msg: TArg<Uint8Array>) => TRet<Uint8Array>;
/** Custom scalar hash hook. Implementations MUST treat `msg` and `options` as read-only. */
/**
* Custom scalar hash hook. Implementations MUST treat `msg` and `options` as read-only.
* @param msg - Message bytes to hash.
* @param options - Hash-to-curve options. See {@link H2CDSTOpts}.
* @returns Scalar field element.
*/
readonly hashToScalar?: (msg: TArg<Uint8Array>, options?: TArg<H2CDSTOpts>) => bigint;
/**
* Optional scalar adjustment hook.
* @param n - Scalar to adjust.
* @returns Adjusted scalar.
*/
readonly adjustScalar?: (n: bigint) => bigint;
/**
* Optional point adjustment hook.
* @param n - Point to adjust.
* @returns Adjusted point.
*/
readonly adjustPoint?: (n: P) => P;
/**
* Optional challenge override.
* @param R - Group commitment point.
* @param PK - Group public key point.
* @param msg - Message bytes.
* @returns Challenge scalar.
*/
readonly challenge?: (R: P, PK: P, msg: TArg<Uint8Array>) => bigint;
readonly adjustNonces?: (PK: P, nonces: TArg<Nonces>) => TRet<Nonces>;
/**
* Optional nonce-package adjustment hook.
* @param R - Group commitment point for the current signing session.
* @param nonces - Nonce package.
* @returns Adjusted nonce package.
*/
readonly adjustNonces?: (R: P, nonces: TArg<Nonces>) => TRet<Nonces>;
/**
* Optional secret-package adjustment hook.
* @param secret - Secret package.
* @param pub - Public package.
* @returns Adjusted secret package.
*/
readonly adjustSecret?: (secret: TArg<FrostSecret>, pub: TArg<FrostPublic>) => TRet<FrostSecret>;
/**
* Optional public-package adjustment hook.
* @param pub - Public package.
* @returns Adjusted public package.
*/
readonly adjustPublic?: (pub: TArg<FrostPublic>) => TRet<FrostPublic>;
/**
* Optional group commitment-share adjustment hook.
* @param GC - Group commitment.
* @param GCShare - Participant commitment share.
* @returns Adjusted group commitment share.
*/
readonly adjustGroupCommitmentShare?: (GC: P, GCShare: P) => P;
/** Optional transaction encoder / decoder adjustment. */
readonly adjustTx?: {
/**
* Encode transaction bytes before signing.
* @param tx - Transaction bytes.
* @returns Encoded transaction bytes.
*/
readonly encode: (tx: TArg<Uint8Array>) => TRet<Uint8Array>;
/**
* Decode transaction bytes after verification.
* @param tx - Encoded transaction bytes.
* @returns Decoded transaction bytes.
*/
readonly decode: (tx: TArg<Uint8Array>) => TRet<Uint8Array>;
};
/**
* Optional DKG output adjustment hook.
* @param k - DKG key package.
* @returns Adjusted DKG key package.
*/
readonly adjustDKG?: (k: TArg<Key>) => TRet<Key>;
/** Prefix for RFC 9591 H1. */
readonly H1?: string;
/** Prefix for RFC 9591 H2. */
readonly H2?: string;
/** Prefix for RFC 9591 H3. */
readonly H3?: string;
/** Prefix for RFC 9591 H4. */
readonly H4?: string;
/** Prefix for RFC 9591 H5. */
readonly H5?: string;
/** Prefix for DKG hashing. */
readonly HDKG?: string;
/** Prefix for identifier derivation. */
readonly HID?: string;

@@ -109,8 +273,6 @@ };

* FROST: Threshold Protocol for Two‑Round Schnorr Signatures
* from [RFC 9591](https://datatracker.ietf.org/doc/rfc9591/).
* from {@link https://datatracker.ietf.org/doc/rfc9591/ | RFC 9591}.
*/
export type FROST = {
/**
* Methods to construct participant identifiers.
*/
/** Methods to construct participant identifiers. */
Identifier: {

@@ -264,5 +426,3 @@ /**

combineSecret(shares: TArg<FrostSecret[]>, signers: Signers): TRet<Uint8Array>;
/**
* Low-level helper utilities (field arithmetic and polynomial tools).
*/
/** Low-level helper utilities (field arithmetic and polynomial tools). */
utils: {

@@ -294,4 +454,20 @@ /**

};
/**
* Builds a FROST ciphersuite API from concrete curve and hash hooks.
* @param opts - Ciphersuite construction options. See {@link FrostOpts}.
* @returns FROST API bound to the supplied ciphersuite.
* @example
* Create a suite from a curve-specific option object.
* ```ts
* import { createFROST } from '@noble/curves/abstract/frost.js';
* import { ed25519 } from '@noble/curves/ed25519.js';
* import { sha512 } from '@noble/hashes/sha2.js';
* const frost = createFROST({
* name: 'FROST-ED25519-SHA512-v1',
* Point: ed25519.Point,
* hash: sha512,
* });
* ```
*/
export declare function createFROST<P extends FROSTPoint<P>>(opts: FrostOpts<P>): TRet<FROST>;
export {};
//# sourceMappingURL=frost.d.ts.map
/**
* FROST: Flexible Round-Optimized Schnorr Threshold Protocol for Two-Round Schnorr Signatures.
*
* See [RFC 9591](https://datatracker.ietf.org/doc/rfc9591/) and [frost.zfnd.org](https://frost.zfnd.org).
* See {@link https://datatracker.ietf.org/doc/rfc9591/ | RFC 9591} and
* {@link https://frost.zfnd.org | frost.zfnd.org}.
* @module
*/
import { utf8ToBytes } from '@noble/hashes/utils.js';
import { bytesToHex, bytesToNumberBE, bytesToNumberLE, concatBytes, hexToBytes, randomBytes, validateObject, } from "../utils.js";
import { pippenger, validatePointCons } from "./curve.js";
import { aarray, abytes, asafenumber, astring, bytesToHex, bytesToNumberBE, bytesToNumberLE, concatBytes, hexToBytes, randomBytes, validateObject, } from "../utils.js";
import { mulAddUnsafe, validatePointCons } from "./curve.js";
import { poly } from "./fft.js";

@@ -15,5 +16,6 @@ import {} from "./hash-to-curve.js";

// PrivKey = id, signingShare, commitment
const validateSigners = (signers) => {
if (!Number.isSafeInteger(signers.min) || !Number.isSafeInteger(signers.max))
throw new Error('Wrong signers info: min=' + signers.min + ' max=' + signers.max);
const validateSigners = (signers, title = 'signers') => {
validateObject(signers, { min: 'number', max: 'number' }, {}, title);
asafenumber(signers.min, title + '.min');
asafenumber(signers.max, title + '.max');
// Compatibility with frost-rs intentionally narrows RFC 9591's positive-nonzero threshold rule

@@ -39,2 +41,19 @@ // to `min >= 2`, even though the RFC text itself allows `MIN_PARTICIPANTS = 1`.

}
/**
* Builds a FROST ciphersuite API from concrete curve and hash hooks.
* @param opts - Ciphersuite construction options. See {@link FrostOpts}.
* @returns FROST API bound to the supplied ciphersuite.
* @example
* Create a suite from a curve-specific option object.
* ```ts
* import { createFROST } from '@noble/curves/abstract/frost.js';
* import { ed25519 } from '@noble/curves/ed25519.js';
* import { sha512 } from '@noble/hashes/sha2.js';
* const frost = createFROST({
* name: 'FROST-ED25519-SHA512-v1',
* Point: ed25519.Point,
* hash: sha512,
* });
* ```
*/
export function createFROST(opts) {

@@ -89,2 +108,4 @@ validateObject(opts, {

const randomScalar = (rng = randomBytes) => {
if (typeof rng !== 'function')
throw new TypeError('"rng" expected function, got type=' + typeof rng);
// Intentional divergence from RFC 9591 §4.1 / §5.1: the RFC nonce_generate helper outputs a

@@ -125,3 +146,4 @@ // Scalar in [0, p-1], but round-one commit publishes ScalarBaseMult(nonce) values and §3.1

const serializeIdentifier = (id) => bytesToHex(Fn.toBytes(validateIdentifier(id)));
const parseIdentifier = (id) => {
const parseIdentifier = (id, title = 'identifier') => {
astring(id, title);
const n = validateIdentifier(Fn.fromBytes(hexToBytes(id)));

@@ -146,3 +168,8 @@ // Keep string-keyed maps stable by accepting only the canonical serialized form.

// We don't know size of point, but we know size of scalar
const R = parsePoint(sig.subarray(0, -Fn.BYTES));
const Rbytes = sig.subarray(0, -Fn.BYTES);
const R = parsePoint(Rbytes);
// RFC 9591 Section 3.1 SerializeElement is canonical: a signature must not verify under an
// alternative point encoding (e.g. re-encoding a weierstrass R uncompressed as 65 bytes).
if (serializePoint(R).length !== Rbytes.length)
throw new Error('invalid signature encoding');
const z = Fn.fromBytes(sig.subarray(-Fn.BYTES));

@@ -181,3 +208,5 @@ return { R, z };

const Poly = poly(Fn, noRoots);
const msm = (points, scalars) => pippenger(Point, points, scalars);
// Variable-time MSM over public inputs only (VSS / nonce commitments, binding factors).
// Interleaved wNAF beats pippenger ~3x at FROST-sized inputs (n <= dozens of signers).
const msm = (points, scalars) => mulAddUnsafe(Point, points, scalars);
// Internal stuff uses bigints & Points, external Uint8Arrays

@@ -219,2 +248,8 @@ const polynomialEvaluate = (x, coeffs) => {

validateSigners(signers);
if (secret !== undefined)
abytes(secret, Fn.BYTES, 'secret');
if (coeffs !== undefined)
aarray(coeffs, 'coeffs');
if (typeof rng !== 'function')
throw new TypeError('"rng" expected function, got type=' + typeof rng);
// Dealer/DKG polynomial sampling reuses the same hardened scalar derivation as round-one

@@ -253,4 +288,4 @@ // nonces: overriding `rng` only swaps the entropy source, not the non-zero `1..n-1` policy.

const c = this.challenge(id, phi, R);
// R === z*G - phi*c
if (!R.equals(Point.BASE.multiply(z).subtract(phi.multiply(c))))
// R === z*G - phi*c. All inputs are public: variable-time multiplication is safe here.
if (!R.equals(Point.BASE.multiplyUnsafe(z).subtract(phi.multiplyUnsafe(c))))
throw new Error('invalid proof of knowledge');

@@ -277,5 +312,6 @@ },

R = opts.adjustPoint(R);
// Signature, message and public key are all public: variable-time is safe on this path.
const c = this.challenge(R, PK, msg);
const zB = Point.BASE.multiply(z); // z*G
const cA = PK.multiply(c); // c*PK
const zB = Point.BASE.multiplyUnsafe(z); // z*G
const cA = PK.multiplyUnsafe(c); // c*PK
let check = zB.subtract(cA).subtract(R); // zB - cA - R

@@ -306,4 +342,3 @@ // No clearCoffactor on ristretto

derive(s) {
if (typeof s !== 'string')
throw new Error('wrong identifier string: ' + s);
astring(s, 's');
// Derived identifiers may land anywhere in the scalar field; they are not restricted to

@@ -336,2 +371,5 @@ // sequential `1..max_signers` values.

}
// Hiding commitments all carry scalar 1, so add them directly and keep only the
// binding commitments in the MSM: same result, half the MSM size.
let hidingSum = Point.ZERO;
const points = [];

@@ -342,6 +380,7 @@ const scalars = [];

throw new Error('infinity commitment');
points.push(hC, bC);
scalars.push(Fn.ONE, bindingFactors[i]);
hidingSum = hidingSum.add(hC);
points.push(bC);
scalars.push(bindingFactors[i]);
}
const groupCommitment = msm(points, scalars); // GC += hC + bC*bindingFactor
const groupCommitment = hidingSum.add(msm(points, scalars)); // GC += hC + bC*bindingFactor
const identifiers = CL.map((i) => i[1]);

@@ -368,4 +407,4 @@ return { identifiers, groupCommitment, bindingFactors };

round1: (id, signers, secret, rng = randomBytes) => {
const idNum = parseIdentifier(id, 'id');
validateSigners(signers);
const idNum = parseIdentifier(id);
const { coefficients, commitment } = generateSecretPolynomial(signers, secret, undefined, rng);

@@ -391,2 +430,5 @@ const proofOfKnowledge = ProofOfKnowledge.compute(idNum, coefficients, commitment, rng);

round2: (secret, others) => {
validateObject(secret, { identifier: 'bigint', commitment: 'object', signers: 'object' }, { coefficients: 'object', round2Cache: 'object', step: 'number' }, 'secret');
validateSigners(secret.signers, 'secret.signers');
aarray(others, 'others');
if (others.length !== secret.signers.max - 1)

@@ -396,2 +438,4 @@ throw new Error('wrong number of round1 packages');

throw new Error('round3 package used in round2');
if (secret.round2Cache !== undefined)
return secret.round2Cache;
const res = {};

@@ -415,2 +459,3 @@ for (const p of others) {

}
secret.round2Cache = res;
secret.step = 2;

@@ -420,2 +465,6 @@ return res;

round3: (secret, round1, round2) => {
validateObject(secret, { identifier: 'bigint', commitment: 'object', signers: 'object' }, { coefficients: 'object', round2Cache: 'object', step: 'number' }, 'secret');
validateSigners(secret.signers, 'secret.signers');
aarray(round1, 'round1');
aarray(round2, 'round2');
// DKG is outside RFC 9591's signing flow; callers are expected to reuse the same

@@ -498,2 +547,3 @@ // remote round1 packages already accepted in round2, like frost-rs documents.

delete secret.coefficients;
delete secret.round2Cache;
secret.step = 3;

@@ -503,2 +553,3 @@ return res;

clean(secret) {
validateObject(secret, { identifier: 'bigint', commitment: 'object', signers: 'object' }, { coefficients: 'object', round2Cache: 'object', step: 'number' }, 'secret');
// Instead of replacing secret bigint with another (zero?), we subtract it from itself

@@ -513,2 +564,3 @@ // in the hope that JIT will modify it inplace, instead of creating new value.

// for (const c of secret.commitment) c.fill(0);
delete secret.round2Cache;
secret.step = 3;

@@ -528,3 +580,4 @@ },

else {
if (!Array.isArray(identifiers) || identifiers.length !== signers.max)
aarray(identifiers, 'identifiers');
if (identifiers.length !== signers.max)
throw new Error('identifiers should be array of ' + signers.max);

@@ -562,2 +615,11 @@ }

validateSecret(secret, pub) {
validateObject(secret, { identifier: 'string', signingShare: 'object' }, {}, 'secret');
abytes(secret.signingShare, Fn.BYTES, 'secret.signingShare');
validateObject(pub, {
signers: 'object',
commitments: 'object',
verifyingShares: 'object',
}, {}, 'pub');
validateSigners(pub.signers, 'pub.signers');
aarray(pub.commitments, 'pub.commitments');
const id = parseIdentifier(secret.identifier);

@@ -576,2 +638,6 @@ const commitment = pub.commitments.map(parsePoint);

commit(secret, rng = randomBytes) {
validateObject(secret, { identifier: 'string', signingShare: 'object' }, {}, 'secret');
abytes(secret.signingShare, Fn.BYTES, 'secret.signingShare');
if (typeof rng !== 'function')
throw new TypeError('"rng" expected function, got type=' + typeof rng);
const secretScalar = Fn.fromBytes(secret.signingShare);

@@ -586,2 +652,16 @@ const hiding = generateNonce(secretScalar, rng);

signShare(secret, pub, nonces, commitmentList, msg) {
validateObject(secret, { identifier: 'string', signingShare: 'object' }, {}, 'secret');
abytes(secret.signingShare, Fn.BYTES, 'secret.signingShare');
validateObject(pub, {
signers: 'object',
commitments: 'object',
verifyingShares: 'object',
}, {}, 'pub');
validateSigners(pub.signers, 'pub.signers');
aarray(pub.commitments, 'pub.commitments');
validateObject(nonces, { hiding: 'object', binding: 'object' }, {}, 'nonces');
abytes(nonces.hiding, Fn.BYTES, 'nonces.hiding');
abytes(nonces.binding, Fn.BYTES, 'nonces.binding');
aarray(commitmentList, 'commitmentList');
abytes(msg, undefined, 'msg');
validateCommitmentsNum(pub.signers, commitmentList.length);

@@ -627,2 +707,13 @@ const hidingNonce0 = Fn.fromBytes(nonces.hiding);

verifyShare(pub, commitmentList, msg, identifier, sigShare) {
validateObject(pub, {
signers: 'object',
commitments: 'object',
verifyingShares: 'object',
}, {}, 'pub');
validateSigners(pub.signers, 'pub.signers');
aarray(pub.commitments, 'pub.commitments');
aarray(commitmentList, 'commitmentList');
abytes(msg, undefined, 'msg');
parseIdentifier(identifier);
abytes(sigShare, Fn.BYTES, 'sigShare');
if (opts.adjustPublic)

@@ -637,9 +728,10 @@ pub = opts.adjustPublic(pub);

const { lambda, challenge, bindingFactor, groupCommitment } = prepareShare(pub.commitments[0], commitmentList, msg, identifier);
// Signature shares, commitments and verifying shares are public: vartime is safe here.
// hC + bC * bF
let commShare = hidingNonceCommitment.add(bindingNonceCommitment.multiply(bindingFactor));
let commShare = hidingNonceCommitment.add(bindingNonceCommitment.multiplyUnsafe(bindingFactor));
if (opts.adjustGroupCommitmentShare)
commShare = opts.adjustGroupCommitmentShare(groupCommitment, commShare);
const l = Point.BASE.multiply(Fn.fromBytes(sigShare)); // sigShare*G
const l = Point.BASE.multiplyUnsafe(Fn.fromBytes(sigShare)); // sigShare*G
// commShare + PK * (challenge * lambda)
const r = commShare.add(PK.multiply(Fn.mul(challenge, lambda)));
const r = commShare.add(PK.multiplyUnsafe(Fn.mul(challenge, lambda)));
return l.equals(r);

@@ -649,2 +741,14 @@ },

aggregate(pub, commitmentList, msg, sigShares) {
validateObject(pub, {
signers: 'object',
commitments: 'object',
verifyingShares: 'object',
}, {}, 'pub');
validateSigners(pub.signers, 'pub.signers');
aarray(pub.commitments, 'pub.commitments');
aarray(commitmentList, 'commitmentList');
abytes(msg, undefined, 'msg');
validateObject(sigShares, {}, {}, 'sigShares');
// verifyShare() applies adjustPublic too, so keep the original package for attribution.
const rawPub = pub;
if (opts.adjustPublic)

@@ -659,2 +763,9 @@ pub = opts.adjustPublic(pub);

const ids = commitmentList.map((i) => i.identifier);
const seen = new Set();
for (const id of ids) {
// `sigShares` is identifier-keyed, so duplicate commitments would reuse one share twice.
if (seen.has(id))
throw new AggErr('aggregation failed', []);
seen.add(id);
}
if (ids.length !== Object.keys(sigShares).length)

@@ -675,3 +786,3 @@ throw new AggErr('aggregation failed', []);

for (const id of ids) {
if (!this.verifyShare(pub, commitmentList, msg, id, sigShares[id]))
if (!this.verifyShare(rawPub, commitmentList, msg, id, sigShares[id]))
cheaters.push(id);

@@ -699,4 +810,5 @@ }

combineSecret(shares, signers) {
aarray(shares, 'shares');
validateSigners(signers);
if (!Array.isArray(shares) || shares.length < signers.min)
if (shares.length < signers.min || shares.length > signers.max)
throw new Error('wrong secret shares array');

@@ -734,2 +846,1 @@ const points = [];

}
//# sourceMappingURL=frost.js.map

@@ -212,4 +212,4 @@ /**

* @param mapToCurve - Map-to-curve function.
* @param defaults - Default hash-to-curve options. This object is frozen in place and reused as
* the shared defaults bundle for the returned helpers.
* @param defaults - Default hash-to-curve options. A frozen detached snapshot is reused as the
* shared defaults bundle for the returned helpers.
* @returns Hash-to-curve helper namespace.

@@ -239,3 +239,55 @@ * @throws If the map-to-curve callback or default hash-to-curve options are invalid. {@link Error}

}>): H2CHasher<PC>;
/**
* Implementation of the Shallue and van de Woestijne method for any weierstrass curve.
* TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.
* b = True and y = sqrt(u / v) if (u / v) is square in F, and
* b = False and y = sqrt(Z * (u / v)) otherwise.
* RFC 9380 expects callers to provide `v != 0`; this helper does not enforce it.
* @param Fp - Field implementation.
* @param Z - Simplified SWU map parameter.
* @returns Square-root ratio helper.
* @example
* Build the square-root ratio helper used by SWU map implementations.
*
* ```ts
* import { SWUFpSqrtRatio } from '@noble/curves/abstract/hash-to-curve.js';
* import { Field } from '@noble/curves/abstract/modular.js';
* const Fp = Field(17n);
* const sqrtRatio = SWUFpSqrtRatio(Fp, 3n);
* const out = sqrtRatio(4n, 1n);
* ```
*/
export declare function SWUFpSqrtRatio<T>(Fp: TArg<IField<T>>, Z: T): (u: T, v: T) => {
isValid: boolean;
value: T;
};
/**
* Simplified Shallue-van de Woestijne-Ulas Method
* See {@link https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 | RFC 9380 section 6.6.2}.
* @param Fp - Field implementation.
* @param opts - SWU parameters:
* - `A`: Curve parameter `A`.
* - `B`: Curve parameter `B`.
* - `Z`: Simplified SWU map parameter.
* @returns Deterministic map-to-curve function.
* @throws If the SWU parameters are invalid or the field lacks the required helpers. {@link Error}
* @example
* Map one field element to a Weierstrass curve point with the SWU recipe.
*
* ```ts
* import { mapToCurveSimpleSWU } from '@noble/curves/abstract/hash-to-curve.js';
* import { Field } from '@noble/curves/abstract/modular.js';
* const Fp = Field(17n);
* const map = mapToCurveSimpleSWU(Fp, { A: 1n, B: 2n, Z: 3n });
* const point = map(5n);
* ```
*/
export declare function mapToCurveSimpleSWU<T>(Fp: TArg<IField<T>>, opts: {
A: T;
B: T;
Z: T;
}): (u: T) => {
x: T;
y: T;
};
export {};
//# sourceMappingURL=hash-to-curve.d.ts.map

@@ -1,3 +0,5 @@

import { abytes, asafenumber, asciiToBytes, bytesToNumberBE, copyBytes, concatBytes, isBytes, validateObject, } from "../utils.js";
import { FpInvertBatch, mod } from "./modular.js";
import { aarray, abytes, asafenumber, asciiToBytes, bytesToNumberBE, concatBytes, copyBytes, isBytes, validateObject, } from "../utils.js";
import { FpInvertBatch, FpIsSquare, mod, validateField } from "./modular.js";
// prettier-ignore
const _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3), _4n = /* @__PURE__ */ BigInt(4);
// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE.

@@ -64,2 +66,6 @@ const os2ip = bytesToNumberBE;

asafenumber(lenInBytes);
if (typeof H !== 'function')
throw new Error('expand_message_xmd: expected hash function');
asafenumber(H.outputLen, 'hash.outputLen');
asafenumber(H.blockLen, 'hash.blockLen');
DST = normDST(DST);

@@ -121,3 +127,12 @@ // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3

asafenumber(lenInBytes);
asafenumber(k, 'k');
if (k < 0)
throw new Error('expand_message_xof: invalid k');
if (typeof H !== 'function')
throw new Error('expand_message_xof: expected XOF function');
if (typeof H.create !== 'function')
throw new Error('expand_message_xof: expected XOF create');
DST = normDST(DST);
if (lenInBytes < 0 || lenInBytes > 65535)
throw new Error('expand_message_xof: invalid lenInBytes');
// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3

@@ -129,4 +144,6 @@ // RFC 9380 §5.3.3: DST = H("H2C-OVERSIZE-DST-" || a_very_long_DST, ceil(2 * k / 8)).

}
if (lenInBytes > 65535 || DST.length > 255)
throw new Error('expand_message_xof: invalid lenInBytes');
// Oversize DSTs are compressed above; fail closed if a custom XOF still returns one
// (possible when k > 1020 makes the compression dkLen itself exceed 255 bytes).
if (DST.length > 255)
throw new Error('expand_message_xof: invalid DST');
return (H.create({ dkLen: lenInBytes })

@@ -175,4 +192,9 @@ .update(msg)

asafenumber(count);
// RFC 9380 §5.2 defines hash_to_field over a list of one or more field elements and requires
asafenumber(m, 'm');
asafenumber(k, 'k');
// RFC 9380 §5.2 defines hash_to_field over a list of one or more field elements and an integer
// extension degree `m >= 1`; rejecting here avoids degenerate `[]` / `[[]]` helper outputs.
// The RFC also treats `p` as a finite-field characteristic; bad values degenerate log2/mod.
if (p <= BigInt(1))
throw new Error('hash_to_field: expected valid field characteristic');
if (count < 1)

@@ -182,2 +204,4 @@ throw new Error('hash_to_field: expected count >= 1');

throw new Error('hash_to_field: expected m >= 1');
if (k < 0)
throw new Error('hash_to_field: invalid k');
const log2p = p.toString(2).length;

@@ -194,3 +218,4 @@ const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above

else if (expand === '_internal_pass') {
// for internal tests only
// for internal tests only: msg is used as the uniform bytes directly. Short msg is allowed
// on purpose (subarray() slices are short): zkcrypto map_scalar vectors feed empty okm.
prb = msg;

@@ -229,8 +254,14 @@ }

export function isogenyMap(field, map) {
validateField(field);
// Make same order as in spec
const coeff = map.map((i) => Array.from(i).reverse());
aarray(map, 'map');
const coeff = map.map((i, row) => {
aarray(i, 'map[' + row + ']');
if (i.length < 1)
throw new Error('isogenyMap: expected non-empty coefficients');
return Array.from(i).reverse();
});
return (x, y) => {
const [xn, xd, yn, yd] = coeff.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i)));
// RFC 9380 §6.6.3 / Appendix E: denominator-zero exceptional cases must
// return the identity on E.
const isZero = field.is0(xd) || field.is0(yd);
// Shipped Weierstrass consumers encode that affine identity as all-zero

@@ -242,3 +273,5 @@ // coordinates, so `passZero=true` intentionally collapses zero

y = field.mul(y, field.mul(yn, yd_inv)); // y * (yNum / yDev)
return { x, y };
// RFC 9380 §6.6.3: if the denominator of either isogeny rational function is
// zero, the exceptional case must return the identity point on E.
return isZero ? { x: field.ZERO, y: field.ZERO } : { x, y };
};

@@ -256,4 +289,4 @@ }

* @param mapToCurve - Map-to-curve function.
* @param defaults - Default hash-to-curve options. This object is frozen in place and reused as
* the shared defaults bundle for the returned helpers.
* @param defaults - Default hash-to-curve options. A frozen detached snapshot is reused as the
* shared defaults bundle for the returned helpers.
* @returns Hash-to-curve helper namespace.

@@ -283,2 +316,3 @@ * @throws If the map-to-curve callback or default hash-to-curve options are invalid. {@link Error}

throw new Error('mapToCurve() must be defined');
validateObject(defaults);
// `Point` is intentionally not shape-validated eagerly here: point constructors vary across

@@ -299,2 +333,6 @@ // curve families, so this helper only checks the hooks it can validate cheaply. Misconfigured

const safeDefaults = snapshot(defaults);
// Per-call options are H2CDSTOpts: only DST may be overridden. Copying just that key keeps
// off-type option objects from silently replacing suite parameters (p/m/k/hash/expand) at
// runtime — same pinning hashToScalar always did for p/m.
const dstOverride = (options) => options && options.DST !== undefined ? { DST: options.DST } : undefined;
function map(num) {

@@ -318,3 +356,3 @@ return Point.fromAffine(mapToCurve(num));

hashToCurve(msg, options) {
const opts = Object.assign({}, safeDefaults, options);
const opts = Object.assign({}, safeDefaults, dstOverride(options));
const u = hash_to_field(msg, 2, opts);

@@ -326,4 +364,4 @@ const u0 = map(u[0]);

encodeToCurve(msg, options) {
const optsDst = safeDefaults.encodeDST ? { DST: safeDefaults.encodeDST } : {};
const opts = Object.assign({}, safeDefaults, optsDst, options);
const optsDst = safeDefaults.encodeDST === undefined ? {} : { DST: safeDefaults.encodeDST };
const opts = Object.assign({}, safeDefaults, optsDst, dstOverride(options));
const u = hash_to_field(msg, 1, opts);

@@ -343,2 +381,5 @@ const u0 = map(u[0]);

throw new Error('expected array of bigints');
// RFC 9380 represents one GF(p^m) element as exactly m base-field scalars.
if (scalars.length !== safeDefaults.m)
throw new Error(`expected array of ${safeDefaults.m} bigints`);
for (const i of scalars)

@@ -355,3 +396,6 @@ if (typeof i !== 'bigint')

const N = Point.Fn.ORDER;
const opts = Object.assign({}, safeDefaults, { p: N, m: 1, DST: _DST_scalar }, options);
const opts = Object.assign({}, safeDefaults, { DST: _DST_scalar }, dstOverride(options), {
p: N,
m: 1,
});
return hash_to_field(msg, 1, opts)[0][0];

@@ -361,2 +405,180 @@ },

}
//# sourceMappingURL=hash-to-curve.js.map
/**
* Implementation of the Shallue and van de Woestijne method for any weierstrass curve.
* TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.
* b = True and y = sqrt(u / v) if (u / v) is square in F, and
* b = False and y = sqrt(Z * (u / v)) otherwise.
* RFC 9380 expects callers to provide `v != 0`; this helper does not enforce it.
* @param Fp - Field implementation.
* @param Z - Simplified SWU map parameter.
* @returns Square-root ratio helper.
* @example
* Build the square-root ratio helper used by SWU map implementations.
*
* ```ts
* import { SWUFpSqrtRatio } from '@noble/curves/abstract/hash-to-curve.js';
* import { Field } from '@noble/curves/abstract/modular.js';
* const Fp = Field(17n);
* const sqrtRatio = SWUFpSqrtRatio(Fp, 3n);
* const out = sqrtRatio(4n, 1n);
* ```
*/
export function SWUFpSqrtRatio(Fp, Z) {
// Fail with the usual field-shape error before touching pow/cmov on malformed field shims.
const F = validateField(Fp);
// Generic implementation
const q = F.ORDER;
let l = _0n;
for (let o = q - _1n; o % _2n === _0n; o /= _2n)
l += _1n;
const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.
// We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<.
// 2n ** c1 == 2n << (c1-1)
const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n);
const _2n_pow_c1 = _2n_pow_c1_1 * _2n;
const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic
const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic
const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic
const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic
const c6 = F.pow(Z, c2); // 6. c6 = Z^c2
const c7 = F.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)
// RFC 9380 Appendix F.2.1.1 defines sqrt_ratio(u, v) only for v != 0.
// We keep v=0 on the regular result path with isValid=false instead of
// throwing so the helper stays closer to the RFC's fixed control flow.
let sqrtRatio = (u, v) => {
let tv1 = c6; // 1. tv1 = c6
let tv2 = F.pow(v, c4); // 2. tv2 = v^c4
let tv3 = F.sqr(tv2); // 3. tv3 = tv2^2
tv3 = F.mul(tv3, v); // 4. tv3 = tv3 * v
let tv5 = F.mul(u, tv3); // 5. tv5 = u * tv3
tv5 = F.pow(tv5, c3); // 6. tv5 = tv5^c3
tv5 = F.mul(tv5, tv2); // 7. tv5 = tv5 * tv2
tv2 = F.mul(tv5, v); // 8. tv2 = tv5 * v
tv3 = F.mul(tv5, u); // 9. tv3 = tv5 * u
let tv4 = F.mul(tv3, tv2); // 10. tv4 = tv3 * tv2
tv5 = F.pow(tv4, c5); // 11. tv5 = tv4^c5
let isQR = F.eql(tv5, F.ONE); // 12. isQR = tv5 == 1
tv2 = F.mul(tv3, c7); // 13. tv2 = tv3 * c7
tv5 = F.mul(tv4, tv1); // 14. tv5 = tv4 * tv1
tv3 = F.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)
tv4 = F.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)
// 17. for i in (c1, c1 - 1, ..., 2):
for (let i = c1; i > _1n; i--) {
let tv5 = i - _2n; // 18. tv5 = i - 2
tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5
let tvv5 = F.pow(tv4, tv5); // 20. tv5 = tv4^tv5
const e1 = F.eql(tvv5, F.ONE); // 21. e1 = tv5 == 1
tv2 = F.mul(tv3, tv1); // 22. tv2 = tv3 * tv1
tv1 = F.mul(tv1, tv1); // 23. tv1 = tv1 * tv1
tvv5 = F.mul(tv4, tv1); // 24. tv5 = tv4 * tv1
tv3 = F.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1)
tv4 = F.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1)
}
// RFC 9380 Appendix F.2.1.1 defines sqrt_ratio(u, v) for v != 0.
// When u = 0 and v != 0, u / v = 0 is square and the computed root is
// still 0, so widen only the final flag and keep the full control flow.
return { isValid: !F.is0(v) && (isQR || F.is0(u)), value: tv3 };
};
if (F.ORDER % _4n === _3n) {
// sqrt_ratio_3mod4(u, v)
const c1 = (F.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic
const c2 = F.sqrt(F.neg(Z)); // 2. c2 = sqrt(-Z)
sqrtRatio = (u, v) => {
let tv1 = F.sqr(v); // 1. tv1 = v^2
const tv2 = F.mul(u, v); // 2. tv2 = u * v
tv1 = F.mul(tv1, tv2); // 3. tv1 = tv1 * tv2
let y1 = F.pow(tv1, c1); // 4. y1 = tv1^c1
y1 = F.mul(y1, tv2); // 5. y1 = y1 * tv2
const y2 = F.mul(y1, c2); // 6. y2 = y1 * c2
const tv3 = F.mul(F.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v
const isQR = F.eql(tv3, u); // 9. isQR = tv3 == u
let y = F.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)
return { isValid: !F.is0(v) && isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2
};
}
// No curves uses that
// if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8
return sqrtRatio;
}
/**
* Simplified Shallue-van de Woestijne-Ulas Method
* See {@link https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 | RFC 9380 section 6.6.2}.
* @param Fp - Field implementation.
* @param opts - SWU parameters:
* - `A`: Curve parameter `A`.
* - `B`: Curve parameter `B`.
* - `Z`: Simplified SWU map parameter.
* @returns Deterministic map-to-curve function.
* @throws If the SWU parameters are invalid or the field lacks the required helpers. {@link Error}
* @example
* Map one field element to a Weierstrass curve point with the SWU recipe.
*
* ```ts
* import { mapToCurveSimpleSWU } from '@noble/curves/abstract/hash-to-curve.js';
* import { Field } from '@noble/curves/abstract/modular.js';
* const Fp = Field(17n);
* const map = mapToCurveSimpleSWU(Fp, { A: 1n, B: 2n, Z: 3n });
* const point = map(5n);
* ```
*/
export function mapToCurveSimpleSWU(Fp, opts) {
const F = validateField(Fp);
validateObject(opts, {}, {}, 'opts');
const { A, B, Z } = opts;
if (!F.isValidNot0(A) || !F.isValidNot0(B) || !F.isValid(Z))
throw new Error('mapToCurveSimpleSWU: invalid opts');
// RFC 9380 §6.6.2 and Appendix H.2 require:
// 1. Z is non-square in F
// 2. Z != -1 in F
// 3. g(x) - Z is irreducible over F
// 4. g(B / (Z * A)) is square in F
// We can enforce 1, 2, and 4 with the current field API.
// Criterion 3 is not checked here because generic `IField<T>` does not expose
// polynomial-ring / irreducibility operations, and this helper is used for
// both prime and extension fields.
if (F.eql(Z, F.neg(F.ONE)) || FpIsSquare(F, Z))
throw new Error('mapToCurveSimpleSWU: invalid opts');
// RFC 9380 Appendix H.2 criterion 4: g(B / (Z * A)) is square in F.
// x = B / (Z * A)
const x = F.mul(B, F.inv(F.mul(Z, A)));
// g(x) = x^3 + A*x + B
const gx = F.add(F.add(F.mul(F.sqr(x), x), F.mul(A, x)), B);
if (!FpIsSquare(F, gx))
throw new Error('mapToCurveSimpleSWU: invalid opts');
const sqrtRatio = SWUFpSqrtRatio(F, Z);
if (!F.isOdd)
throw new Error('Field does not have .isOdd()');
// Input: u, an element of F.
// Output: (x, y), a point on E.
return (u) => {
// prettier-ignore
let tv1, tv2, tv3, tv4, tv5, tv6, x, y;
tv1 = F.sqr(u); // 1. tv1 = u^2
tv1 = F.mul(tv1, Z); // 2. tv1 = Z * tv1
tv2 = F.sqr(tv1); // 3. tv2 = tv1^2
tv2 = F.add(tv2, tv1); // 4. tv2 = tv2 + tv1
tv3 = F.add(tv2, F.ONE); // 5. tv3 = tv2 + 1
tv3 = F.mul(tv3, B); // 6. tv3 = B * tv3
tv4 = F.cmov(Z, F.neg(tv2), !F.eql(tv2, F.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0)
tv4 = F.mul(tv4, A); // 8. tv4 = A * tv4
tv2 = F.sqr(tv3); // 9. tv2 = tv3^2
tv6 = F.sqr(tv4); // 10. tv6 = tv4^2
tv5 = F.mul(tv6, A); // 11. tv5 = A * tv6
tv2 = F.add(tv2, tv5); // 12. tv2 = tv2 + tv5
tv2 = F.mul(tv2, tv3); // 13. tv2 = tv2 * tv3
tv6 = F.mul(tv6, tv4); // 14. tv6 = tv6 * tv4
tv5 = F.mul(tv6, B); // 15. tv5 = B * tv6
tv2 = F.add(tv2, tv5); // 16. tv2 = tv2 + tv5
x = F.mul(tv1, tv3); // 17. x = tv1 * tv3
const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)
y = F.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1
y = F.mul(y, value); // 20. y = y * y1
x = F.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square)
y = F.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square)
const e1 = F.isOdd(u) === F.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y)
y = F.cmov(F.neg(y), y, e1); // 24. y = CMOV(-y, y, e1)
const tv4_inv = FpInvertBatch(F, [tv4], true)[0];
x = F.mul(x, tv4_inv); // 25. x = x / tv4
return { x, y };
};
}

@@ -61,3 +61,3 @@ /**

* @param number - Value to invert.
* @param modulo - Positive modulus.
* @param modulo - Modulus greater than 1.
* @returns Multiplicative inverse.

@@ -74,2 +74,28 @@ * @throws If the modulus is invalid or the inverse does not exist. {@link Error}

/**
* Inverses number over modulo using Fermat's little theorem: `a^(p-2) ≡ a⁻¹ (mod p)`.
*
* Unlike {@link invert} (extended Euclidean), the exponent `p-2` is a public constant, so the
* underlying square-and-multiply has the same control flow for every secret `a`: there is no
* data-dependent branching or loop count that could leak `a` through timing (e.g. Minerva-style
* ECDSA nonce-inversion attacks). This is only "algorithmically" constant-time — JS bigint
* multiplication/reduction is still value-dependent — and it is roughly 4x slower than
* {@link invert}.
*
* REQUIRES a prime modulus; Fermat's theorem does not hold otherwise. The result is verified to be
* a real inverse, so a non-prime modulus (or a non-invertible input) fails closed with an error
* instead of returning a wrong value.
* @param a - Value to invert.
* @param prime - Prime modulus.
* @returns Multiplicative inverse in `[1, prime)`.
* @throws If the modulus is below 2, the input reduces to zero, or the inverse does not exist.
* {@link Error}
* @example
* Compute one modular inverse without secret-dependent branching.
*
* ```ts
* invertCt(3n, 11n); // 4n, since 3 * 4 = 12 ≡ 1 (mod 11)
* ```
*/
export declare function invertCt(a: bigint, prime: bigint): bigint;
/**
* Tonelli-Shanks square root search algorithm.

@@ -339,7 +365,11 @@ * This implementation is variable-time: it searches data-dependently for the first non-residue `Z`

* Efficiently invert an array of Field elements.
* Exception-free. Zero-valued field elements stay `undefined` unless `passZero` is enabled.
* Zero-valued inputs are not inverted: by default their slot stays `undefined` (hence the
* `(T | undefined)[]` return type), or becomes `0` when `passZero` is enabled. Because of that the
* batch never calls `inv` on a zero, so over a prime field it is exception-free. The single
* `Fp.inv` of the accumulated product can still throw, but only for a non-invertible product, which
* a prime `ORDER` cannot produce (it requires a composite / non-field `ORDER`).
* @param Fp - Field implementation.
* @param nums - Values to invert.
* @param passZero - map 0 to 0 (instead of undefined)
* @returns Inverted values.
* @returns Inverted values; entries for zero inputs are `undefined` unless `passZero` is set.
* @example

@@ -354,3 +384,4 @@ * Invert several field elements with one shared inversion.

*/
export declare function FpInvertBatch<T>(Fp: TArg<IField<T>>, nums: T[], passZero?: boolean): T[];
export declare function FpInvertBatch<T>(Fp: TArg<IField<T>>, nums: T[], passZero: true): T[];
export declare function FpInvertBatch<T>(Fp: TArg<IField<T>>, nums: T[], passZero?: boolean): (T | undefined)[];
/**

@@ -383,3 +414,3 @@ * @param Fp - Field implementation.

* @returns Legendre symbol.
* @throws If the field returns an invalid Legendre symbol value. {@link Error}
* @throws If the powered value does not match a valid Legendre symbol. {@link Error}
* @example

@@ -556,2 +587,1 @@ * Compute the Legendre symbol of one field element.

export {};
//# sourceMappingURL=modular.d.ts.map

@@ -8,3 +8,3 @@ /**

/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { abool, abytes, anumber, asafenumber, bitLen, bytesToNumberBE, bytesToNumberLE, numberToBytesBE, numberToBytesLE, validateObject, } from "../utils.js";
import { aarray, abool, abytes, afunction, anumber, aobject, asafenumber, bitLen, bytesToNumberBE, bytesToNumberLE, numberToBytesBE, numberToBytesLE, } from "../utils.js";
// Numbers aren't used in x25519 / x448 builds

@@ -17,3 +17,6 @@ // prettier-ignore

const _7n = /* @__PURE__ */ BigInt(7), _8n = /* @__PURE__ */ BigInt(8), _9n = /* @__PURE__ */ BigInt(9);
const _16n = /* @__PURE__ */ BigInt(16);
const _15n = /* @__PURE__ */ BigInt(15), _16n = /* @__PURE__ */ BigInt(16);
// 2^64: exponents below this use plain square-and-multiply in pow()/FpPow(); the windowed path's
// table build (14 multiplications) only pays off for longer exponents (break-even ~50 bits).
const POW_WINDOWED_MIN = /* @__PURE__ */ BigInt('0x10000000000000000');
/**

@@ -55,3 +58,53 @@ * @param a - Dividend value.

export function pow(num, power, modulo) {
return FpPow(Field(modulo), num, power);
if (modulo <= _1n)
throw new Error('pow: expected modulus > 1, got ' + modulo);
// Non-bigint exponents coerce every comparison below to false and would silently return 1.
if (typeof power !== 'bigint')
throw new TypeError('invalid exponent: expected bigint, got ' + typeof power);
if (power < _0n)
throw new Error('invalid exponent, negatives unsupported');
if (power === _0n)
return _1n;
if (power === _1n)
return num;
let d = num % modulo;
if (d < _0n)
d += modulo;
// Control flow in both branches below depends only on the exponent, never on `num` — invertCt()
// relies on that for its (public-exponent) secret-independence guarantee.
if (power < POW_WINDOWED_MIN) {
// Square-and-multiply: cheaper than the windowed path for short exponents.
let p = _1n;
while (power > _0n) {
if (power & _1n)
p = (p * d) % modulo;
d = (d * d) % modulo;
power >>= _1n;
}
return p;
}
// Fixed 4-bit windows, MSB-first: a 14-multiplication table drops per-window cost to <1
// multiplication (vs ~2 per window for square-and-multiply), ~25-30% faster for the dense
// 256-bit exponents of sqrt / Legendre / invertCt.
const digits = [];
while (power > _0n) {
digits.push(Number(power & _15n));
power >>= _4n;
}
const table = new Array(16);
table[0] = _1n;
table[1] = d;
for (let i = 2; i < 16; i++)
table[i] = (table[i - 1] * d) % modulo;
let p = table[digits[digits.length - 1]]; // top digit is nonzero: the loop above stops on 0
for (let w = digits.length - 2; w >= 0; w--) {
p = (p * p) % modulo;
p = (p * p) % modulo;
p = (p * p) % modulo;
p = (p * p) % modulo;
const digit = digits[w];
if (digit !== 0)
p = (p * table[digit]) % modulo;
}
return p;
}

@@ -75,2 +128,4 @@ /**

export function pow2(x, power, modulo) {
if (modulo <= _1n)
throw new Error('pow2: expected modulus > 1, got ' + modulo);
if (power < _0n)

@@ -89,3 +144,3 @@ throw new Error('pow2: expected non-negative exponent, got ' + power);

* @param number - Value to invert.
* @param modulo - Positive modulus.
* @param modulo - Modulus greater than 1.
* @returns Multiplicative inverse.

@@ -103,9 +158,14 @@ * @throws If the modulus is invalid or the inverse does not exist. {@link Error}

throw new Error('invert: expected non-zero number');
if (modulo <= _0n)
throw new Error('invert: expected positive modulus, got ' + modulo);
// Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower.
// modulo = 1 is the zero ring: gcd(x, 1) = 1 makes the loop below "succeed" and return the
// useless inverse 0. Reject it like pow() and invertCt() do.
if (modulo <= _1n)
throw new Error('invert: expected modulus > 1, got ' + modulo);
// This is variable-time: the loop count depends on `number`. For a secret-independent
// (Fermat) alternative over a prime modulus, see {@link invertCt} (~4x slower).
let a = mod(number, modulo);
let b = modulo;
// Only the Bézout coefficient of `number` (x/u chain) is tracked; the coefficient of `modulo`
// never affects the output, so it is not computed.
// prettier-ignore
let x = _0n, y = _1n, u = _1n, v = _0n;
let x = _0n, u = _1n;
while (a !== _0n) {

@@ -115,5 +175,4 @@ const q = b / a;

const m = x - u * q;
const n = y - v * q;
// prettier-ignore
b = a, a = r, x = u, y = v, u = m, v = n;
b = a, a = r, x = u, u = m;
}

@@ -125,2 +184,40 @@ const gcd = b;

}
/**
* Inverses number over modulo using Fermat's little theorem: `a^(p-2) ≡ a⁻¹ (mod p)`.
*
* Unlike {@link invert} (extended Euclidean), the exponent `p-2` is a public constant, so the
* underlying square-and-multiply has the same control flow for every secret `a`: there is no
* data-dependent branching or loop count that could leak `a` through timing (e.g. Minerva-style
* ECDSA nonce-inversion attacks). This is only "algorithmically" constant-time — JS bigint
* multiplication/reduction is still value-dependent — and it is roughly 4x slower than
* {@link invert}.
*
* REQUIRES a prime modulus; Fermat's theorem does not hold otherwise. The result is verified to be
* a real inverse, so a non-prime modulus (or a non-invertible input) fails closed with an error
* instead of returning a wrong value.
* @param a - Value to invert.
* @param prime - Prime modulus.
* @returns Multiplicative inverse in `[1, prime)`.
* @throws If the modulus is below 2, the input reduces to zero, or the inverse does not exist.
* {@link Error}
* @example
* Compute one modular inverse without secret-dependent branching.
*
* ```ts
* invertCt(3n, 11n); // 4n, since 3 * 4 = 12 ≡ 1 (mod 11)
* ```
*/
export function invertCt(a, prime) {
if (prime <= _1n)
throw new Error('invertCt: expected prime modulus > 1, got ' + prime);
const an = mod(a, prime);
if (an === _0n)
throw new Error('invertCt: expected non-zero number');
// Exponent (prime - 2) is public, so FpPow's square-and-multiply is secret-independent.
const inverse = pow(an, prime - _2n, prime);
// O(1) safety net: verifies the inverse and rejects composite moduli where a^(p-2) is not one.
if (mod(an * inverse, prime) !== _1n)
throw new Error('invertCt: does not exist');
return inverse;
}
function assertIsSquare(Fp, root, n) {

@@ -131,2 +228,11 @@ const F = Fp;

}
// The Legendre symbol and every sqrt variant here are only defined over an odd (prime) modulus.
// An even ORDER makes their integer divisions — (p-1)/2, (p+1)/4, (p-5)/8, (p+7)/16 — truncate and
// silently return a wrong result, so reject it explicitly at the entry points instead. This is a
// cheap necessary-condition check, not a primality test (composite odd moduli are caught later by
// the Legendre-result / assertIsSquare checks).
function aoddModulus(order, fnName) {
if ((order & _1n) === _0n)
throw new Error(fnName + ': expected odd modulus, got ' + order);
}
// Not all roots are possible! Example which will throw:

@@ -204,2 +310,3 @@ // const NUM =

throw new Error('sqrt is not defined for small field');
aoddModulus(P, 'tonelliShanks');
// Factor P - 1 = Q * 2^S, where Q is odd

@@ -243,4 +350,6 @@ let Q = P - _1n;

while (!F.eql(t, F.ONE)) {
// Unreachable over a genuine field (no zero divisors; n=0 already returned above). A zero t
// means composite ORDER, where a fabricated root would be wrong: fail closed instead.
if (F.is0(t))
return F.ZERO; // if t=0 return R=0
throw new Error('Cannot find square root: probably non-prime P');
let i = 1;

@@ -292,2 +401,3 @@ // Find the smallest i >= 1 such that t^(2^i) ≡ 1 (mod P)

export function FpSqrt(P) {
aoddModulus(P, 'Fp.sqrt');
// P ≡ 3 (mod 4) => √n = n^((P+1)/4)

@@ -342,16 +452,11 @@ if (P % _4n === _3n)

export function validateField(field) {
const initial = {
ORDER: 'bigint',
BYTES: 'number',
BITS: 'number',
};
const opts = FIELD_FIELDS.reduce((map, val) => {
map[val] = 'function';
return map;
}, initial);
validateObject(field, opts);
aobject(field, 'field');
if (typeof field.ORDER !== 'bigint')
throw new TypeError('param "ORDER" is invalid: expected bigint, got ' + typeof field.ORDER);
// Runtime field implementations must expose real integer byte/bit sizes; fractional / NaN /
// infinite metadata leaks through validateObject(type='number') but breaks encoders and caches.
// infinite metadata breaks encoders and caches.
asafenumber(field.BYTES, 'BYTES');
asafenumber(field.BITS, 'BITS');
for (const name of FIELD_FIELDS)
afunction(field[name], 'field.' + name);
// Runtime field implementations must expose positive byte/bit sizes; zero leaks through the

@@ -384,3 +489,8 @@ // numeric shape checks above but still breaks encoding helpers and cached-length assumptions.

export function FpPow(Fp, num, power) {
validateField(Fp);
const F = Fp;
// Non-bigint exponents (e.g. an accidental field element) coerce every comparison below to
// false and would silently return ONE.
if (typeof power !== 'bigint')
throw new TypeError('invalid exponent: expected bigint, got ' + typeof power);
if (power < _0n)

@@ -392,29 +502,40 @@ throw new Error('invalid exponent, negatives unsupported');

return num;
let p = F.ONE;
let d = num;
if (power < POW_WINDOWED_MIN) {
// Square-and-multiply: cheaper than the windowed path for short exponents (e.g. poseidon
// sbox x^5), which would waste the 14-multiplication table build.
let p = F.ONE;
let d = num;
while (power > _0n) {
if (power & _1n)
p = F.mul(p, d);
d = F.sqr(d);
power >>= _1n;
}
return p;
}
// Fixed 4-bit windows, MSB-first — same shape as pow() above, over generic field ops.
// Speeds up dense long exponents (extension-field sqrt / Legendre, e.g. Fp2 decompression).
const digits = [];
while (power > _0n) {
if (power & _1n)
p = F.mul(p, d);
d = F.sqr(d);
power >>= _1n;
digits.push(Number(power & _15n));
power >>= _4n;
}
const table = new Array(16);
table[0] = F.ONE;
table[1] = num;
for (let i = 2; i < 16; i++)
table[i] = F.mul(table[i - 1], num);
let p = table[digits[digits.length - 1]]; // top digit is nonzero: the loop above stops on 0
for (let w = digits.length - 2; w >= 0; w--) {
p = F.sqr(F.sqr(F.sqr(F.sqr(p))));
const digit = digits[w];
if (digit !== 0)
p = F.mul(p, table[digit]);
}
return p;
}
/**
* Efficiently invert an array of Field elements.
* Exception-free. Zero-valued field elements stay `undefined` unless `passZero` is enabled.
* @param Fp - Field implementation.
* @param nums - Values to invert.
* @param passZero - map 0 to 0 (instead of undefined)
* @returns Inverted values.
* @example
* Invert several field elements with one shared inversion.
*
* ```ts
* import { Field, FpInvertBatch } from '@noble/curves/abstract/modular.js';
* const Fp = Field(17n);
* const inv = FpInvertBatch(Fp, [1n, 2n, 4n]);
* ```
*/
export function FpInvertBatch(Fp, nums, passZero = false) {
validateField(Fp);
aarray(nums, 'nums');
abool(passZero, 'passZero');
const F = Fp;

@@ -435,2 +556,3 @@ const inverted = new Array(nums.length).fill(passZero ? F.ZERO : undefined);

return acc;
// Non-zero `num` means the forward pass already stored a defined prefix product at index i.
inverted[i] = F.mul(acc, inverted[i]);

@@ -457,2 +579,3 @@ return F.mul(acc, num);

export function FpDiv(Fp, lhs, rhs) {
validateField(Fp);
const F = Fp;

@@ -472,3 +595,3 @@ return F.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, F.ORDER) : F.inv(rhs));

* @returns Legendre symbol.
* @throws If the field returns an invalid Legendre symbol value. {@link Error}
* @throws If the powered value does not match a valid Legendre symbol. {@link Error}
* @example

@@ -484,3 +607,5 @@ * Compute the Legendre symbol of one field element.

export function FpLegendre(Fp, n) {
validateField(Fp);
const F = Fp;
aoddModulus(F.ORDER, 'FpLegendre');
// We can use 3rd argument as optional cache of this value

@@ -542,3 +667,3 @@ // but seems unneeded for now. The operation is very fast.

if (nBitLength !== undefined && nBitLength < bits)
throw new Error(`invalid n length: expected bit length (${bits}) >= n.length (${nBitLength})`);
throw new Error(`invalid n length: expected nBitLength (${nBitLength}) >= bitLen(n) (${bits})`);
const _nBitLength = nBitLength !== undefined ? nBitLength : bits;

@@ -627,3 +752,3 @@ const nByteLength = Math.ceil(_nBitLength / 8);

pow(num, power) {
return FpPow(this, num, power);
return pow(num, power, this.ORDER);
}

@@ -691,3 +816,6 @@ div(lhs, rhs) {

invertBatch(lst) {
return FpInvertBatch(this, lst);
// `passZero` keeps the `bigint[]` contract honest: zero inputs map to `0` instead of leaking
// `undefined` into a `bigint[]`. Callers that must distinguish non-invertible inputs should use
// `FpInvertBatch` directly, whose default omits `passZero` and returns `(bigint | undefined)[]`.
return FpInvertBatch(this, lst, true);
}

@@ -703,5 +831,2 @@ // We can't move this out because Fp6, Fp12 implement it

}
// Freeze the shared method surface too; otherwise callers can still poison every Field instance by
// monkey-patching `_Field.prototype` even if each instance is frozen.
Object.freeze(_Field.prototype);
/**

@@ -734,17 +859,9 @@ * Creates a finite field. Major performance optimizations:

export function Field(ORDER, opts = {}) {
// Freeze the shared method surface before any instance is reachable; otherwise callers can
// poison every Field instance by monkey-patching `_Field.prototype` even if each instance is
// frozen. Freezing here instead of module scope keeps `_Field` tree-shakeable for importers
// that never construct a field; the call is idempotent and cheap.
Object.freeze(_Field.prototype);
return new _Field(ORDER, opts);
}
// Generic random scalar, we can do same for other fields if via Fp2.mul(Fp2.ONE, Fp2.random)?
// This allows unsafe methods like ignore bias or zero. These unsafe, but often used in different protocols (if deterministic RNG).
// which mean we cannot force this via opts.
// Not sure what to do with randomBytes, we can accept it inside opts if wanted.
// Probably need to export getMinHashLength somewhere?
// random(bytes?: Uint8Array, unsafeAllowZero = false, unsafeAllowBias = false) {
// const LEN = !unsafeAllowBias ? getMinHashLength(ORDER) : BYTES;
// if (bytes === undefined) bytes = randomBytes(LEN); // _opts.randomBytes?
// const num = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);
// // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0
// const reduced = unsafeAllowZero ? mod(num, ORDER) : mod(num, ORDER - _1n) + _1n;
// return reduced;
// },
/**

@@ -766,2 +883,3 @@ * @param Fp - Field implementation.

export function FpSqrtOdd(Fp, elm) {
validateField(Fp);
const F = Fp;

@@ -788,2 +906,3 @@ if (!F.isOdd)

export function FpSqrtEven(Fp, elm) {
validateField(Fp);
const F = Fp;

@@ -872,6 +991,9 @@ if (!F.isOdd)

const num = isLE ? bytesToNumberLE(key) : bytesToNumberBE(key);
// `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0
// Map into the non-zero scalar range [1, fieldOrder-1]: reduce mod (fieldOrder-1) to land in
// [0, fieldOrder-2], then add 1. This shifts the range off zero; it is NOT equal to
// `mod(num, fieldOrder)` (which spans [0, fieldOrder-1] and can be 0). A residual modulo bias
// remains but is negligible (~2^-(nBits/2), e.g. ~2^-128 for a 256-bit order) because `key` is
// required to be at least `getMinHashLength(fieldOrder)` (~1.5x field size) bytes of input.
const reduced = mod(num, fieldOrder - _1n) + _1n;
return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
}
//# sourceMappingURL=modular.js.map

@@ -30,5 +30,16 @@ /**

* Optional randomness source for `keygen()` and `utils.randomSecretKey()`.
* Receives the requested byte length and returns fresh random bytes.
* @param bytesLength - Requested byte length.
* @returns Random bytes.
*/
randomBytes?: (bytesLength?: number) => TRet<Uint8Array>;
/**
* Optional fast fixed-base multiplication, replacing the Montgomery ladder in
* `scalarMultBase()` / `getPublicKey()` only. Standard implementation computes `[k]B` on the
* equivalent Edwards curve with cached base-point tables and maps the result back to a
* Montgomery `u` coordinate (libsodium does the same for X25519); ~3x faster than the ladder.
* @param k - Decoded, clamped scalar; guaranteed to be in the RFC 7748 clamped range.
* @returns `u([k]G)` as an integer. Must return `0` when `[k]G` is the point at infinity
* (`k ≡ 0 mod n`) so the caller can reject it exactly like the ladder path does.
*/
scalarMultBase?: (k: bigint) => bigint;
};

@@ -84,2 +95,55 @@ /** Public X25519/X448 ECDH API built on a Montgomery ladder. */

/**
* Selector for cswap(): `P` to keep, `P + 1` to swap, chosen by the low bit of `swap`.
* Higher bits are ignored, and `swap` is passed in whole rather than as a {0n, 1n} bit on
* purpose: `P + (swap & _1n)` would short-circuit the addition whenever the bit is clear, which
* is the very leak this construction avoids, one round-trip further down. Subtracting `swap`
* with its low bit cleared keeps every operand full-width instead.
* @param P - Field modulus.
* @param swap - Value whose low bit selects; ignored above that bit.
* @returns `P` when the low bit is clear, `P + 1` when it is set.
*/
declare function cmask(P: bigint, swap: bigint): bigint;
/**
* Swap two field elements when `mask` is `P + 1`, keep them when it is `P`:
*
* d = 6P + x_3 - x_2
* x_2' = d * mask + x_2 (mod P) x_3' = (x_2 + x_3) - x_2'
*
* The extra `6P * mask` vanishes modulo P, so `mask === P` leaves x_2 and `mask === P + 1`
* leaves x_3. Without the offset, the reduction dividend changes sign with input order and crosses
* BigInt limb boundaries; those classes measured differently on the tested Node/V8 build. For
* canonical inputs, the deliberately left-associative `offset + x_3 - x_2` is between 5P and 7P,
* keeping the dividend positive and in one word-count band for both RFC fields and masks. Six is
* the smallest coefficient `c` for which the shared offset `cP` has that property.
*
* This reduced the tested sign/size timing ratios, but JavaScript BigInt has no constant-time
* contract and the contents of the multiply and remainder still vary. Valid ladder states can
* contain genuine zero coordinates; this construction does not mask those value-shape effects.
* Computing `x_3'` independently as `((6P + x_2 - x_3) * mask + x_3) % P` is more symmetric.
* On the tested Node/V8 build, it reduced the timing difference between keeping `(0, v)` and
* swapping `(v, 0)`—both return `(0, v)`—from about 10%/13% for X25519/X448 to about 3%.
* Successful calls cannot reach that zero-in-the-first-output case. For the case they can reach,
* swapping `(0, v)` and keeping `(v, 0)` both return `(v, 0)`; the difference instead grew from
* about 0.7%/1.1% to 2.7%/2.8%. The extra multiply/remainder also made public
* `getSharedSecret()` about 16% slower. The retained one-remainder form measured about 2.5%
* slower than the prior helper for public X25519 `getSharedSecret()` in the same environment.
* x_3' falls out of the sum, which a swap leaves invariant: no second multiply or reduction is
* needed. Bind `6P` once per field so production and the timing regression exercise the same
* configured helper without paying for the multiplication in every ladder round.
*
* The returned function is called twice per ladder round, so it validates nothing. Both elements
* MUST already be reduced mod P; unreduced input silently corrupts the kept-side output.
* @param P - Field modulus.
* @returns A field-bound swap function taking mask, x_2, and x_3.
*/
declare function cswap(P: bigint): (mask: bigint, x_2: bigint, x_3: bigint) => {
x_2: bigint;
x_3: bigint;
};
/** Internal helpers, exported for tests only. Not part of the public API. */
export declare const __TEST: {
cmask: typeof cmask;
cswap: typeof cswap;
};
/**
* @param curveDef - Montgomery curve definition.

@@ -89,11 +153,36 @@ * @returns ECDH helper namespace.

* @example
* Perform one X25519 key exchange through the generic Montgomery helper.
* Build an X25519 helper from curve parameters, then derive one public key.
*
* ```ts
* import { x25519 } from '@noble/curves/ed25519.js';
* const alice = x25519.keygen();
* const shared = x25519.getSharedSecret(alice.secretKey, alice.publicKey);
* import { montgomery } from '@noble/curves/abstract/montgomery.js';
* const P = 2n ** 255n - 19n;
* const mod = (num: bigint) => {
* const out = num % P;
* return out >= 0n ? out : out + P;
* };
* const pow = (num: bigint, power: bigint) => {
* let res = 1n;
* for (; power > 0n; power >>= 1n) {
* if (power & 1n) res = mod(res * num);
* num = mod(num * num);
* }
* return res;
* };
* const x25519 = montgomery({
* P,
* type: 'x25519',
* adjustScalarBytes(bytes: Uint8Array) {
* bytes[0] &= 248;
* bytes[31] &= 127;
* bytes[31] |= 64;
* return bytes;
* },
* powPminus2(x) {
* return pow(x, P - 2n);
* },
* });
* const publicKey = x25519.getPublicKey(new Uint8Array(32).fill(1));
* ```
*/
export declare function montgomery(curveDef: TArg<MontgomeryOpts>): TRet<MontgomeryECDH>;
//# sourceMappingURL=montgomery.d.ts.map
export {};

@@ -11,5 +11,76 @@ /**

import { mod } from "./modular.js";
const _0n = BigInt(0);
const _1n = BigInt(1);
const _2n = BigInt(2);
const _0n = /* @__PURE__ */ BigInt(0);
const _1n = /* @__PURE__ */ BigInt(1);
const _2n = /* @__PURE__ */ BigInt(2);
// cswap from RFC7748 "example code", adapted to BigInt.
//
// RFC: "dummy = mask(swap) AND (x_2 XOR x_3), where mask(swap) is the all-1 or all-0 word of the
// same length as x_2 and x_3". On fixed-width machine words both cases cost the same. BigInt has
// no fixed width, so a {0n, 1n} selector does not: V8 short-circuits `0n * v` - and, identically,
// `0n & v`, `v + 0n`, `v - 0n` - to a no-op, while `1n * v` is a real multiply. The ladder calls
// this with swap = k_t XOR k_(t+1), which would make total running time a linear function of how
// often adjacent bits of the secret scalar differ: remotely measurable, and worth ~4 bits of a
// long-term key.
//
// So select with a full-width mask instead, and interpolate rather than mask off a dummy.
/**
* Selector for cswap(): `P` to keep, `P + 1` to swap, chosen by the low bit of `swap`.
* Higher bits are ignored, and `swap` is passed in whole rather than as a {0n, 1n} bit on
* purpose: `P + (swap & _1n)` would short-circuit the addition whenever the bit is clear, which
* is the very leak this construction avoids, one round-trip further down. Subtracting `swap`
* with its low bit cleared keeps every operand full-width instead.
* @param P - Field modulus.
* @param swap - Value whose low bit selects; ignored above that bit.
* @returns `P` when the low bit is clear, `P + 1` when it is set.
*/
function cmask(P, swap) {
return P + swap - ((swap >> _1n) << _1n);
}
/**
* Swap two field elements when `mask` is `P + 1`, keep them when it is `P`:
*
* d = 6P + x_3 - x_2
* x_2' = d * mask + x_2 (mod P) x_3' = (x_2 + x_3) - x_2'
*
* The extra `6P * mask` vanishes modulo P, so `mask === P` leaves x_2 and `mask === P + 1`
* leaves x_3. Without the offset, the reduction dividend changes sign with input order and crosses
* BigInt limb boundaries; those classes measured differently on the tested Node/V8 build. For
* canonical inputs, the deliberately left-associative `offset + x_3 - x_2` is between 5P and 7P,
* keeping the dividend positive and in one word-count band for both RFC fields and masks. Six is
* the smallest coefficient `c` for which the shared offset `cP` has that property.
*
* This reduced the tested sign/size timing ratios, but JavaScript BigInt has no constant-time
* contract and the contents of the multiply and remainder still vary. Valid ladder states can
* contain genuine zero coordinates; this construction does not mask those value-shape effects.
* Computing `x_3'` independently as `((6P + x_2 - x_3) * mask + x_3) % P` is more symmetric.
* On the tested Node/V8 build, it reduced the timing difference between keeping `(0, v)` and
* swapping `(v, 0)`—both return `(0, v)`—from about 10%/13% for X25519/X448 to about 3%.
* Successful calls cannot reach that zero-in-the-first-output case. For the case they can reach,
* swapping `(0, v)` and keeping `(v, 0)` both return `(v, 0)`; the difference instead grew from
* about 0.7%/1.1% to 2.7%/2.8%. The extra multiply/remainder also made public
* `getSharedSecret()` about 16% slower. The retained one-remainder form measured about 2.5%
* slower than the prior helper for public X25519 `getSharedSecret()` in the same environment.
* x_3' falls out of the sum, which a swap leaves invariant: no second multiply or reduction is
* needed. Bind `6P` once per field so production and the timing regression exercise the same
* configured helper without paying for the multiplication in every ladder round.
*
* The returned function is called twice per ladder round, so it validates nothing. Both elements
* MUST already be reduced mod P; unreduced input silently corrupts the kept-side output.
* @param P - Field modulus.
* @returns A field-bound swap function taking mask, x_2, and x_3.
*/
function cswap(P) {
const offset = BigInt(6) * P;
return (mask, x_2, x_3) => {
const sum = x_2 + x_3;
const d = offset + x_3 - x_2;
const a = (d * mask + x_2) % P;
return { x_2: a, x_3: sum - a };
};
}
/** Internal helpers, exported for tests only. Not part of the public API. */
export const __TEST = /* @__PURE__ */ Object.freeze({
cmask,
cswap,
});
function validateOpts(curve) {

@@ -26,2 +97,3 @@ // Validate constructor config eagerly, but do not call user-provided hooks here:

randomBytes: 'function',
scalarMultBase: 'function',
});

@@ -35,8 +107,33 @@ return Object.freeze({ ...curve });

* @example
* Perform one X25519 key exchange through the generic Montgomery helper.
* Build an X25519 helper from curve parameters, then derive one public key.
*
* ```ts
* import { x25519 } from '@noble/curves/ed25519.js';
* const alice = x25519.keygen();
* const shared = x25519.getSharedSecret(alice.secretKey, alice.publicKey);
* import { montgomery } from '@noble/curves/abstract/montgomery.js';
* const P = 2n ** 255n - 19n;
* const mod = (num: bigint) => {
* const out = num % P;
* return out >= 0n ? out : out + P;
* };
* const pow = (num: bigint, power: bigint) => {
* let res = 1n;
* for (; power > 0n; power >>= 1n) {
* if (power & 1n) res = mod(res * num);
* num = mod(num * num);
* }
* return res;
* };
* const x25519 = montgomery({
* P,
* type: 'x25519',
* adjustScalarBytes(bytes: Uint8Array) {
* bytes[0] &= 248;
* bytes[31] &= 127;
* bytes[31] |= 64;
* return bytes;
* },
* powPminus2(x) {
* return pow(x, P - 2n);
* },
* });
* const publicKey = x25519.getPublicKey(new Uint8Array(32).fill(1));
* ```

@@ -47,2 +144,3 @@ */

const { P, type, adjustScalarBytes, powPminus2, randomBytes: rand } = CURVE;
const mulBaseHook = CURVE.scalarMultBase;
const is25519 = type === 'x25519';

@@ -53,2 +151,3 @@ if (!is25519 && type !== 'x448')

const montgomeryBits = is25519 ? 255 : 448;
const swap = cswap(P);
const fieldLen = is25519 ? 32 : 56;

@@ -66,4 +165,4 @@ const Gu = is25519 ? BigInt(9) : BigInt(5);

const maxAdded = is25519
? BigInt(8) * _2n ** BigInt(251) - _1n
: BigInt(4) * _2n ** BigInt(445) - _1n;
? BigInt(8) * (_2n ** BigInt(251) - _1n)
: BigInt(4) * (_2n ** BigInt(445) - _1n);
const maxScalar = minScalar + maxAdded + _1n; // (inclusive)

@@ -90,7 +189,39 @@ const modP = (n) => mod(n, P);

}
/**
* u coordinates whose order divides the cofactor, on the curve and on its quadratic twist -
* the ladder sends every one of them to zero. Same blocklist libsodium and post-CVE-2017-0379
* Libgcrypt carry. decodeU() reduces mod P first, so the non-canonical encodings P and P + 1
* collapse onto 0 and 1, and `type` admits no curve beyond these two, so both lists are total.
*
* Complete by construction: x-only doubling sends u to (u^2 - 1)^2 / 4u(u^2 + a*u + 1). Order 4
* therefore needs (u^2 - 1)^2 === 0, i.e. u = +-1; order 2 needs u(u^2 + a*u + 1) === 0, and
* a^2 - 4 is a non-residue on both curves, leaving u = 0. curve448 stops there (cofactor 4);
* curve25519 (cofactor 8) adds the two order-8 roots below. Cross-checked by clearing the
* cofactor with those same doublings over 200k random u: no sixth value exists.
*/
const lowOrderU = new Set(is25519
? [
_0n,
_1n,
P - _1n,
BigInt('325606250916557431795983626356110631294008115727848805560023387167927233504'),
BigInt('39382357235489614581723060781553021112529911719440698176882885853963445705823'),
]
: [_0n, _1n, P - _1n]);
function scalarMult(scalar, u) {
const pu = montgomeryLadder(decodeU(u), decodeScalar(scalar));
// Some public keys are useless, of low-order. Curve author doesn't think
// it needs to be validated, but we do it nonetheless.
// https://cr.yp.to/ecdh.html#validate
//
// Reject them BEFORE the ladder. RFC 7748 #6.1 also permits detecting them from the
// all-zero output, but that first runs all 255 rounds against the long-term secret,
// handing an unauthenticated attacker a free timing oracle. Low-order inputs also drive
// the ladder into a degenerate state (x_2 + z_2 === 0) whose extra zero-operand
// multiplications amplify any residual key-dependent timing.
const pointU = decodeU(u);
if (lowOrderU.has(pointU))
throw new Error('invalid private or public key received');
const pu = montgomeryLadder(pointU, decodeScalar(scalar));
// Unreachable for RFC 7748 clamped scalars, which are cofactor multiples smaller than the
// group order; kept because adjustScalarBytes is caller-supplied.
if (pu === _0n)

@@ -101,17 +232,16 @@ throw new Error('invalid private or public key received');

// Computes public key from private. By doing scalar multiplication of base point.
// With a curve-provided fixed-base hook (Edwards tables), the ladder is skipped, but the
// contract — scalar validation, low-order rejection, encoding — stays identical.
function scalarMultBase(scalar) {
return scalarMult(scalar, GuBytes);
if (mulBaseHook === undefined)
return scalarMult(scalar, GuBytes);
const k = decodeScalar(scalar);
aInRange('scalar', k, minScalar, maxScalar);
const pu = modP(mulBaseHook(k));
if (pu === _0n)
throw new Error('invalid private or public key received');
return encodeU(pu);
}
const getPublicKey = scalarMultBase;
const getSharedSecret = scalarMult;
// cswap from RFC7748 "example code"
function cswap(swap, x_2, x_3) {
// dummy = mask(swap) AND (x_2 XOR x_3)
// Where mask(swap) is the all-1 or all-0 word of the same length as x_2
// and x_3, computed, e.g., as mask(swap) = 0 - swap.
const dummy = modP(swap * (x_2 - x_3));
x_2 = modP(x_2 - dummy); // x_2 = x_2 XOR dummy
x_3 = modP(x_3 + dummy); // x_3 = x_3 XOR dummy
return { x_2, x_3 };
}
/**

@@ -132,9 +262,11 @@ * Montgomery x-only multiplication ladder for the selected X25519/X448 curve.

let z_3 = _1n;
let swap = _0n;
// The RFC tracks `swap` across rounds to hold k_t XOR k_(t+1); the low bit of `kx >> t` is
// the same value, without the carried state. aInRange above pins bit (montgomeryBits - 1)
// of k set and everything above it clear, so `kx >> t` is never zero and its width is a
// function of t alone - never of a secret bit.
const kx = k ^ (k >> _1n);
for (let t = BigInt(montgomeryBits - 1); t >= _0n; t--) {
const k_t = (k >> t) & _1n;
swap ^= k_t;
({ x_2, x_3 } = cswap(swap, x_2, x_3));
({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3));
swap = k_t;
const mask = cmask(P, kx >> t);
({ x_2, x_3 } = swap(mask, x_2, x_3));
({ x_2: z_2, x_3: z_3 } = swap(mask, z_2, z_3));
const A = x_2 + z_2;

@@ -156,4 +288,6 @@ const AA = modP(A * A);

}
({ x_2, x_3 } = cswap(swap, x_2, x_3));
({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3));
// trailing cswap: the RFC's `swap` holds k_0 here, which is the low bit of k
const mask = cmask(P, k);
({ x_2, x_3 } = swap(mask, x_2, x_3));
({ x_2: z_2, x_3: z_3 } = swap(mask, z_2, z_3));
const z2 = powPminus2(z_2); // `Fp.pow(x, P - _2n)` is much slower equivalent

@@ -188,2 +322,1 @@ return modP(x_2 * z2); // Return x_2 * (z_2^(p - 2))

}
//# sourceMappingURL=montgomery.js.map

@@ -298,3 +298,3 @@ /**

*/
blindEvaluateBatch(secretKey: TArg<ScalarBytes>, blinded: TArg<PointBytes[]>, rng: RNG): TRet<OPRFBlindEvalBatch>;
blindEvaluateBatch(secretKey: TArg<ScalarBytes>, blinded: TArg<PointBytes[]>, rng?: RNG): TRet<OPRFBlindEvalBatch>;
/**

@@ -356,2 +356,1 @@ * (Client-side) A batch-aware version of `finalize` for the POPRF mode.

export declare function createOPRF<P extends CurvePoint<any, P>>(opts: OPRFOpts<P>): TRet<OPRF>;
//# sourceMappingURL=oprf.d.ts.map

@@ -54,4 +54,4 @@ /**

/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { abytes, asciiToBytes, bytesToNumberBE, bytesToNumberLE, concatBytes, numberToBytesBE, randomBytes, validateObject, } from "../utils.js";
import { pippenger, validatePointCons } from "./curve.js";
import { abytes, asciiToBytes, bytesToNumberBE, bytesToNumberLE, concatBytes, copyBytes, numberToBytesBE, randomBytes, validateObject, } from "../utils.js";
import { mulAddUnsafe, validatePointCons } from "./curve.js";
import { _DST_scalar } from "./hash-to-curve.js";

@@ -98,2 +98,4 @@ import { getMinHashLength, mapHashToField } from "./modular.js";

const randomScalar = (rng = randomBytes) => {
if (typeof rng !== 'function')
throw new TypeError('"rng" expected function, got type=' + typeof rng);
// RFC 9497 §2.1 defines RandomScalar as nonzero; blind inversion and generated public keys

@@ -106,3 +108,6 @@ // both rely on keeping this helper in the `1..n-1` range.

};
const msm = (points, scalars) => pippenger(Point, points, scalars);
// Every MSM input in this module is public (hash-derived transcript weights, wire-decoded
// points, proof scalars), so the vartime shared-doubling-chain walk is safe. It is also
// 1.6-2.5x faster than pippenger() for all realistic batch sizes (measured up to L=2048).
const msm = (points, scalars) => mulAddUnsafe(Point, points, scalars);
const getCtx = (mode) => concatBytes(asciiToBytes('OPRFV1-'), new Uint8Array([mode]), asciiToBytes('-' + name));

@@ -179,4 +184,4 @@ const ctxOPRF = getCtx(0x00);

const [c, s] = [proof.subarray(0, Fn.BYTES), proof.subarray(Fn.BYTES)].map((f) => Fn.fromBytes(f));
const t2 = Point.BASE.multiply(s).add(B.multiply(c)); // s*G + c*B
const t3 = M.multiply(s).add(Z.multiply(c)); // s*M + c*Z
const t2 = msm([Point.BASE, B], [s, c]); // s*G + c*B
const t3 = msm([M, Z], [s, c]); // s*M + c*Z
const expectedC = challengeTranscript(B, M, Z, t2, t3, ctx);

@@ -279,3 +284,10 @@ if (!Fn.eql(c, expectedC))

verifyProof(ctxVOPRF, pkS, blindedPoints, evalPoints, proof);
return items.map((i) => oprf.finalize(i.input, i.blind, i.evaluated));
// Same unblind+hash as oprf.finalize(), but reuses the evaluated points already decoded
// (and identity-checked) for verifyProof instead of deserializing each one again.
return items.map((i, j) => {
const input = inputBytes('input', i.input);
const blind = Fn.fromBytes(i.blind);
const unblinded = evalPoints[j].multiply(Fn.inv(blind)).toBytes();
return hashInput(input, unblinded);
});
},

@@ -289,3 +301,3 @@ finalize(input, blind, evaluated, blinded, publicKey, proof) {

const poprf = (info) => {
info = inputBytes('info', info);
info = copyBytes(inputBytes('info', info));
const m = hashToScalarPrefixed(encode('Info', info), ctxPOPRF);

@@ -362,2 +374,1 @@ const T = Point.BASE.multiply(m);

}
//# sourceMappingURL=oprf.js.map

@@ -199,2 +199,1 @@ /**

export {};
//# sourceMappingURL=poseidon.d.ts.map

@@ -10,3 +10,3 @@ /**

/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { asafenumber, bitGet, validateObject } from "../utils.js";
import { aarray, asafenumber, bitGet, validateObject } from "../utils.js";
import { FpInvertBatch, FpPow, validateField } from "./modular.js";

@@ -41,2 +41,3 @@ // Grain LFSR (Linear-Feedback Shift Register): https://eprint.iacr.org/2009/109.pdf

function assertValidPosOpts(opts) {
validateObject(opts, {}, {}, 'opts');
const { Fp, roundsFull } = opts;

@@ -121,2 +122,3 @@ validateField(Fp);

export function grainGenConstants(opts, skipMDS = 0) {
assertValidPosOpts(opts);
const { Fp, t, roundsFull, roundsPartial } = opts;

@@ -149,3 +151,5 @@ // `skipMDS` counts how many candidate matrices to discard before taking one.

}
mds.push(FpInvertBatch(Fp, row));
// `row` is guaranteed non-zero (the loop throws on a zero entry above), so `passZero` only
// pins the `bigint[]` return type; it does not change any value here.
mds.push(FpInvertBatch(Fp, row, true));
}

@@ -176,10 +180,12 @@ return { roundConstants, mds };

// MDS is TxT matrix
if (!Array.isArray(mds) || mds.length !== t)
aarray(mds, 'opts.mds');
if (mds.length !== t)
throw new Error('Poseidon: invalid MDS matrix');
const _mds = mds.map((mdsRow) => {
if (!Array.isArray(mdsRow) || mdsRow.length !== t)
throw new Error('invalid MDS matrix row: ' + mdsRow);
return mdsRow.map((i) => {
const _mds = mds.map((mdsRow, row) => {
aarray(mdsRow, 'opts.mds[' + row + ']');
if (mdsRow.length !== t)
throw new Error('"opts.mds[' + row + ']" expected length ' + t + ', got ' + mdsRow.length);
return mdsRow.map((i, col) => {
if (typeof i !== 'bigint')
throw new Error('invalid MDS matrix bigint: ' + i);
throw new Error('"opts.mds[' + row + '][' + col + ']" expected bigint, got type=' + typeof i);
// Hardcoded Poseidon MDS matrices often use signed entries like `-1`;

@@ -280,9 +286,12 @@ // accept bigint representatives here and reduce them into the field.

const poseidonRound = (values, isFull, idx) => {
values = values.map((i, j) => Fp.add(i, roundConstants[idx][j]));
const rc = roundConstants[idx];
if (isFull)
values = values.map((i) => sboxFn(i));
else
values = values.map((i, j) => sboxFn(Fp.add(i, rc[j])));
else {
values = values.map((i, j) => Fp.add(i, rc[j]));
values[partialIdx] = sboxFn(values[partialIdx]);
// Matrix multiplication
values = mds.map((i) => i.reduce((acc, i, j) => Fp.add(acc, Fp.mulN(i, values[j])), Fp.ZERO));
}
// Matrix multiplication. Row entries and values are reduced (< p), so each product is < p²
// and a row sum is < t⋅p²: accumulate without mod, reduce once per row instead of per cell.
values = mds.map((row) => Fp.create(row.reduce((acc, m, j) => Fp.addN(acc, Fp.mulN(m, values[j])), Fp.ZERO)));
return values;

@@ -350,2 +359,9 @@ };

constructor(Fp, rate, capacity, hash) {
validateField(Fp);
asafenumber(rate, 'rate');
asafenumber(capacity, 'capacity');
if (typeof hash !== 'function')
throw new TypeError('"hash" expected function, got type=' + typeof hash);
if (hash.roundConstants !== undefined)
aarray(hash.roundConstants, 'hash.roundConstants');
const width = spongeShape(rate, capacity);

@@ -355,4 +371,5 @@ // The direct constructor accepts an arbitrary permutation hook, but callers still

// mismatches here instead of deferring them until the first `process()` call.
if (width !== hash.roundConstants[0]?.length)
throw new Error(`invalid sponge width: expected ${hash.roundConstants[0]?.length}, got ${width}`);
if (width !== hash.roundConstants?.[0]?.length) {
throw new Error(`invalid sponge width: expected ${hash.roundConstants?.[0]?.length}, got ${width}`);
}
this.Fp = Fp;

@@ -371,2 +388,4 @@ this.hash = hash;

absorb(input) {
if (!Array.isArray(input))
throw new Error('invalid input: expected array');
for (const i of input)

@@ -464,2 +483,3 @@ if (typeof i !== 'bigint' || !this.Fp.isValid(i))

export function poseidonSponge(opts) {
validateObject(opts, {}, {}, 'opts');
const { rate, capacity } = opts;

@@ -473,2 +493,1 @@ const t = spongeShape(rate, capacity);

}
//# sourceMappingURL=poseidon.js.map

@@ -113,6 +113,2 @@ /**

fromBigTwelve: (t: BigintTwelve) => Fp12;
/** Multiply by a sparse `(o0, o1, 0, 0, o4, 0)` element. */
mul014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12;
/** Multiply by a sparse `(o0, 0, 0, o3, o4, 0)` element. */
mul034(num: Fp12, o0: Fp2, o3: Fp2, o4: Fp2): Fp12;
/** Multiply by one quadratic-extension element. */

@@ -174,3 +170,4 @@ mulByFp2(lhs: Fp12, rhs: Fp2): Fp12;

* Optional custom quadratic square-root helper.
* Receives one quadratic-extension element and returns one square root.
* @param num - Quadratic-extension element.
* @returns One square root.
*/

@@ -199,2 +196,3 @@ Fp2sqrt?: (num: Fp2) => Fp2;

* ```ts
* import { tower12, type Fp2, type Fp12 } from '@noble/curves/abstract/tower.js';
* const fields = tower12({

@@ -204,4 +202,4 @@ * ORDER: 17n,

* FP2_NONRESIDUE: [1n, 1n],
* Fp2mulByB: (num) => num,
* Fp12finalExponentiate: (num) => num,
* Fp2mulByB: (num: Fp2) => num,
* Fp12finalExponentiate: (num: Fp12) => num,
* });

@@ -218,2 +216,1 @@ * const fp12 = fields.Fp12.ONE;

export {};
//# sourceMappingURL=tower.d.ts.map

@@ -14,2 +14,3 @@ /**

import { abytes, aInRange, asafenumber, bitGet, bitLen, concatBytes, notImplemented, validateObject, } from "../utils.js";
import { validatePointCons } from "./curve.js";
import * as mod from "./modular.js";

@@ -22,8 +23,17 @@ // Be friendly to bad ECMAScript parsers by not using bigint literals

asafenumber(num, 'num');
asafenumber(degree, 'degree');
const divisorN = divisor === undefined ? degree : divisor;
asafenumber(divisorN, 'divisor');
const F = Fp;
// Generic callers can hit empty / fractional row counts through `__TEST`; fail closed instead of
// silently returning `[]` or deriving extra Frobenius rows from a truncated loop bound.
// Generic callers reach this through `__TEST`; validate before bigint operators can throw raw
// native RangeError/TypeError diagnostics for malformed tower parameters.
if (typeof modulus !== 'bigint' || modulus <= _1n)
throw new Error('calcFrobeniusCoefficients: expected valid modulus, got ' + modulus);
if (degree <= 0)
throw new Error('calcFrobeniusCoefficients: expected positive degree, got ' + degree);
if (num <= 0)
throw new Error('calcFrobeniusCoefficients: expected positive row count, got ' + num);
const _divisor = BigInt(divisor === undefined ? degree : divisor);
if (divisorN <= 0)
throw new Error('calcFrobeniusCoefficients: expected positive divisor, got ' + divisorN);
const _divisor = BigInt(divisorN);
const towerModulus = modulus ** BigInt(degree);

@@ -75,2 +85,18 @@ const res = [];

export function psiFrobenius(Fp, Fp2, base) {
mod.validateField(Fp);
mod.validateField(Fp2);
validateObject(Fp2, {
Fp: 'object',
frobeniusMap: 'function',
fromBigTuple: 'function',
mulByB: 'function',
mulByNonresidue: 'function',
reim: 'function',
Fp4Square: 'function',
NONRESIDUE: 'object',
}, {});
if (!isObj(base) || Array.isArray(base))
throw new TypeError('"base" expected Fp2 element, got type=' + typeof base);
if (!Fp2.isValid(base))
throw new RangeError('"base" expected valid Fp2 element');
// GLV endomorphism Ψ(P)

@@ -97,2 +123,7 @@ const PSI_X = Fp2.pow(base, (Fp.ORDER - _1n) / _3n); // u^((p-1)/3)

const mapAffine = (fn) => (c, P) => {
if (typeof c !== 'function')
throw new TypeError('"c" expected point constructor, got type=' + typeof c);
validatePointCons(c);
if (!(P instanceof c))
throw new TypeError('"P" expected Point instance, got type=' + typeof P);
const affine = P.toAffine();

@@ -118,3 +149,2 @@ const p = fn(affine.x, affine.y);

Fp_div2;
FROBENIUS_COEFFICIENTS;
constructor(Fp, opts = {}) {

@@ -137,4 +167,5 @@ const { NONRESIDUE = BigInt(-1), FP2_NONRESIDUE, Fp2mulByB } = opts;

this.NONRESIDUE = this.create({ c0: FP2_NONRESIDUE[0], c1: FP2_NONRESIDUE[1] });
// const Fp2Nonresidue = this.create({ c0: FP2_NONRESIDUE![0], c1: FP2_NONRESIDUE![1] });
this.FROBENIUS_COEFFICIENTS = Object.freeze(calcFrobeniusCoefficients(Fp, this.Fp_NONRESIDUE, Fp.ORDER, 2)[0]);
// NOTE: no Fp2 FROBENIUS_COEFFICIENTS table: for the shipped `u² = -1` tower the coefficients
// are always [1, -1] (x²+1 irreducible forces p ≡ 3 mod 4), so frobeniusMap conjugates
// directly and the eager table computation was pure import-time waste.
this.mulByB = (num) => {

@@ -195,3 +226,3 @@ // This config hook is trusted to return a canonical Fp2 value already.

invertBatch(nums) {
return mod.FpInvertBatch(this, nums);
return mod.FpInvertBatch(this, nums, true);
}

@@ -346,9 +377,18 @@ // Normalized

mulByNonresidue({ c0, c1 }) {
return this.mul({ c0, c1 }, this.NONRESIDUE);
const { Fp, NONRESIDUE: nr } = this;
if (nr.c0 === Fp.ONE && nr.c1 === Fp.ONE) {
return Object.freeze({ c0: Fp.sub(c0, c1), c1: Fp.add(c0, c1) });
}
if (nr.c1 === Fp.ONE) {
return Object.freeze({
c0: Fp.sub(Fp.mul(c0, nr.c0), c1),
c1: Fp.add(c0, Fp.mul(c1, nr.c0)),
});
}
return this.mul({ c0, c1 }, nr);
}
frobeniusMap({ c0, c1 }, power) {
return Object.freeze({
c0,
c1: this.Fp.mul(c1, this.FROBENIUS_COEFFICIENTS[power % 2]),
});
frobeniusMap(num, power) {
const { c0, c1 } = num;
const { Fp } = this;
return Object.freeze({ c0, c1: power % 2 === 0 ? c1 : Fp.neg(c1) });
}

@@ -507,3 +547,3 @@ }

invertBatch(nums) {
return mod.FpInvertBatch(this, nums);
return mod.FpInvertBatch(this, nums, true);
}

@@ -558,3 +598,6 @@ inv({ c0, c1, c2 }) {

}
frobeniusMap({ c0, c1, c2 }, power) {
frobeniusMap(num, power) {
const { c0, c1, c2 } = num;
if (power % 6 === 0)
return Object.freeze({ c0, c1, c2 });
const { Fp2 } = this;

@@ -707,3 +750,3 @@ return Object.freeze({

invertBatch(nums) {
return mod.FpInvertBatch(this, nums);
return mod.FpInvertBatch(this, nums, true);
}

@@ -804,6 +847,11 @@ // Normalized

frobeniusMap(lhs, power) {
const p = power % 12;
if (p === 0)
return Object.freeze({ c0: lhs.c0, c1: lhs.c1 });
if (p === 6)
return this.conjugate(lhs);
const { Fp6 } = this;
const { Fp2 } = Fp6;
const { c0, c1, c2 } = Fp6.frobeniusMap(lhs.c1, power);
const coeff = this.FROBENIUS_COEFFICIENTS[power % 12];
const coeff = this.FROBENIUS_COEFFICIENTS[p];
return Object.freeze({

@@ -829,29 +877,2 @@ c0: Fp6.frobeniusMap(lhs.c0, power),

}
// Sparse multiplication
mul014({ c0, c1 }, o0, o1, o4) {
const { Fp6 } = this;
const { Fp2 } = Fp6;
let t0 = Fp6.mul01(c0, o0, o1);
let t1 = Fp6.mul1(c1, o4);
return Object.freeze({
c0: Fp6.add(Fp6.mulByNonresidue(t1), t0), // T1 * v + T0
// (c1 + c0) * [o0, o1+o4] - T0 - T1
c1: Fp6.sub(Fp6.sub(Fp6.mul01(Fp6.add(c1, c0), o0, Fp2.add(o1, o4)), t0), t1),
});
}
mul034({ c0, c1 }, o0, o3, o4) {
const { Fp6 } = this;
const { Fp2 } = Fp6;
const a = Object.freeze({
c0: Fp2.mul(c0.c0, o0),
c1: Fp2.mul(c0.c1, o0),
c2: Fp2.mul(c0.c2, o0),
});
const b = Fp6.mul01(c1, o3, o4);
const e = Fp6.mul01(Fp6.add(c0, c1), Fp2.add(o0, o3), o4);
return Object.freeze({
c0: Fp6.add(Fp6.mulByNonresidue(b), a),
c1: Fp6.sub(e, Fp6.add(a, b)),
});
}
// A cyclotomic group is a subgroup of Fp^n defined by

@@ -889,4 +910,6 @@ // GΦₙ(p) = {α ∈ Fpⁿ : α^Φₙ(p) = 1}

aInRange('cyclotomic exponent', n, _0n, _1n << BigInt(this.X_LEN));
let z = this.ONE;
for (let i = this.X_LEN - 1; i >= 0; i--) {
if (n === _0n)
return this.ONE;
let z = num;
for (let i = bitLen(n) - 2; i >= 0; i--) {
z = this._cyclotomicSquare(z);

@@ -908,2 +931,3 @@ if (bitGet(n, i))

* ```ts
* import { tower12, type Fp2, type Fp12 } from '@noble/curves/abstract/tower.js';
* const fields = tower12({

@@ -913,4 +937,4 @@ * ORDER: 17n,

* FP2_NONRESIDUE: [1n, 1n],
* Fp2mulByB: (num) => num,
* Fp12finalExponentiate: (num) => num,
* Fp2mulByB: (num: Fp2) => num,
* Fp12finalExponentiate: (num: Fp12) => num,
* });

@@ -942,2 +966,1 @@ * const fp12 = fields.Fp12.ONE;

}
//# sourceMappingURL=tower.js.map

@@ -6,2 +6,3 @@ import { type CHash, type HmacFn, type TArg, type TRet } from '../utils.ts';

export type { AffinePoint };
export { DER, DERErr, type IDER } from './der.ts';
type EndoBasis = [[bigint, bigint], [bigint, bigint]];

@@ -11,6 +12,6 @@ /**

* Koblitz curves allow using **efficiently-computable GLV endomorphism ψ**.
* Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%.
* For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit.
* Endomorphism speeds up un-precomputed public-scalar multiplication (verification / key
* recovery) by splitting a scalar into two half-width halves that share doublings.
*
* Endomorphism consists of beta, lambda and splitScalar:
* Endomorphism consists of beta, lambda and basises:
*

@@ -26,3 +27,3 @@ * 1. GLV endomorphism ψ transforms a point: `P = (x, y) ↦ ψ(P) = (β·x mod p, y)`

* * lambda: λ ∈ Fₙ with λ³ = 1, λ ≠ 1
* * splitScalar decomposes k ↦ k₁, k₂, by using reduced basis vectors.
* * `_splitEndoScalar` decomposes k ↦ k₁, k₂, by using reduced basis vectors.
* Gauss lattice reduction calculates them from initial basis vectors `(n, 0), (-λ, 0)`

@@ -38,12 +39,2 @@ *

basises?: EndoBasis;
/**
* Optional custom scalar-splitting helper.
* Receives one scalar and returns two half-sized scalar components.
*/
splitScalar?: (k: bigint) => {
k1neg: boolean;
k1: bigint;
k2neg: boolean;
k2: bigint;
};
};

@@ -156,2 +147,13 @@ /** Two half-sized scalar components returned by endomorphism splitting. */

toHex(isCompressed?: boolean): string;
/**
* Double-scalar multiplication `a⋅this + b⋅other` via Strauss–Shamir: both scalar walks
* share one doubling chain, and GLV endomorphism (when the curve has one) halves the chain
* again by splitting each scalar. 1.3-1.7x faster than two `multiplyUnsafe()` calls.
* Not constant-time: only for public scalars, e.g. ECDSA verification's `u1⋅G + u2⋅P`.
* @param a - Scalar for this point.
* @param other - Second point.
* @param b - Scalar for the second point.
* @returns Combined product point.
*/
mulAddUnsafe(a: bigint, other: WeierstrassPoint<T>, b: bigint): WeierstrassPoint<T>;
}

@@ -211,2 +213,4 @@ /** Constructor and metadata helpers for Weierstrass points. */

endo: EndomorphismOpts;
/** RNG override used for scalar blinding. */
randomBytes: (bytesLength?: number) => TRet<Uint8Array>;
/** Optional torsion-check override. */

@@ -319,91 +323,2 @@ isTorsionFree: (c: WeierstrassPointCons<T>, point: WeierstrassPoint<T>) => boolean;

/**
* @param m - Error message.
* @example
* Throw a DER-specific error when signature parsing encounters invalid bytes.
*
* ```ts
* new DERErr('bad der');
* ```
*/
export declare class DERErr extends Error {
constructor(m?: string);
}
/** DER helper namespace used by ECDSA signature parsing and encoding. */
export type IDER = {
/**
* DER-specific error constructor.
* @param m - Error message.
* @returns DER-specific error instance.
*/
Err: typeof DERErr;
/** Low-level tag-length-value helpers used by DER encoders. */
_tlv: {
/**
* Encode one TLV record.
* @param tag - ASN.1 tag byte.
* @param data - Hex-encoded value payload.
* @returns Encoded TLV string.
*/
encode: (tag: number, data: string) => string;
/**
* Decode one TLV record and return the value plus leftover bytes.
* @param tag - Expected ASN.1 tag byte.
* @param data - Remaining DER bytes.
* @returns Parsed value plus leftover bytes.
*/
decode(tag: number, data: TArg<Uint8Array>): TRet<{
v: Uint8Array;
l: Uint8Array;
}>;
};
/** Positive-integer DER helpers used by ECDSA signature encoding. */
_int: {
/**
* Encode one positive bigint as a DER INTEGER.
* @param num - Positive integer to encode.
* @returns Encoded DER INTEGER.
*/
encode(num: bigint): string;
/**
* Decode one DER INTEGER into a bigint.
* @param data - DER INTEGER bytes.
* @returns Decoded bigint.
*/
decode(data: TArg<Uint8Array>): bigint;
};
/**
* Parse a DER signature into `{ r, s }`.
* @param bytes - DER signature bytes.
* @returns Parsed signature components.
*/
toSig(bytes: TArg<Uint8Array>): {
r: bigint;
s: bigint;
};
/**
* Encode `{ r, s }` as a DER signature.
* @param sig - Signature components.
* @returns DER-encoded signature hex.
*/
hexFromSig(sig: {
r: bigint;
s: bigint;
}): string;
};
/**
* ASN.1 DER encoding utilities. ASN is very complex & fragile. Format:
*
* [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S]
*
* Docs: {@link https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/ | Let's Encrypt ASN.1 guide} and
* {@link https://luca.ntop.org/Teaching/Appunti/asn1.html | Luca Deri's ASN.1 notes}.
* @example
* ASN.1 DER encoding utilities.
*
* ```ts
* const der = DER.hexFromSig({ r: 1n, s: 2n });
* ```
*/
export declare const DER: IDER;
/**
* Creates weierstrass Point constructor, based on specified curve options.

@@ -494,55 +409,2 @@ *

/**
* Implementation of the Shallue and van de Woestijne method for any weierstrass curve.
* TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.
* b = True and y = sqrt(u / v) if (u / v) is square in F, and
* b = False and y = sqrt(Z * (u / v)) otherwise.
* RFC 9380 expects callers to provide `v != 0`; this helper does not enforce it.
* @param Fp - Field implementation.
* @param Z - Simplified SWU map parameter.
* @returns Square-root ratio helper.
* @example
* Build the square-root ratio helper used by SWU map implementations.
*
* ```ts
* import { SWUFpSqrtRatio } from '@noble/curves/abstract/weierstrass.js';
* import { Field } from '@noble/curves/abstract/modular.js';
* const Fp = Field(17n);
* const sqrtRatio = SWUFpSqrtRatio(Fp, 3n);
* const out = sqrtRatio(4n, 1n);
* ```
*/
export declare function SWUFpSqrtRatio<T>(Fp: TArg<IField<T>>, Z: T): (u: T, v: T) => {
isValid: boolean;
value: T;
};
/**
* Simplified Shallue-van de Woestijne-Ulas Method
* See {@link https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 | RFC 9380 section 6.6.2}.
* @param Fp - Field implementation.
* @param opts - SWU parameters:
* - `A`: Curve parameter `A`.
* - `B`: Curve parameter `B`.
* - `Z`: Simplified SWU map parameter.
* @returns Deterministic map-to-curve function.
* @throws If the SWU parameters are invalid or the field lacks the required helpers. {@link Error}
* @example
* Map one field element to a Weierstrass curve point with the SWU recipe.
*
* ```ts
* import { mapToCurveSimpleSWU } from '@noble/curves/abstract/weierstrass.js';
* import { Field } from '@noble/curves/abstract/modular.js';
* const Fp = Field(17n);
* const map = mapToCurveSimpleSWU(Fp, { A: 1n, B: 2n, Z: 3n });
* const point = map(5n);
* ```
*/
export declare function mapToCurveSimpleSWU<T>(Fp: TArg<IField<T>>, opts: {
A: T;
B: T;
Z: T;
}): (u: T) => {
x: T;
y: T;
};
/**
* Sometimes users only need getPublicKey, getSharedSecret, and secret key handling.

@@ -596,2 +458,1 @@ * This helper ensures no signature functionality is present. Less code, smaller bundle size.

export declare function ecdsa(Point: WeierstrassPointCons<bigint>, hash: TArg<CHash>, ecdsaOpts?: TArg<ECDSAOpts>): ECDSA;
//# sourceMappingURL=weierstrass.d.ts.map

@@ -30,5 +30,8 @@ /**

import { ahash } from '@noble/hashes/utils.js';
import { abignumber, abool, abytes, aInRange, asafenumber, bitLen, bitMask, bytesToHex, bytesToNumberBE, concatBytes, createHmacDrbg, hexToBytes, isBytes, numberToHexUnpadded, validateObject, randomBytes as wcRandomBytes, } from "../utils.js";
import { createCurveFields, createKeygen, mulEndoUnsafe, negateCt, normalizeZ, wNAF, } from "./curve.js";
import { FpInvertBatch, FpIsSquare, getMinHashLength, mapHashToField, validateField, } from "./modular.js";
import { abool, abytes, aInRange, bitLen, bitMask, bytesToHex, bytesToNumberBE, concatBytes, createHmacDrbg, hexToBytes, isBytes, validateObject, randomBytes as wcRandomBytes, } from "../utils.js";
import { createCurveFields, createKeygen, mulAddUnsafe, normalizeZ, probeRandomBytes, ScalarMultiplier, validatePointCons, } from "./curve.js";
import { DER } from "./der.js";
import { getMinHashLength, invertCt, mapHashToField } from "./modular.js";
// DER codec lives in der.ts; re-exported here because ECDSA signatures are its main consumer.
export { DER, DERErr } from "./der.js";
// We construct the basis so `den` is always positive and equals `n`,

@@ -61,4 +64,4 @@ // but the `num` sign depends on the basis, not on the secret value.

k2 = -k2;
// Double check that resulting scalar less than half bits of N: otherwise wNAF will fail.
// This should only happen on wrong bases.
// Double check that resulting scalar is less than half bits of N: the wNAF pair walk
// relies on the halves being short. This should only happen on wrong bases.
// Also, the math inside is complex enough that this guard is worth keeping.

@@ -92,149 +95,2 @@ const MAX_NUM = bitMask(Math.ceil(bitLen(n) / 2)) + _1n; // Half bits of N

}
/**
* @param m - Error message.
* @example
* Throw a DER-specific error when signature parsing encounters invalid bytes.
*
* ```ts
* new DERErr('bad der');
* ```
*/
export class DERErr extends Error {
constructor(m = '') {
super(m);
}
}
/**
* ASN.1 DER encoding utilities. ASN is very complex & fragile. Format:
*
* [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S]
*
* Docs: {@link https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/ | Let's Encrypt ASN.1 guide} and
* {@link https://luca.ntop.org/Teaching/Appunti/asn1.html | Luca Deri's ASN.1 notes}.
* @example
* ASN.1 DER encoding utilities.
*
* ```ts
* const der = DER.hexFromSig({ r: 1n, s: 2n });
* ```
*/
export const DER = {
// asn.1 DER encoding utils
Err: DERErr,
// Basic building block is TLV (Tag-Length-Value)
_tlv: {
encode: (tag, data) => {
const { Err: E } = DER;
asafenumber(tag, 'tag');
if (tag < 0 || tag > 255)
throw new E('tlv.encode: wrong tag');
if (typeof data !== 'string')
throw new TypeError('"data" expected string, got type=' + typeof data);
// Internal helper: callers hand this already-validated hex payload, so we only enforce
// byte alignment here instead of re-validating every nibble.
if (data.length & 1)
throw new E('tlv.encode: unpadded data');
const dataLen = data.length / 2;
const len = numberToHexUnpadded(dataLen);
if ((len.length / 2) & 0b1000_0000)
throw new E('tlv.encode: long form length too big');
// length of length with long form flag
const lenLen = dataLen > 127 ? numberToHexUnpadded((len.length / 2) | 0b1000_0000) : '';
const t = numberToHexUnpadded(tag);
return t + lenLen + len + data;
},
// v - value, l - left bytes (unparsed)
decode(tag, data) {
const { Err: E } = DER;
data = abytes(data, undefined, 'DER data');
let pos = 0;
if (tag < 0 || tag > 255)
throw new E('tlv.encode: wrong tag');
if (data.length < 2 || data[pos++] !== tag)
throw new E('tlv.decode: wrong tlv');
const first = data[pos++];
// First bit of first length byte is the short/long form flag.
const isLong = !!(first & 0b1000_0000);
let length = 0;
if (!isLong)
length = first;
else {
// Long form: [longFlag(1bit), lengthLength(7bit), length (BE)]
const lenLen = first & 0b0111_1111;
if (!lenLen)
throw new E('tlv.decode(long): indefinite length not supported');
// This would overflow u32 in JS.
if (lenLen > 4)
throw new E('tlv.decode(long): byte length is too big');
const lengthBytes = data.subarray(pos, pos + lenLen);
if (lengthBytes.length !== lenLen)
throw new E('tlv.decode: length bytes not complete');
if (lengthBytes[0] === 0)
throw new E('tlv.decode(long): zero leftmost byte');
for (const b of lengthBytes)
length = (length << 8) | b;
pos += lenLen;
if (length < 128)
throw new E('tlv.decode(long): not minimal encoding');
}
const v = data.subarray(pos, pos + length);
if (v.length !== length)
throw new E('tlv.decode: wrong value length');
return { v, l: data.subarray(pos + length) };
},
},
// https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,
// since we always use positive integers here. It must always be empty:
// - add zero byte if exists
// - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
_int: {
encode(num) {
const { Err: E } = DER;
abignumber(num);
if (num < _0n)
throw new E('integer: negative integers are not allowed');
let hex = numberToHexUnpadded(num);
// Pad with zero byte if negative flag is present
if (Number.parseInt(hex[0], 16) & 0b1000)
hex = '00' + hex;
if (hex.length & 1)
throw new E('unexpected DER parsing assertion: unpadded hex');
return hex;
},
decode(data) {
const { Err: E } = DER;
if (data.length < 1)
throw new E('invalid signature integer: empty');
if (data[0] & 0b1000_0000)
throw new E('invalid signature integer: negative');
// Single-byte zero `00` is the canonical DER INTEGER encoding for zero.
if (data.length > 1 && data[0] === 0x00 && !(data[1] & 0b1000_0000))
throw new E('invalid signature integer: unnecessary leading zero');
return bytesToNumberBE(data);
},
},
toSig(bytes) {
// parse DER signature
const { Err: E, _int: int, _tlv: tlv } = DER;
const data = abytes(bytes, undefined, 'signature');
const { v: seqBytes, l: seqLeftBytes } = tlv.decode(0x30, data);
if (seqLeftBytes.length)
throw new E('invalid signature: left bytes after parsing');
const { v: rBytes, l: rLeftBytes } = tlv.decode(0x02, seqBytes);
const { v: sBytes, l: sLeftBytes } = tlv.decode(0x02, rLeftBytes);
if (sLeftBytes.length)
throw new E('invalid signature: left bytes after parsing');
return { r: int.decode(rBytes), s: int.decode(sBytes) };
},
hexFromSig(sig) {
const { _tlv: tlv, _int: int } = DER;
const rs = tlv.encode(0x02, int.encode(sig.r));
const ss = tlv.encode(0x02, int.encode(sig.s));
const seq = rs + ss;
return tlv.encode(0x30, seq);
},
};
Object.freeze(DER._tlv);
Object.freeze(DER._int);
Object.freeze(DER);
// Be friendly to bad ECMAScript parsers by not using bigint literals

@@ -281,2 +137,3 @@ // prettier-ignore

endo: 'object',
randomBytes: 'function',
});

@@ -286,4 +143,4 @@ // Snapshot constructor-time flags whose later mutation would otherwise change

const { endo, allowInfinityPoint } = extraOpts;
const randomBytes = extraOpts.randomBytes === undefined ? wcRandomBytes : extraOpts.randomBytes;
if (endo) {
// validateObject(endo, { beta: 'bigint', splitScalar: 'function' });
if (!Fp.is0(CURVE.a) || typeof endo.beta !== 'bigint' || !Array.isArray(endo.basises)) {

@@ -365,5 +222,10 @@ throw new Error('invalid endo: expected "beta": bigint and "basises": array');

const decodePoint = extraOpts.fromBytes === undefined ? pointFromBytes : extraOpts.fromBytes;
// Hoisted from double() / add(): curve params never change after construction.
// Koblitz curves (a=0, e.g. secp256k1) skip the three a-multiplications per operation;
// the selection depends only on public curve constants.
const b3 = Fp.mul(CURVE.b, _3n);
const mulA = Fp.is0(CURVE.a) ? (_) => Fp.ZERO : (x) => Fp.mul(CURVE.a, x);
function weierstrassEquation(x) {
const x2 = Fp.sqr(x); // x * x
const x3 = Fp.mul(x2, x); // x² * x
const x2 = Fp.sqr(x);
const x3 = Fp.mul(x2, x);
return Fp.add(Fp.add(x3, Fp.mul(x, CURVE.a)), CURVE.b); // x³ + a * x + b

@@ -374,3 +236,3 @@ }

function isValidXY(x, y) {
const left = Fp.sqr(y); // y²
const left = Fp.sqr(y);
const right = weierstrassEquation(x); // x³ + ax + b

@@ -405,8 +267,28 @@ return Fp.eql(left, right);

}
function finishEndo(endoBeta, k1p, k2p, k1neg, k2neg) {
k2p = new Point(Fp.mul(k2p.X, endoBeta), k2p.Y, k2p.Z);
k1p = negateCt(k1neg, k1p);
k2p = negateCt(k2neg, k2p);
return k1p.add(k2p);
/**
* Appends a (point, scalar) pair to the inputs of a vartime wNAF walk
* ({@link mulAddUnsafe}). With GLV endomorphism the scalar is split into two half-width
* pairs against P and ψ(P) = (β⋅x, y), halving the walk's shared doubling chain;
* split signs fold into the points.
*/
function pushWnafPair(points, scalars, p, k) {
if (!Fn.isValid(k))
throw new RangeError('invalid scalar: out of range'); // 0 is valid
if (endo) {
const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(k);
const psi = new Point(Fp.mul(p.X, endo.beta), p.Y, p.Z);
points.push(k1neg ? p.negate() : p, k2neg ? psi.negate() : psi);
scalars.push(k1, k2);
}
else {
points.push(p);
scalars.push(k);
}
}
// Successful assertValidity() results are cached: Point instances are frozen at construction,
// so on-curve + subgroup facts cannot change afterwards. Only success is cached — invalid
// points re-throw on every call. This matters most for pairing curves, where subgroup checks
// cost a scalar multiplication and the same instance is re-validated across layers
// (signature fromBytes, pairingBatch) or across repeated verifies with a cached public key.
const validityCache = new WeakSet();
/**

@@ -418,9 +300,5 @@ * Projective Point works in 3d / projective (homogeneous) coordinates:(X, Y, Z) ∋ (x=X/Z, y=Y/Z).

class Point {
// base / generator point
static BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE);
// zero / infinity / identity point
static ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); // 0, 1, 0
// math field
static ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO);
static Fp = Fp;
// scalar field
static Fn = Fn;

@@ -470,9 +348,6 @@ X;

/**
*
* @param windowSize
* @param isLazy - true will defer table computation until the first multiplication
* @returns
*/
precompute(windowSize = 8, isLazy = true) {
wnaf.createCache(this, windowSize);
precompute(windowSize = 6, isLazy = true) {
wnaf.setWindowSize(this, windowSize);
if (!isLazy)

@@ -495,2 +370,4 @@ this.multiply(_3n); // random number

}
if (validityCache.has(p))
return;
// Some 3rd-party test vectors require different wording between here & `fromCompressedHex`

@@ -504,2 +381,3 @@ const { x, y } = p.toAffine();

throw new Error('bad point: not in prime-order subgroup');
validityCache.add(p);
}

@@ -530,4 +408,2 @@ hasEvenY() {

double() {
const { a, b } = CURVE;
const b3 = Fp.mul(b, _3n);
const { X: X1, Y: Y1, Z: Z1 } = this;

@@ -542,3 +418,3 @@ let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore

Z3 = Fp.add(Z3, Z3);
X3 = Fp.mul(a, Z3);
X3 = mulA(Z3);
Y3 = Fp.mul(b3, t2);

@@ -551,5 +427,5 @@ Y3 = Fp.add(X3, Y3); // step 10

Z3 = Fp.mul(b3, Z3); // step 15
t2 = Fp.mul(a, t2);
t2 = mulA(t2);
t3 = Fp.sub(t0, t2);
t3 = Fp.mul(a, t3);
t3 = mulA(t3);
t3 = Fp.add(t3, Z3);

@@ -579,4 +455,2 @@ Z3 = Fp.add(t0, t0); // step 20

let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore
const a = CURVE.a;
const b3 = Fp.mul(CURVE.b, _3n);
let t0 = Fp.mul(X1, X2); // step 1

@@ -600,3 +474,3 @@ let t1 = Fp.mul(Y1, Y2);

t5 = Fp.sub(t5, X3);
Z3 = Fp.mul(a, t4);
Z3 = mulA(t4);
X3 = Fp.mul(b3, t2); // step 20

@@ -609,7 +483,7 @@ Z3 = Fp.add(X3, Z3);

t1 = Fp.add(t1, t0);
t2 = Fp.mul(a, t2);
t2 = mulA(t2);
t4 = Fp.mul(b3, t4);
t1 = Fp.add(t1, t2);
t2 = Fp.sub(t0, t2); // step 30
t2 = Fp.mul(a, t2);
t2 = mulA(t2);
t4 = Fp.add(t4, t2);

@@ -637,6 +511,4 @@ t0 = Fp.mul(t1, t4);

* Constant time multiplication.
* Uses wNAF method. Windowed method may be 10% faster,
* but takes 2x longer to generate and consumes 2x memory.
* Uses precomputes when available.
* Uses endomorphism for Koblitz curves.
* Uses precomputed tables (signed fixed-window wNAF) when available.
* Uses scalar blinding and avoids endomorphism splitting in the secret-scalar path.
* @param scalar - by which the point would be multiplied

@@ -646,3 +518,2 @@ * @returns New point

multiply(scalar) {
const { endo } = extraOpts;
// Keep the subgroup-scalar contract strict instead of reducing 0 / n to ZERO.

@@ -653,22 +524,8 @@ // In key/signature-style callers, those values usually mean broken hash/scalar plumbing,

throw new RangeError('invalid scalar: out of range'); // 0 is invalid
let point, fake; // Fake point is used to const-time mult
const mul = (n) => wnaf.cached(this, n, (p) => normalizeZ(Point, p));
/** See docs for {@link EndomorphismOpts} */
if (endo) {
const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(scalar);
const { p: k1p, f: k1f } = mul(k1);
const { p: k2p, f: k2f } = mul(k2);
fake = k1f.add(k2f);
point = finishEndo(endo.beta, k1p, k2p, k1neg, k2neg);
}
else {
const { p, f } = mul(scalar);
point = p;
fake = f;
}
// Normalize `z` for both points, but return only real one
return normalizeZ(Point, [point, fake])[0];
const { p, f } = wnaf.mulSecret(this, scalar, cofactor, normalize);
return normalize([p, f])[0];
}
/**
* Non-constant-time multiplication. Uses double-and-add algorithm.
* Non-constant-time multiplication. Uses width-4 wNAF with GLV endomorphism splitting
* when available (two half-width scalars sharing one halved doubling chain).
* It's faster, but should only be used when you don't care about

@@ -678,3 +535,2 @@ * an exposed secret key e.g. sig verification, which works over *public* keys.

multiplyUnsafe(scalar) {
const { endo } = extraOpts;
const p = this;

@@ -687,19 +543,28 @@ const sc = scalar;

if (sc === _0n || p.is0())
return Point.ZERO; // 0
return Point.ZERO;
if (sc === _1n)
return p; // 1
if (wnaf.hasCache(this))
return this.multiply(sc); // precomputes
// We don't have method for double scalar multiplication (aP + bQ):
// Even with using Strauss-Shamir trick, it's 35% slower than naïve mul+add.
if (endo) {
const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(sc);
const { p1, p2 } = mulEndoUnsafe(Point, p, k1, k2); // 30% faster vs wnaf.unsafe
return finishEndo(endo.beta, p1, p2, k1neg, k2neg);
}
else {
return wnaf.unsafe(p, sc);
}
return p;
if (wnaf.hasWindowSize(this))
return wnaf.mulUnsafe(p, sc, normalize); // precomputes
const points = [];
const scalars = [];
pushWnafPair(points, scalars, p, sc);
return mulAddUnsafe(Point, points, scalars);
}
/**
* Non-constant-time double-scalar multiplication `a⋅this + b⋅other` (Strauss–Shamir).
* Both walks share one doubling chain via {@link mulAddUnsafe}, and GLV endomorphism
* (when available) halves the chain again by splitting each scalar into two half-width
* parts. Used by ECDSA verification and public-key recovery for `R = u1⋅G + u2⋅P`.
* Only for public scalars.
*/
mulAddUnsafe(a, other, b) {
aprjpoint(other);
const points = [];
const scalars = [];
pushWnafPair(points, scalars, this, a);
pushWnafPair(points, scalars, other, b);
return mulAddUnsafe(Point, points, scalars);
}
/**
* Converts Projective point to affine (x, y) coordinates.

@@ -712,2 +577,4 @@ * (X, Y, Z) ∋ (x=X/Z, y=Y/Z).

let iz = invertedZ;
if (iz != null && !Fp.isValid(iz))
throw new RangeError('"invertedZ" expected valid field element');
const { X, Y, Z } = p;

@@ -741,3 +608,4 @@ // Fast-path for normalized points

return isTorsionFree(Point, this);
return wnaf.unsafe(this, CURVE_ORDER).is0();
// unsafe() will use the uncached wNAF path internally, since CURVE_ORDER >= Fn.ORDER
return wnaf.mulUnsafe(this, CURVE_ORDER).is0();
}

@@ -774,8 +642,8 @@ clearCofactor() {

}
const bits = Fn.BITS;
const wnaf = new wNAF(Point, extraOpts.endo ? Math.ceil(bits / 2) : bits);
// Tiny toy curves can have scalar fields narrower than 8 bits. Skip the
// eager W=8 cache there instead of rejecting an otherwise valid constructor.
if (bits >= 8)
Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms.
const normalize = (points) => normalizeZ(Point, points);
const wnaf = new ScalarMultiplier(Point, randomBytes);
// Enable W=6 wNAF precomputes. Slows down first publicKey computation.
// Disable for tiny toy curves, with scalar fields < 6 bits.
if (wnaf.bits >= 6)
Point.BASE.precompute(6);
Object.freeze(Point.prototype);

@@ -789,180 +657,2 @@ Object.freeze(Point);

}
/**
* Implementation of the Shallue and van de Woestijne method for any weierstrass curve.
* TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.
* b = True and y = sqrt(u / v) if (u / v) is square in F, and
* b = False and y = sqrt(Z * (u / v)) otherwise.
* RFC 9380 expects callers to provide `v != 0`; this helper does not enforce it.
* @param Fp - Field implementation.
* @param Z - Simplified SWU map parameter.
* @returns Square-root ratio helper.
* @example
* Build the square-root ratio helper used by SWU map implementations.
*
* ```ts
* import { SWUFpSqrtRatio } from '@noble/curves/abstract/weierstrass.js';
* import { Field } from '@noble/curves/abstract/modular.js';
* const Fp = Field(17n);
* const sqrtRatio = SWUFpSqrtRatio(Fp, 3n);
* const out = sqrtRatio(4n, 1n);
* ```
*/
export function SWUFpSqrtRatio(Fp, Z) {
// Fail with the usual field-shape error before touching pow/cmov on malformed field shims.
const F = validateField(Fp);
// Generic implementation
const q = F.ORDER;
let l = _0n;
for (let o = q - _1n; o % _2n === _0n; o /= _2n)
l += _1n;
const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.
// We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<.
// 2n ** c1 == 2n << (c1-1)
const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n);
const _2n_pow_c1 = _2n_pow_c1_1 * _2n;
const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic
const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic
const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic
const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic
const c6 = F.pow(Z, c2); // 6. c6 = Z^c2
const c7 = F.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)
// RFC 9380 Appendix F.2.1.1 defines sqrt_ratio(u, v) only for v != 0.
// We keep v=0 on the regular result path with isValid=false instead of
// throwing so the helper stays closer to the RFC's fixed control flow.
let sqrtRatio = (u, v) => {
let tv1 = c6; // 1. tv1 = c6
let tv2 = F.pow(v, c4); // 2. tv2 = v^c4
let tv3 = F.sqr(tv2); // 3. tv3 = tv2^2
tv3 = F.mul(tv3, v); // 4. tv3 = tv3 * v
let tv5 = F.mul(u, tv3); // 5. tv5 = u * tv3
tv5 = F.pow(tv5, c3); // 6. tv5 = tv5^c3
tv5 = F.mul(tv5, tv2); // 7. tv5 = tv5 * tv2
tv2 = F.mul(tv5, v); // 8. tv2 = tv5 * v
tv3 = F.mul(tv5, u); // 9. tv3 = tv5 * u
let tv4 = F.mul(tv3, tv2); // 10. tv4 = tv3 * tv2
tv5 = F.pow(tv4, c5); // 11. tv5 = tv4^c5
let isQR = F.eql(tv5, F.ONE); // 12. isQR = tv5 == 1
tv2 = F.mul(tv3, c7); // 13. tv2 = tv3 * c7
tv5 = F.mul(tv4, tv1); // 14. tv5 = tv4 * tv1
tv3 = F.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)
tv4 = F.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)
// 17. for i in (c1, c1 - 1, ..., 2):
for (let i = c1; i > _1n; i--) {
let tv5 = i - _2n; // 18. tv5 = i - 2
tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5
let tvv5 = F.pow(tv4, tv5); // 20. tv5 = tv4^tv5
const e1 = F.eql(tvv5, F.ONE); // 21. e1 = tv5 == 1
tv2 = F.mul(tv3, tv1); // 22. tv2 = tv3 * tv1
tv1 = F.mul(tv1, tv1); // 23. tv1 = tv1 * tv1
tvv5 = F.mul(tv4, tv1); // 24. tv5 = tv4 * tv1
tv3 = F.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1)
tv4 = F.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1)
}
// RFC 9380 Appendix F.2.1.1 defines sqrt_ratio(u, v) for v != 0.
// When u = 0 and v != 0, u / v = 0 is square and the computed root is
// still 0, so widen only the final flag and keep the full control flow.
return { isValid: !F.is0(v) && (isQR || F.is0(u)), value: tv3 };
};
if (F.ORDER % _4n === _3n) {
// sqrt_ratio_3mod4(u, v)
const c1 = (F.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic
const c2 = F.sqrt(F.neg(Z)); // 2. c2 = sqrt(-Z)
sqrtRatio = (u, v) => {
let tv1 = F.sqr(v); // 1. tv1 = v^2
const tv2 = F.mul(u, v); // 2. tv2 = u * v
tv1 = F.mul(tv1, tv2); // 3. tv1 = tv1 * tv2
let y1 = F.pow(tv1, c1); // 4. y1 = tv1^c1
y1 = F.mul(y1, tv2); // 5. y1 = y1 * tv2
const y2 = F.mul(y1, c2); // 6. y2 = y1 * c2
const tv3 = F.mul(F.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v
const isQR = F.eql(tv3, u); // 9. isQR = tv3 == u
let y = F.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)
return { isValid: !F.is0(v) && isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2
};
}
// No curves uses that
// if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8
return sqrtRatio;
}
/**
* Simplified Shallue-van de Woestijne-Ulas Method
* See {@link https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 | RFC 9380 section 6.6.2}.
* @param Fp - Field implementation.
* @param opts - SWU parameters:
* - `A`: Curve parameter `A`.
* - `B`: Curve parameter `B`.
* - `Z`: Simplified SWU map parameter.
* @returns Deterministic map-to-curve function.
* @throws If the SWU parameters are invalid or the field lacks the required helpers. {@link Error}
* @example
* Map one field element to a Weierstrass curve point with the SWU recipe.
*
* ```ts
* import { mapToCurveSimpleSWU } from '@noble/curves/abstract/weierstrass.js';
* import { Field } from '@noble/curves/abstract/modular.js';
* const Fp = Field(17n);
* const map = mapToCurveSimpleSWU(Fp, { A: 1n, B: 2n, Z: 3n });
* const point = map(5n);
* ```
*/
export function mapToCurveSimpleSWU(Fp, opts) {
const F = validateField(Fp);
const { A, B, Z } = opts;
if (!F.isValidNot0(A) || !F.isValidNot0(B) || !F.isValid(Z))
throw new Error('mapToCurveSimpleSWU: invalid opts');
// RFC 9380 §6.6.2 and Appendix H.2 require:
// 1. Z is non-square in F
// 2. Z != -1 in F
// 3. g(x) - Z is irreducible over F
// 4. g(B / (Z * A)) is square in F
// We can enforce 1, 2, and 4 with the current field API.
// Criterion 3 is not checked here because generic `IField<T>` does not expose
// polynomial-ring / irreducibility operations, and this helper is used for
// both prime and extension fields.
if (F.eql(Z, F.neg(F.ONE)) || FpIsSquare(F, Z))
throw new Error('mapToCurveSimpleSWU: invalid opts');
// RFC 9380 Appendix H.2 criterion 4: g(B / (Z * A)) is square in F.
// x = B / (Z * A)
const x = F.mul(B, F.inv(F.mul(Z, A)));
// g(x) = x^3 + A*x + B
const gx = F.add(F.add(F.mul(F.sqr(x), x), F.mul(A, x)), B);
if (!FpIsSquare(F, gx))
throw new Error('mapToCurveSimpleSWU: invalid opts');
const sqrtRatio = SWUFpSqrtRatio(F, Z);
if (!F.isOdd)
throw new Error('Field does not have .isOdd()');
// Input: u, an element of F.
// Output: (x, y), a point on E.
return (u) => {
// prettier-ignore
let tv1, tv2, tv3, tv4, tv5, tv6, x, y;
tv1 = F.sqr(u); // 1. tv1 = u^2
tv1 = F.mul(tv1, Z); // 2. tv1 = Z * tv1
tv2 = F.sqr(tv1); // 3. tv2 = tv1^2
tv2 = F.add(tv2, tv1); // 4. tv2 = tv2 + tv1
tv3 = F.add(tv2, F.ONE); // 5. tv3 = tv2 + 1
tv3 = F.mul(tv3, B); // 6. tv3 = B * tv3
tv4 = F.cmov(Z, F.neg(tv2), !F.eql(tv2, F.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0)
tv4 = F.mul(tv4, A); // 8. tv4 = A * tv4
tv2 = F.sqr(tv3); // 9. tv2 = tv3^2
tv6 = F.sqr(tv4); // 10. tv6 = tv4^2
tv5 = F.mul(tv6, A); // 11. tv5 = A * tv6
tv2 = F.add(tv2, tv5); // 12. tv2 = tv2 + tv5
tv2 = F.mul(tv2, tv3); // 13. tv2 = tv2 * tv3
tv6 = F.mul(tv6, tv4); // 14. tv6 = tv6 * tv4
tv5 = F.mul(tv6, B); // 15. tv5 = B * tv6
tv2 = F.add(tv2, tv5); // 16. tv2 = tv2 + tv5
x = F.mul(tv1, tv3); // 17. x = tv1 * tv3
const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)
y = F.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1
y = F.mul(y, value); // 20. y = y * y1
x = F.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square)
y = F.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square)
const e1 = F.isOdd(u) === F.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y)
y = F.cmov(F.neg(y), y, e1); // 24. y = CMOV(-y, y, e1)
const tv4_inv = FpInvertBatch(F, [tv4], true)[0];
x = F.mul(x, tv4_inv); // 25. x = x / tv4
return { x, y };
};
}
function getWLengths(Fp, Fn) {

@@ -998,2 +688,3 @@ return {

export function ecdh(Point, ecdhOpts = {}) {
validatePointCons(Point);
const { Fn } = Point;

@@ -1120,2 +811,3 @@ const randomBytes_ = ecdhOpts.randomBytes === undefined ? wcRandomBytes : ecdhOpts.randomBytes;

export function ecdsa(Point, hash, ecdsaOpts = {}) {
validatePointCons(Point);
// Custom hash / bits2int hooks are treated as pure functions over validated caller-owned bytes.

@@ -1131,13 +823,20 @@ const hash_ = hash;

});
ecdsaOpts = Object.assign({}, ecdsaOpts);
const randomBytes = ecdsaOpts.randomBytes === undefined ? wcRandomBytes : ecdsaOpts.randomBytes;
const hmac = ecdsaOpts.hmac === undefined
const opts = Object.assign({}, ecdsaOpts);
const randomBytes = opts.randomBytes === undefined ? wcRandomBytes : opts.randomBytes;
const hmac = opts.hmac === undefined
? (key, msg) => nobleHmac(hash_, key, msg)
: ecdsaOpts.hmac;
: opts.hmac;
const { Fp, Fn } = Point;
const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn;
const { keygen, getPublicKey, getSharedSecret, utils, lengths } = ecdh(Point, ecdsaOpts);
// Nonce-inversion blinding in k2sig draws `getMinHashLength(n)` bytes per sign. Probe the RNG
// once (see {@link probeRandomBytes}, shared with ScalarMultiplier): in environments without
// working randomness, signing downgrades to Fermat inversion (invertCt) instead of throwing on
// every sign(). The shape of returned bytes is still validated (by mapHashToField) on every
// blinded call, where breakage fails closed.
const blindLength = getMinHashLength(CURVE_ORDER);
const csprng = probeRandomBytes(randomBytes, blindLength);
const { keygen, getPublicKey, getSharedSecret, utils, lengths } = ecdh(Point, opts);
const defaultSigOpts = {
prehash: true,
lowS: typeof ecdsaOpts.lowS === 'boolean' ? ecdsaOpts.lowS : true,
lowS: typeof opts.lowS === 'boolean' ? opts.lowS : true,
format: 'compact',

@@ -1160,2 +859,12 @@ extraEntropy: false,

}
function assertFieldSignIsSupported() {
if (!Fp.isOdd)
throw new Error("Field doesn't support isOdd");
}
// Recovery id of an affine point (x, y) whose x reduces to signature `r` mod n:
// bit 0 = y parity, bit 1 = x overflowed the group order (x = r + n).
function getRecoveryBit(x, y, r) {
assertFieldSignIsSupported();
return (x === r ? 0 : 2) | Number(Fp.isOdd(y));
}
function assertRecoverableCurve() {

@@ -1240,3 +949,3 @@ // ECDSA recovery only supports curves where the current recovery id can distinguish

// (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1). unsafe is fine: there is no private data.
const Q = Point.BASE.multiplyUnsafe(u1).add(R.multiplyUnsafe(u2));
const Q = Point.BASE.mulAddUnsafe(u1, R, u2);
if (Q.is0())

@@ -1274,3 +983,3 @@ throw new Error('invalid recovery: point at infinify');

// int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors
const bits2int = ecdsaOpts.bits2int === undefined
const bits2int = opts.bits2int === undefined
? function bits2int_def(bytes) {

@@ -1286,8 +995,8 @@ // Our custom check "just in case", for protection against DoS

}
: ecdsaOpts.bits2int;
const bits2int_modN = ecdsaOpts.bits2int_modN === undefined
: opts.bits2int;
const bits2int_modN = opts.bits2int_modN === undefined
? function bits2int_modN_def(bytes) {
return Fn.create(bits2int(bytes)); // can't use bytesToNumberBE here
}
: ecdsaOpts.bits2int_modN;
: opts.bits2int_modN;
const ORDER_MASK = bitMask(fnBits);

@@ -1337,5 +1046,8 @@ // Pads output with zero as per spec.

// s = k^-1(m + rd) mod n
// Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to
// https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it:
// a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT
// The nonce inversion is blinded: with random b ∈ [1,n−1], s = (bk)^-1(bm + bdr) per
// https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. Fn.inv()'s extended-Euclidean
// loop count depends on its input (cf. Minerva), but here it only ever sees b·k — uniformly
// random, independent of k — so its timing reveals nothing about the nonce; b also masks d in
// the products. Without a CSPRNG (probed in ecdsa()) we fall back to Fermat inversion
// (invertCt), whose control flow is data-independent, at ~4x the inversion cost.
function k2sig(kBytes) {

@@ -1347,3 +1059,2 @@ // RFC 6979 Section 3.2, step 3: k = bits2int(T)

return; // Valid scalars (including k) must be in 1..N-1
const ik = Fn.inv(k); // k^-1 mod n
const q = Point.BASE.multiply(k).toAffine(); // q = k⋅G

@@ -1353,6 +1064,18 @@ const r = Fn.create(q.x); // r = q.x mod n

return;
const s = Fn.create(ik * Fn.create(m + r * d)); // s = k^-1(m + rd) mod n
let s;
if (csprng !== undefined) {
// mapHashToField maps 1.5x-order-length uniform bytes into [1, n-1], negligible bias.
const b = bytesToNumberBE(mapHashToField(csprng(blindLength), CURVE_ORDER));
const ibk = Fn.inv(Fn.mul(b, k)); // (bk)^-1: inversion input is decorrelated from k
const bm = Fn.mul(b, m);
const bd = Fn.mul(b, d);
s = Fn.create(ibk * Fn.create(bm + bd * r)); // s = (bk)^-1(bm + bdr) = k^-1(m + rd) mod n
}
else {
const ik = invertCt(k, CURVE_ORDER); // k^-1 mod n with data-independent control flow
s = Fn.create(ik * Fn.create(m + r * d)); // s = k^-1(m + rd) mod n
}
if (s === _0n)
return;
let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3 when q.x>n)
let recovery = getRecoveryBit(q.x, q.y, r); // recovery bit (2 or 3 when q.x>n)
let normS = s;

@@ -1418,7 +1141,14 @@ if (lowS && isBiggerThanHalfOrder(s)) {

const u2 = Fn.create(r * is); // u2 = rs^-1 mod n
const R = Point.BASE.multiplyUnsafe(u1).add(P.multiplyUnsafe(u2)); // u1⋅G + u2⋅P
const R = Point.BASE.mulAddUnsafe(u1, P, u2); // u1⋅G + u2⋅P, joint Strauss–Shamir
if (R.is0())
return false;
const v = Fn.create(R.x); // v = r.x mod n
return v === r;
const q = R.toAffine();
const v = Fn.create(q.x); // v = R.x mod n
if (v !== r)
return false;
// R is the exact point `recoverPublicKey(r, recid)` reconstructs (sR = hG + rP),
// so binding the signature to its recovery id only needs R's parity/overflow bits.
if (format === 'recovered' && sig.recovery !== getRecoveryBit(q.x, q.y, r))
return false;
return true;
}

@@ -1450,2 +1180,1 @@ catch (e) {

}
//# sourceMappingURL=weierstrass.js.map

@@ -24,2 +24,1 @@ import { type BlsCurvePairWithSignatures } from './abstract/bls.ts';

export declare const bls12_381: BlsCurvePairWithSignatures;
//# sourceMappingURL=bls12-381.d.ts.map

@@ -83,7 +83,7 @@ /**

import { Field } from "./abstract/modular.js";
import { abytes, bitLen, bitMask, bytesToHex, bytesToNumberBE, concatBytes, copyBytes, hexToBytes, numberToBytesBE, randomBytes, } from "./utils.js";
import { abytes, bitLen, bytesToHex, concatBytes, copyBytes, hexToBytes, numberToBytesBE, randomBytes, } from "./utils.js";
// Types
import { isogenyMap } from "./abstract/hash-to-curve.js";
import { isogenyMap, mapToCurveSimpleSWU } from "./abstract/hash-to-curve.js";
import { psiFrobenius, tower12 } from "./abstract/tower.js";
import { mapToCurveSimpleSWU, weierstrass, } from "./abstract/weierstrass.js";
import { weierstrass, } from "./abstract/weierstrass.js";
// Be friendly to bad ECMAScript parsers by not using bigint literals

@@ -131,2 +131,76 @@ // prettier-ignore

});
// Karabina's G2345 compression for the cyclotomic subgroup. Noble stores Fp12 as
// (c0 + c1*w), so (g0, g1, g2, g3, g4, g5) map to (c0.c0, c1.c1, c1.c0, c0.c2, c0.c1, c1.c2).
function bls12FromCompressed(g0, g1, { g2, g3, g4, g5 }) {
return { c0: { c0: g0, c1: g4, c2: g3 }, c1: { c0: g2, c1: g1, c2: g5 } };
}
function bls12Compress({ c0, c1 }) {
return { g2: c1.c0, g3: c0.c2, g4: c0.c1, g5: c1.c2 };
}
function bls12CyclotomicSquareCompressed({ g2, g3, g4, g5 }) {
const { first: h23c0, second: h23c1 } = Fp2.Fp4Square(g4, g5);
const { first: h45c0, second: h45c1 } = Fp2.Fp4Square(g2, g3);
const d2 = Fp2.add(g2, g2);
const d3 = Fp2.add(g3, g3);
const d4 = Fp2.add(g4, g4);
const d5 = Fp2.add(g5, g5);
return {
g2: Fp2.add(Fp2.mul(Fp2.mulByNonresidue(h23c1), _3n), d2),
g3: Fp2.sub(Fp2.mul(h23c0, _3n), d3),
g4: Fp2.sub(Fp2.mul(h45c0, _3n), d4),
g5: Fp2.add(Fp2.mul(h45c1, _3n), d5),
};
}
function bls12RecoverG1Ratio({ g2, g3, g4, g5 }) {
if (Fp2.is0(g2))
return { num: Fp2.mul(Fp2.mul(g4, g5), _2n), den: g3 };
return {
num: Fp2.add(Fp2.sub(Fp2.mul(Fp2.sqr(g4), _3n), Fp2.mul(g3, _2n)), Fp2.mulByNonresidue(Fp2.sqr(g5))),
den: Fp2.mul(g2, _4n),
};
}
function bls12RecoverG0(g1, { g2, g3, g4, g5 }) {
const g3g4 = Fp2.mul(g3, g4);
const t = Fp2.add(Fp2.sub(Fp2.mul(Fp2.sub(Fp2.sqr(g1), g3g4), _2n), g3g4), Fp2.mul(g2, g5));
return Fp2.add(Fp2.mulByNonresidue(t), Fp2.ONE);
}
function bls12CyclotomicExpCompressed(num, squarings) {
const gs = [];
let g = bls12Compress(num);
for (const count of squarings) {
for (let i = 0; i < count; i++)
g = bls12CyclotomicSquareCompressed(g);
gs.push(g);
}
// Karabina decompression is undefined at g2 = g3 = 0. Every element decompressed here lies in
// the cyclotomic subgroup GΦ₁₂, where the only such element is the identity: unitarity
// (z⋅z^(p⁶) = 1) forces g4² = ξ⋅g5², so g4 = g5 = 0 because ξ is a non-square in Fp2, leaving
// z ∈ Fp4* ∩ GΦ₁₂ — trivial since gcd(p⁴−p²+1, p⁴−1) = gcd(3, p²−2) = 1 for p ≡ 1 mod 3.
// Handle the identity explicitly instead of relying on invertBatch's passZero mapping the zero
// denominator to 0 (which happens to reconstruct ONE, but only by coincidence of formulas).
const isOne = gs.map(({ g2, g3 }) => Fp2.is0(g2) && Fp2.is0(g3));
const ratios = gs.map(bls12RecoverG1Ratio);
const invDens = Fp2.invertBatch(ratios.map(({ den }) => den));
const elems = gs.map((compressed, i) => {
if (isOne[i])
return Fp12.ONE;
const g1 = Fp2.mul(ratios[i].num, invDens[i]);
return bls12FromCompressed(bls12RecoverG0(g1, compressed), g1, compressed);
});
return { result: Fp12.mul(Fp12.mul(elems[0], elems[1]), elems[2]), last: elems[2] };
}
function bls12CyclotomicExpX(num) {
// BLS_X = 2^63 + 2^62 + 2^60 + 2^57 + 2^48 + 2^16.
const { result, last } = bls12CyclotomicExpCompressed(num, [16, 32, 9]);
let r = result;
let s = last;
for (let i = 0; i < 3; i++)
s = Fp12._cyclotomicSquare(s);
r = Fp12.mul(r, s);
for (let i = 0; i < 2; i++)
s = Fp12._cyclotomicSquare(s);
r = Fp12.mul(r, s);
s = Fp12._cyclotomicSquare(s);
return Fp12.mul(r, s);
}
const { Fp, Fp2, Fp6, Fp12 } = tower12({

@@ -141,4 +215,4 @@ ORDER: bls12_381_CURVE_G1.p,

Fp2mulByB: ({ c0, c1 }) => {
const t0 = Fp.mul(c0, _4n); // 4 * c0
const t1 = Fp.mul(c1, _4n); // 4 * c1
const t0 = Fp.mul(c0, _4n);
const t1 = Fp.mul(c1, _4n);
// (T0-T1) + (T0+T1)*i

@@ -148,3 +222,3 @@ return { c0: Fp.sub(t0, t1), c1: Fp.add(t0, t1) };

Fp12finalExponentiate: (num) => {
const x = BLS_X;
const powMinusX = (num) => Fp12.conjugate(bls12CyclotomicExpX(num));
// this^(q⁶) / this

@@ -154,8 +228,8 @@ const t0 = Fp12.div(Fp12.frobeniusMap(num, 6), num);

const t1 = Fp12.mul(Fp12.frobeniusMap(t0, 2), t0);
const t2 = Fp12.conjugate(Fp12._cyclotomicExp(t1, x));
const t2 = powMinusX(t1);
const t3 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicSquare(t1)), t2);
const t4 = Fp12.conjugate(Fp12._cyclotomicExp(t3, x));
const t5 = Fp12.conjugate(Fp12._cyclotomicExp(t4, x));
const t6 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicExp(t5, x)), Fp12._cyclotomicSquare(t2));
const t7 = Fp12.conjugate(Fp12._cyclotomicExp(t6, x));
const t4 = powMinusX(t3);
const t5 = powMinusX(t4);
const t6 = Fp12.mul(powMinusX(t5), Fp12._cyclotomicSquare(t2));
const t7 = powMinusX(t6);
const t2_t5_pow_q2 = Fp12.frobeniusMap(Fp12.mul(t2, t5), 2);

@@ -242,4 +316,4 @@ const t4_t1_pow_q3 = Fp12.frobeniusMap(Fp12.mul(t4, t1), 3);

return Fp2.create({
c0: Fp.create(bytesToNumberBE(bytes.subarray(L))),
c1: Fp.create(bytesToNumberBE(bytes.subarray(0, L))),
c0: decodeFp(bytes.subarray(L)),
c1: decodeFp(bytes.subarray(0, L)),
});

@@ -249,2 +323,5 @@ },

const BaseFp = Fp;
function decodeFp(bytes) {
return Fp.fromBytes(bytes);
}
// Keep BLS12-381 point/signature codecs on one control-flow skeleton: the G1/G2

@@ -281,4 +358,4 @@ // and point/signature variants differ only in field packing, subgroup bytes, and

if (infinity) {
// Infinity canonicality has to be checked on raw bytes before decode()
// reduces coordinates modulo p and turns non-empty payloads into zero.
// Infinity has a dedicated encoding: after the flag bits are cleared, every
// remaining payload byte must be zero.
for (const b of value) {

@@ -302,4 +379,4 @@ if (b)

}
// Noble keeps the permissive coordinate reduction path here, but an
// omitted infinity flag must not still decode to ZERO afterwards.
// The all-zero uncompressed payload must use the infinity flag instead of
// decoding as an ordinary affine point.
if (!compressed && F.is0(x) && F.is0(y))

@@ -323,3 +400,2 @@ throw new Error(`invalid ${name} point: uncompressed`);

// Copy, so we can remove mask data.
// It will be removed also later, when Fp.create will call modulo.
bytes = copyBytes(bytes);

@@ -349,3 +425,3 @@ const mask = bytes[0] & 0b1110_0000;

}
const g1coder = coder('G1', Fp, Fp.create(bls12_381_CURVE_G1.b), (x) => numberToBytesBE(x, Fp.BYTES), (bytes) => Fp.create(bytesToNumberBE(bytes) & bitMask(Fp.BITS)), (y) => [y]);
const g1coder = coder('G1', Fp, Fp.create(bls12_381_CURVE_G1.b), (x) => numberToBytesBE(x, Fp.BYTES), decodeFp, (y) => [y]);
const g1 = { point: g1coder(true), sig: g1coder(false) };

@@ -689,2 +765,1 @@ const signatureG1ToBytes = (point) => {

}
//# sourceMappingURL=bls12-381.js.map

@@ -75,2 +75,1 @@ /**

export declare const bn254: BlsCurvePair;
//# sourceMappingURL=bn254.d.ts.map

@@ -99,2 +99,33 @@ /**

let Fp12;
const bn254CyclotomicExpX = (num) => {
const cyclSqrN = (n, count) => {
for (let i = 0; i < count; i++)
n = Fp12._cyclotomicSquare(n);
return n;
};
// Addition chain for BN_X = 0x44e992b44a6909f1. This keeps the same cyclotomic-square
// count as binary exponentiation, but cuts Fp12 multiplications by about a third.
const x10 = Fp12._cyclotomicSquare(num);
const x100 = Fp12._cyclotomicSquare(x10);
const x1000 = Fp12._cyclotomicSquare(x100);
const x10000 = Fp12._cyclotomicSquare(x1000);
const x10001 = Fp12.mul(x10000, num);
const x10011 = Fp12.mul(x10001, x10);
const x10100 = Fp12.mul(x10011, num);
const x11001 = Fp12.mul(x1000, x10001);
const x100010 = Fp12._cyclotomicSquare(x10001);
const x100111 = Fp12.mul(x10011, x10100);
const x101001 = Fp12.mul(x10, x100111);
let r = cyclSqrN(x100010, 6);
r = Fp12.mul(Fp12.mul(r, x100), x11001);
r = Fp12.mul(cyclSqrN(r, 7), x11001);
r = cyclSqrN(r, 8);
r = Fp12.mul(Fp12.mul(r, x101001), x10);
r = Fp12.mul(cyclSqrN(r, 6), x10001);
r = Fp12.mul(cyclSqrN(r, 8), x101001);
r = Fp12.mul(cyclSqrN(r, 6), x101001);
r = Fp12.mul(cyclSqrN(r, 10), x100111);
r = Fp12.mul(Fp12.mul(cyclSqrN(r, 6), x101001), x1000);
return r;
};
const tower = /* @__PURE__ */ (() => {

@@ -109,3 +140,3 @@ const res = tower12({

Fp12finalExponentiate: (num) => {
const powMinusX = (num) => Fp12.conjugate(Fp12._cyclotomicExp(num, BN_X));
const powMinusX = (num) => Fp12.conjugate(bn254CyclotomicExpX(num));
const r0 = Fp12.mul(Fp12.conjugate(num), Fp12.inv(num));

@@ -247,2 +278,1 @@ const r = Fp12.mul(Fp12.frobeniusMap(r0, 2), r0);

export const bn254 = /* @__PURE__ */ blsBasic(fields, bn254_G1, bn254_G2, bn254_params);
//# sourceMappingURL=bn254.js.map

@@ -83,2 +83,3 @@ import { type AffinePoint } from './abstract/curve.ts';

* const bob = x25519.keygen();
* const alicePublic = x25519.getPublicKey(alice.secretKey);
* const shared = x25519.getSharedSecret(alice.secretKey, bob.publicKey);

@@ -213,2 +214,1 @@ * ```

export {};
//# sourceMappingURL=ed25519.d.ts.map
+111
-86

@@ -97,2 +97,14 @@ /**

const Fp = /* @__PURE__ */ (() => ed25519_Point.Fp)();
function toMontgomery(point) {
// Birational map from Ed25519 to Curve25519 / X25519:
// (u, v) = ((1 + y) / (1 - y), sqrt(-486664) * u / x)
// (x, y) = (sqrt(-486664) * u / v, (u - 1) / (u + 1))
const { y } = point;
return Fp.toBytes(Fp.div(_1n + y, _1n - y));
}
function toMontgomerySecret(secretKey) {
const size = ed25519_Point.Fp.BYTES;
abytes(secretKey, size);
return adjustScalarBytes(sha512(secretKey.subarray(0, size))).subarray(0, size);
}
const Fn = /* @__PURE__ */ (() => ed25519_Point.Fn)();

@@ -108,3 +120,3 @@ // RFC 8032 `dom2` helper for ctx/ph variants only. Plain Ed25519 keeps the

// Ed25519 keeps ZIP-215 default verification semantics for consensus compatibility.
return eddsa(ed25519_Point, sha512, Object.assign({ adjustScalarBytes, zip215: true }, opts));
return eddsa(ed25519_Point, sha512, Object.assign({ adjustScalarBytes, toMontgomery, toMontgomerySecret, zip215: true }, opts));
}

@@ -198,2 +210,3 @@ /**

* const bob = x25519.keygen();
* const alicePublic = x25519.getPublicKey(alice.secretKey);
* const shared = x25519.getSharedSecret(alice.secretKey, bob.publicKey);

@@ -204,11 +217,26 @@ * ```

const P = ed25519_CURVE_p;
const powPminus2 = (x) => {
// x^(p-2) aka x^(2^255-21)
const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x);
return mod(pow2(pow_p_5_8, _3n, P) * b2, P);
};
return montgomery({
P,
type: 'x25519',
powPminus2: (x) => {
// x^(p-2) aka x^(2^255-21)
const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x);
return mod(pow2(pow_p_5_8, _3n, P) * b2, P);
powPminus2,
adjustScalarBytes,
// ~3x faster fixed-base: [k]B on the birationally-equivalent Edwards curve using cached
// base tables, mapped back via u = (1+y)/(1-y) = (Z+Y)/(Z-Y) with one Fermat inversion.
// Same construction as libsodium's crypto_scalarmult_curve25519_base.
scalarMultBase: (k) => {
// Clamped k (≈2^254) exceeds n, but B has prime order n, so [k]B == [k mod n]B.
const kn = mod(k, ed25519_Point.Fn.ORDER);
// k ≡ 0 (mod n): [k]B is the point at infinity, whose u is 0 in the x-only ladder;
// returning 0 makes montgomery() reject it exactly like the ladder path.
if (kn === _0n)
return _0n;
const p = ed25519_Point.BASE.multiply(kn);
// Z-Y == 0 only at the identity, which kn != 0 excludes.
return mod((p.Z + p.Y) * powPminus2(mod(p.Z - p.Y, P)), P);
},
adjustScalarBytes,
});

@@ -223,2 +251,3 @@ })();

const ELL2_C3 = /* @__PURE__ */ (() => Fp.sqrt(Fp.neg(Fp.ONE)))(); // 3. c3 = sqrt(-1)
const ELL2_J = /* @__PURE__ */ BigInt(486662);
/**

@@ -230,4 +259,4 @@ * RFC 9380 method `map_to_curve_elligator2_curve25519`. Experimental name: may be renamed later.

export function _map_to_curve_elligator2_curve25519(u) {
const ELL2_C4 = (ed25519_CURVE_p - _5n) / _8n; // 4. c4 = (q - 5) / 8 # Integer arithmetic
const ELL2_J = BigInt(486662);
// 4. c4 = (q - 5) / 8: tv2^c4 below reuses the ed25519_pow_2_252_3 addition chain,
// whose pow_p_5_8 output is exactly x^((p-5)/8).
let tv1 = Fp.sqr(u); // 1. tv1 = u^2

@@ -249,3 +278,3 @@ tv1 = Fp.mul(tv1, _2n); // 2. tv1 = 2 * tv1

tv2 = Fp.mul(tv2, tv3); // 15. tv2 = tv2 * tv3 # gx1 * gxd^7
let y11 = Fp.pow(tv2, ELL2_C4); // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8)
let y11 = ed25519_pow_2_252_3(tv2).pow_p_5_8; // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8)
y11 = Fp.mul(y11, tv3); // 17. y11 = y11 * tv3 # gx1*gxd^3*(gx1*gxd^7)^((p-5)/8)

@@ -345,12 +374,10 @@ let y12 = Fp.mul(y11, ELL2_C3); // 18. y12 = y11 * c3

const { d } = ed25519_CURVE;
const P = ed25519_CURVE_p;
const mod = (n) => Fp.create(n);
const r = mod(SQRT_M1 * r0 * r0); // 1
const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); // 2
const r = Fp.mul(Fp.mulN(SQRT_M1, r0), r0); // 1
const Ns = Fp.mul(Fp.addN(r, _1n), ONE_MINUS_D_SQ); // 2
let c = BigInt(-1); // 3
const D = mod((c - d * r) * mod(r + d)); // 4
const D = Fp.mul(Fp.subN(c, Fp.mulN(d, r)), Fp.add(r, d)); // 4
let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); // 5
let s_ = mod(s * r0); // 6
if (!isNegativeLE(s_, P))
s_ = mod(-s_);
let s_ = Fp.mul(s, r0); // 6
if (!Fp.isOdd(s_))
s_ = Fp.neg(s_);
if (!Ns_D_is_sq)

@@ -360,9 +387,9 @@ s = s_; // 7

c = r; // 8
const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); // 9
const s2 = s * s;
const W0 = mod((s + s) * D); // 10
const W1 = mod(Nt * SQRT_AD_MINUS_ONE); // 11
const W2 = mod(_1n - s2); // 12
const W3 = mod(_1n + s2); // 13
return new ed25519_Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2));
const Nt = Fp.sub(Fp.mulN(Fp.mulN(c, Fp.subN(r, _1n)), D_MINUS_ONE_SQ), D); // 9
const s2 = Fp.sqrN(s);
const W0 = Fp.mul(Fp.addN(s, s), D); // 10
const W1 = Fp.mul(Nt, SQRT_AD_MINUS_ONE); // 11
const W2 = Fp.sub(_1n, s2); // 12
const W3 = Fp.add(_1n, s2); // 13
return new ed25519_Point(Fp.mul(W0, W3), Fp.mul(W2, W1), Fp.mul(W1, W3), Fp.mul(W0, W2));
}

@@ -415,26 +442,24 @@ /**

const { a, d } = ed25519_CURVE;
const P = ed25519_CURVE_p;
const mod = (n) => Fp.create(n);
const s = bytes255ToNumberLE(bytes);
// 1. Check that s_bytes is the canonical encoding of a field element, or else abort.
// 3. Check that s is non-negative, or else abort
if (!equalBytes(Fp.toBytes(s), bytes) || isNegativeLE(s, P))
if (!equalBytes(Fp.toBytes(s), bytes) || Fp.isOdd(s))
throw new Error('invalid ristretto255 encoding 1');
const s2 = mod(s * s);
const u1 = mod(_1n + a * s2); // 4 (a is -1)
const u2 = mod(_1n - a * s2); // 5
const u1_2 = mod(u1 * u1);
const u2_2 = mod(u2 * u2);
const v = mod(a * d * u1_2 - u2_2); // 6
const { isValid, value: I } = invertSqrt(mod(v * u2_2)); // 7
const Dx = mod(I * u2); // 8
const Dy = mod(I * Dx * v); // 9
let x = mod((s + s) * Dx); // 10
if (isNegativeLE(x, P))
x = mod(-x); // 10
const y = mod(u1 * Dy); // 11
const t = mod(x * y); // 12
if (!isValid || isNegativeLE(t, P) || y === _0n)
const s2 = Fp.sqr(s);
const u1 = Fp.add(_1n, Fp.mulN(a, s2)); // 4 (a is -1)
const u2 = Fp.sub(_1n, Fp.mulN(a, s2)); // 5
const u1_2 = Fp.sqr(u1);
const u2_2 = Fp.sqr(u2);
const v = Fp.sub(Fp.mulN(Fp.mulN(a, d), u1_2), u2_2); // 6
const { isValid, value: I } = invertSqrt(Fp.mul(v, u2_2)); // 7
const Dx = Fp.mul(I, u2); // 8
const Dy = Fp.mul(Fp.mulN(I, Dx), v); // 9
let x = Fp.mul(Fp.addN(s, s), Dx); // 10
if (Fp.isOdd(x))
x = Fp.neg(x); // 10
const y = Fp.mul(u1, Dy); // 11
const t = Fp.mul(x, y); // 12
if (!isValid || Fp.isOdd(t) || Fp.is0(y))
throw new Error('invalid ristretto255 encoding 2');
return new _RistrettoPoint(new ed25519_Point(x, y, _1n, t));
return new _RistrettoPoint(new ed25519_Point(x, y, Fp.ONE, t));
}

@@ -455,19 +480,17 @@ /**

let { X, Y, Z, T } = this.ep;
const P = ed25519_CURVE_p;
const mod = (n) => Fp.create(n);
const u1 = mod(mod(Z + Y) * mod(Z - Y)); // 1
const u2 = mod(X * Y); // 2
const u1 = Fp.mul(Fp.add(Z, Y), Fp.sub(Z, Y)); // 1
const u2 = Fp.mul(X, Y); // 2
// Square root always exists
const u2sq = mod(u2 * u2);
const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); // 3
const D1 = mod(invsqrt * u1); // 4
const D2 = mod(invsqrt * u2); // 5
const zInv = mod(D1 * D2 * T); // 6
const u2sq = Fp.sqr(u2);
const { value: invsqrt } = invertSqrt(Fp.mul(u1, u2sq)); // 3
const D1 = Fp.mul(invsqrt, u1); // 4
const D2 = Fp.mul(invsqrt, u2); // 5
const zInv = Fp.mul(Fp.mulN(D1, D2), T); // 6
let D; // 7
if (isNegativeLE(T * zInv, P)) {
let _x = mod(Y * SQRT_M1);
let _y = mod(X * SQRT_M1);
if (Fp.isOdd(Fp.mul(T, zInv))) {
let _x = Fp.mul(Y, SQRT_M1);
let _y = Fp.mul(X, SQRT_M1);
X = _x;
Y = _y;
D = mod(D1 * INVSQRT_A_MINUS_D);
D = Fp.mul(D1, INVSQRT_A_MINUS_D);
}

@@ -477,7 +500,7 @@ else {

}
if (isNegativeLE(X * zInv, P))
Y = mod(-Y); // 9
let s = mod((Z - Y) * D); // 10 (check footer's note, no sqrt(-a))
if (isNegativeLE(s, P))
s = mod(-s);
if (Fp.isOdd(Fp.mul(X, zInv)))
Y = Fp.neg(Y); // 9
let s = Fp.mul(Fp.subN(Z, Y), D); // 10 (check footer's note, no sqrt(-a))
if (Fp.isOdd(s))
s = Fp.neg(s);
return Fp.toBytes(s); // 11

@@ -493,6 +516,5 @@ }

const { X: X2, Y: Y2 } = other.ep;
const mod = (n) => Fp.create(n);
// (x1 * y2 == y1 * x2) | (y1 * y2 == x1 * x2)
const one = mod(X1 * Y2) === mod(Y1 * X2);
const two = mod(Y1 * Y2) === mod(X1 * X2);
const one = Fp.eql(Fp.mul(X1, Y2), Fp.mul(Y1, X2));
const two = Fp.eql(Fp.mul(Y1, Y2), Fp.mul(X1, X2));
return one || two;

@@ -504,8 +526,10 @@ }

}
Object.freeze(_RistrettoPoint.BASE);
Object.freeze(_RistrettoPoint.ZERO);
Object.freeze(_RistrettoPoint.prototype);
Object.freeze(_RistrettoPoint);
/** Prime-order Ristretto255 group bundle. */
export const ristretto255 = /* @__PURE__ */ Object.freeze({ Point: _RistrettoPoint });
export const ristretto255 = /* @__PURE__ */ (() => {
Object.freeze(_RistrettoPoint.BASE);
Object.freeze(_RistrettoPoint.ZERO);
Object.freeze(_RistrettoPoint.prototype);
Object.freeze(_RistrettoPoint);
return Object.freeze({ Point: _RistrettoPoint });
})();
/**

@@ -523,18 +547,19 @@ * Hashing to ristretto255 points / field. RFC 9380 methods.

*/
export const ristretto255_hasher = Object.freeze({
export const ristretto255_hasher =
/* @__PURE__ */ Object.freeze({
Point: _RistrettoPoint,
/**
* Spec: https://www.rfc-editor.org/rfc/rfc9380.html#name-hashing-to-ristretto255. Caveats:
* * There are no test vectors
* * encodeToCurve / mapToCurve is undefined
* * mapToCurve would be `calcElligatorRistrettoMap(scalars[0])`, not ristretto255_map!
* * hashToScalar is undefined too, so we just use OPRF implementation
* * We cannot re-use 'createHasher', because ristretto255_map is different algorithm/RFC
(os2ip -> bytes255ToNumberLE)
* * mapToCurve == calcElligatorRistrettoMap, hashToCurve == ristretto255_map
* * hashToScalar is undefined in RFC9380 for ristretto, so we use the OPRF
version here. Using `bytes255ToNumblerLE` will create a different result
if we use `bytes255ToNumberLE` as os2ip
* * current version is closest to spec.
*/
* Spec: https://www.rfc-editor.org/rfc/rfc9380.html#name-hashing-to-ristretto255. Caveats:
* * There are no test vectors
* * encodeToCurve / mapToCurve is undefined
* * mapToCurve would be `calcElligatorRistrettoMap(scalars[0])`, not ristretto255_map!
* * hashToScalar is undefined too, so we just use OPRF implementation
* * We cannot re-use 'createHasher', because ristretto255_map is different algorithm/RFC
(os2ip -> bytes255ToNumberLE)
* * mapToCurve == calcElligatorRistrettoMap, hashToCurve == ristretto255_map
* * hashToScalar is undefined in RFC9380 for ristretto, so we use the OPRF
version here. Using `bytes255ToNumblerLE` will create a different result
if we use `bytes255ToNumberLE` as os2ip
* * current version is closest to spec.
*/
hashToCurve(msg, options) {

@@ -551,4 +576,5 @@ // == 'hash_to_ristretto255'

},
hashToScalar(msg, options = { DST: _DST_scalar }) {
const xmd = expand_message_xmd(msg, options.DST, 64, sha512);
hashToScalar(msg, options) {
const DST = options?.DST === undefined ? _DST_scalar : options.DST;
const xmd = expand_message_xmd(msg, DST, 64, sha512);
return Fn.create(bytesToNumberLE(xmd));

@@ -640,2 +666,1 @@ },

]);
//# sourceMappingURL=ed25519.js.map

@@ -49,6 +49,8 @@ import type { AffinePoint } from './abstract/curve.ts';

* @example
* Multiply the E448 base point.
* Reconstruct and validate the E448 base point from its projective coordinates.
*
* ```ts
* const point = E448.BASE.multiply(2n);
* import { E448 } from '@noble/curves/ed448.js';
* const point = new E448(E448.BASE.X, E448.BASE.Y, E448.BASE.Z, E448.BASE.T);
* point.assertValidity();
* ```

@@ -175,3 +177,3 @@ */

* Instead, the torsion subgroup here is cyclic of order 4, generated by
* `(1, 0)`, and the array below lists that subgroup set (Klein four-group).
* `(1, 0)`, and the array below lists that subgroup set.
* @example

@@ -187,2 +189,1 @@ * Decode one known torsion point for debugging.

export {};
//# sourceMappingURL=ed448.d.ts.map
+101
-72

@@ -15,3 +15,3 @@ /**

import { _DST_scalar, createHasher, expand_message_xof, } from "./abstract/hash-to-curve.js";
import { Field, FpInvertBatch, isNegativeLE, mod, pow2 } from "./abstract/modular.js";
import { Field, FpInvertBatch, mod, pow2 } from "./abstract/modular.js";
import { montgomery } from "./abstract/montgomery.js";

@@ -52,3 +52,3 @@ import { createOPRF } from "./abstract/oprf.js";

// prettier-ignore
const _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3), _4n = /* @__PURE__ */ BigInt(4), _11n = /* @__PURE__ */ BigInt(11);
const _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3), _4n = /* @__PURE__ */ BigInt(4), _11n = /* @__PURE__ */ BigInt(11);
// prettier-ignore

@@ -123,2 +123,16 @@ const _22n = /* @__PURE__ */ BigInt(22), _44n = /* @__PURE__ */ BigInt(44), _88n = /* @__PURE__ */ BigInt(88), _223n = /* @__PURE__ */ BigInt(223);

const Fn448 = /* @__PURE__ */ (() => Field(ed448_CURVE.n, { BITS: 448, isLE: true }))();
function toMontgomery(point) {
// RFC 7748 section 4.2 maps Ed448-Goldilocks to Curve448 via a 4-isogeny.
// The u-coordinate map is:
// u = y^2 / x^2
// In projective coordinates this is:
// u = Y^2 / X^2
const u = Fp.div(Fp.mul(point.Y, point.Y), Fp.mul(point.X, point.X));
return Fp448.toBytes(u);
}
function toMontgomerySecret(secretKey) {
const size = ed448_Point.Fp.BYTES;
abytes(secretKey, size);
return adjustScalarBytes(shake256_114(secretKey.subarray(0, size))).subarray(0, 56);
}
// SHAKE256(dom4(phflag,context)||x, 114)

@@ -136,3 +150,3 @@ // RFC 8032 `dom4` prefix. Empty contexts are valid; the accepted length range

function ed4(opts) {
return eddsa(ed448_Point, shake256_114, Object.assign({ adjustScalarBytes, domain: dom4 }, opts));
return eddsa(ed448_Point, shake256_114, Object.assign({ adjustScalarBytes, domain: dom4, toMontgomery, toMontgomerySecret }, opts));
}

@@ -180,9 +194,11 @@ /**

* @example
* Multiply the E448 base point.
* Reconstruct and validate the E448 base point from its projective coordinates.
*
* ```ts
* const point = E448.BASE.multiply(2n);
* import { E448 } from '@noble/curves/ed448.js';
* const point = new E448(E448.BASE.X, E448.BASE.Y, E448.BASE.Z, E448.BASE.T);
* point.assertValidity();
* ```
*/
export const E448 = /* @__PURE__ */ edwards(E448_CURVE);
export const E448 = /* @__PURE__ */ edwards(E448_CURVE, { Fp, Fn });
/**

@@ -205,16 +221,32 @@ * ECDH using curve448 aka x448.

const P = ed448_CURVE_p;
const powPminus2 = (x) => {
const Pminus3div4 = ed448_pow_Pminus3div4(x);
const Pminus3 = pow2(Pminus3div4, _2n, P);
return mod(Pminus3 * x, P); // Pminus3 * x = Pminus2
};
return montgomery({
P,
type: 'x448',
powPminus2: (x) => {
const Pminus3div4 = ed448_pow_Pminus3div4(x);
const Pminus3 = pow2(Pminus3div4, _2n, P);
return mod(Pminus3 * x, P); // Pminus3 * x = Pminus2
powPminus2,
adjustScalarBytes,
// ~3x faster fixed-base: [k]B on Ed448-Goldilocks using cached base tables, mapped back
// through the 4-isogeny to curve448: u = y²/x² = Y²/X² (the isogeny is a homomorphism and
// sends the Ed448 base point to u=5, so no scalar correction factor is needed).
scalarMultBase: (k) => {
// Clamped k (≈2^447) exceeds n, but B has prime order n, so [k]B == [k mod n]B.
const kn = mod(k, ed448_Point.Fn.ORDER);
// k ≡ 0 (mod n): [k]B is the point at infinity, whose u is 0 in the x-only ladder;
// returning 0 makes montgomery() reject it exactly like the ladder path.
if (kn === _0n)
return _0n;
const p = ed448_Point.BASE.multiply(kn);
// X == 0 only at the identity and the order-2 point, both excluded from the prime-order
// subgroup hit by kn in 1..n-1.
return mod(p.Y * p.Y * powPminus2(mod(p.X * p.X, P)), P);
},
adjustScalarBytes,
});
})();
// Hash To Curve Elligator2 Map
// 1. c1 = (q - 3) / 4 # Integer arithmetic
const ELL2_C1 = /* @__PURE__ */ (() => (ed448_CURVE_p - BigInt(3)) / BigInt(4))();
// 1. c1 = (q - 3) / 4 # Integer arithmetic — tv3^c1 below reuses the
// ed448_pow_Pminus3div4 addition chain, which computes exactly x^((p-3)/4).
const ELL2_J = /* @__PURE__ */ BigInt(156326);

@@ -238,3 +270,3 @@ // Returns RFC 9380 Appendix G.2.3 rational Montgomery numerators/denominators

tv3 = Fp.mul(tv3, tv2); // 14. tv3 = tv3 * tv2 # gx1 * gxd^3
let y1 = Fp.pow(tv3, ELL2_C1); // 15. y1 = tv3^c1 # (gx1 * gxd^3)^((p - 3) / 4)
let y1 = ed448_pow_Pminus3div4(tv3); // 15. y1 = tv3^c1 # (gx1 * gxd^3)^((p - 3) / 4)
y1 = Fp.mul(y1, tv2); // 16. y1 = y1 * tv2 # gx1 * gxd * (gx1 * gxd^3)^((p - 3) / 4)

@@ -357,5 +389,4 @@ // 17. x2n = -tv1 * x1n # x2 = x2n / xd = -1 * u^2 * x1n / xd

const sqrtRatioM1 = (u, v) => {
const P = ed448_CURVE_p;
const { isValid, value } = uvRatio(u, v);
return { isValid, value: isNegativeLE(value, P) ? Fp448.create(-value) : value };
return { isValid, value: Fp448.isOdd(value) ? Fp448.neg(value) : value };
};

@@ -370,24 +401,23 @@ const invertSqrt = (number) => sqrtRatioM1(_1n, number);

function calcElligatorDecafMap(r0) {
const { d, p: P } = ed448_CURVE;
const mod = (n) => Fp448.create(n);
const r = mod(-(r0 * r0)); // 1
const u0 = mod(d * (r - _1n)); // 2
const u1 = mod((u0 + _1n) * (u0 - r)); // 3
const { isValid: was_square, value: v } = sqrtRatioM1(ONE_MINUS_TWO_D, mod((r + _1n) * u1)); // 4
const { d } = ed448_CURVE;
const r = Fp448.create(-Fp448.sqrN(r0)); // 1
const u0 = Fp448.mul(d, Fp448.subN(r, _1n)); // 2
const u1 = Fp448.mul(Fp448.addN(u0, _1n), Fp448.subN(u0, r)); // 3
const { isValid: was_square, value: v } = sqrtRatioM1(ONE_MINUS_TWO_D, Fp448.mul(Fp448.addN(r, _1n), u1)); // 4
let v_prime = v; // 5
if (!was_square)
v_prime = mod(r0 * v);
v_prime = Fp448.mul(r0, v);
let sgn = _1n; // 6
if (!was_square)
sgn = mod(-_1n);
const s = mod(v_prime * (r + _1n)); // 7
sgn = Fp448.neg(Fp448.ONE);
const s = Fp448.mul(v_prime, Fp448.addN(r, _1n)); // 7
let s_abs = s;
if (isNegativeLE(s, P))
s_abs = mod(-s);
const s2 = s * s;
const W0 = mod(s_abs * _2n); // 8
const W1 = mod(s2 + _1n); // 9
const W2 = mod(s2 - _1n); // 10
const W3 = mod(v_prime * s * (r - _1n) * ONE_MINUS_TWO_D + sgn); // 11
return new ed448_Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2));
if (Fp448.isOdd(s))
s_abs = Fp448.neg(s);
const s2 = Fp448.sqrN(s);
const W0 = Fp448.mul(s_abs, _2n); // 8
const W1 = Fp448.add(s2, _1n); // 9
const W2 = Fp448.sub(s2, _1n); // 10
const W3 = Fp448.add(Fp448.mulN(Fp448.mulN(Fp448.mulN(v_prime, s), Fp448.subN(r, _1n)), ONE_MINUS_TWO_D), sgn); // 11
return new ed448_Point(Fp448.mul(W0, W3), Fp448.mul(W2, W1), Fp448.mul(W1, W3), Fp448.mul(W0, W2));
}

@@ -442,23 +472,22 @@ // Keep the Decaf448 base representative literal here: deriving it with

abytes(bytes, 56);
const { d, p: P } = ed448_CURVE;
const mod = (n) => Fp448.create(n);
const { d } = ed448_CURVE;
const s = Fp448.fromBytes(bytes);
// 1. Check that s_bytes is the canonical encoding of a field element, or else abort.
// 2. Check that s is non-negative, or else abort
if (!equalBytes(Fn448.toBytes(s), bytes) || isNegativeLE(s, P))
if (!equalBytes(Fp448.toBytes(s), bytes) || Fp448.isOdd(s))
throw new Error('invalid decaf448 encoding 1');
const s2 = mod(s * s); // 1
const u1 = mod(_1n + s2); // 2
const u1sq = mod(u1 * u1);
const u2 = mod(u1sq - _4n * d * s2); // 3
const { isValid, value: invsqrt } = invertSqrt(mod(u2 * u1sq)); // 4
let u3 = mod((s + s) * invsqrt * u1 * SQRT_MINUS_D); // 5
if (isNegativeLE(u3, P))
u3 = mod(-u3);
const x = mod(u3 * invsqrt * u2 * INVSQRT_MINUS_D); // 6
const y = mod((_1n - s2) * invsqrt * u1); // 7
const t = mod(x * y); // 8
const s2 = Fp448.sqr(s); // 1
const u1 = Fp448.add(Fp448.ONE, s2); // 2
const u1sq = Fp448.sqr(u1);
const u2 = Fp448.sub(u1sq, Fp448.mulN(Fp448.mulN(_4n, d), s2)); // 3
const { isValid, value: invsqrt } = invertSqrt(Fp448.mul(u2, u1sq)); // 4
let u3 = Fp448.mul(Fp448.mulN(Fp448.mulN(Fp448.addN(s, s), invsqrt), u1), SQRT_MINUS_D); // 5
if (Fp448.isOdd(u3))
u3 = Fp448.neg(u3);
const x = Fp448.mul(Fp448.mulN(Fp448.mulN(u3, invsqrt), u2), INVSQRT_MINUS_D); // 6
const y = Fp448.mul(Fp448.mulN(Fp448.subN(_1n, s2), invsqrt), u1); // 7
const t = Fp448.mul(x, y); // 8
if (!isValid)
throw new Error('invalid decaf448 encoding 2');
return new _DecafPoint(new ed448_Point(x, y, _1n, t));
return new _DecafPoint(new ed448_Point(x, y, Fp448.ONE, t));
}

@@ -479,15 +508,13 @@ /**

const { X, Z, T } = this.ep;
const P = ed448_CURVE.p;
const mod = (n) => Fp448.create(n);
const u1 = mod(mod(X + T) * mod(X - T)); // 1
const x2 = mod(X * X);
const { value: invsqrt } = invertSqrt(mod(u1 * ONE_MINUS_D * x2)); // 2
let ratio = mod(invsqrt * u1 * SQRT_MINUS_D); // 3
if (isNegativeLE(ratio, P))
ratio = mod(-ratio);
const u2 = mod(INVSQRT_MINUS_D * ratio * Z - T); // 4
let s = mod(ONE_MINUS_D * invsqrt * X * u2); // 5
if (isNegativeLE(s, P))
s = mod(-s);
return Fn448.toBytes(s);
const u1 = Fp448.mul(Fp448.add(X, T), Fp448.sub(X, T)); // 1
const x2 = Fp448.sqr(X);
const { value: invsqrt } = invertSqrt(Fp448.mul(Fp448.mulN(u1, ONE_MINUS_D), x2)); // 2
let ratio = Fp448.mul(Fp448.mulN(invsqrt, u1), SQRT_MINUS_D); // 3
if (Fp448.isOdd(ratio))
ratio = Fp448.neg(ratio);
const u2 = Fp448.sub(Fp448.mulN(Fp448.mulN(INVSQRT_MINUS_D, ratio), Z), T); // 4
let s = Fp448.mul(Fp448.mulN(Fp448.mulN(ONE_MINUS_D, invsqrt), X), u2); // 5
if (Fp448.isOdd(s))
s = Fp448.neg(s);
return Fp448.toBytes(s);
}

@@ -503,3 +530,3 @@ /**

// (x1 * y2 == y1 * x2)
return Fp448.create(X1 * Y2) === Fp448.create(Y1 * X2);
return Fp448.eql(Fp448.mul(X1, Y2), Fp448.mul(Y1, X2));
}

@@ -510,8 +537,10 @@ is0() {

}
Object.freeze(_DecafPoint.BASE);
Object.freeze(_DecafPoint.ZERO);
Object.freeze(_DecafPoint.prototype);
Object.freeze(_DecafPoint);
/** Prime-order Decaf448 group bundle. */
export const decaf448 = /* @__PURE__ */ Object.freeze({ Point: _DecafPoint });
export const decaf448 = /* @__PURE__ */ (() => {
Object.freeze(_DecafPoint.BASE);
Object.freeze(_DecafPoint.ZERO);
Object.freeze(_DecafPoint.prototype);
Object.freeze(_DecafPoint);
return Object.freeze({ Point: _DecafPoint });
})();
/**

@@ -529,3 +558,3 @@ * Hashing to decaf448 points / field. RFC 9380 methods.

*/
export const decaf448_hasher = Object.freeze({
export const decaf448_hasher = /* @__PURE__ */ Object.freeze({
Point: _DecafPoint,

@@ -542,5 +571,6 @@ hashToCurve(msg, options) {

*/
hashToScalar(msg, options = { DST: _DST_scalar }) {
hashToScalar(msg, options) {
const DST = options?.DST === undefined ? _DST_scalar : options.DST;
// Can't use `Fn448.fromBytes()`. 64-byte input => 56-byte field element
const xof = expand_message_xof(msg, options.DST, 64, 256, shake256);
const xof = expand_message_xof(msg, DST, 64, 256, shake256);
return Fn448.create(bytesToNumberLE(xof));

@@ -594,3 +624,3 @@ },

* Instead, the torsion subgroup here is cyclic of order 4, generated by
* `(1, 0)`, and the array below lists that subgroup set (Klein four-group).
* `(1, 0)`, and the array below lists that subgroup set.
* @example

@@ -610,2 +640,1 @@ * Decode one known torsion point for debugging.

]);
//# sourceMappingURL=ed448.js.map
export {};
//# sourceMappingURL=index.d.ts.map

@@ -39,2 +39,1 @@ /**

export {};
//# sourceMappingURL=index.js.map

@@ -114,2 +114,1 @@ import { type EdDSA, type EdwardsPoint } from './abstract/edwards.ts';

export declare const brainpoolP512r1: ECDSA;
//# sourceMappingURL=misc.d.ts.map

@@ -104,4 +104,5 @@ /**

let p = jubjub.Point.fromBytes(h.digest());
// NOTE: cannot replace with isSmallOrder, returns Point*8
p = p.multiply(jubjub_CURVE.h);
// NOTE: cannot replace with isSmallOrder, we need the Point*8 result itself.
// clearCofactor (three doublings for h=8) is fine here: inputs are public.
p = p.clearCofactor();
if (p.equals(jubjub.Point.ZERO))

@@ -135,13 +136,12 @@ throw new Error('Point has small order');

const tag = concatBytes(m, Uint8Array.of(0));
const hashes = [];
// Return the first tag byte whose hash decodes to a non-small-order point; later candidates
// were never used, so there is no reason to compute them.
for (let i = 0; i < 256; i++) {
tag[tag.length - 1] = i;
try {
hashes.push(jubjub_groupHash(tag, personalization));
return jubjub_groupHash(tag, personalization);
}
catch (e) { }
}
if (!hashes.length)
throw new Error('findGroupHash tag overflow');
return hashes[0];
throw new Error('findGroupHash tag overflow');
}

@@ -214,2 +214,1 @@ const brainpoolP256r1_CURVE = /* @__PURE__ */ (() => ({

export const brainpoolP512r1 = /* @__PURE__ */ (() => ecdsa(weierstrass(brainpoolP512r1_CURVE), sha512))();
//# sourceMappingURL=misc.js.map

@@ -16,5 +16,7 @@ import { type FROST } from './abstract/frost.ts';

* const { secretKey, publicKey } = p256.keygen();
* // const publicKey = p256.getPublicKey(secretKey);
* const recovered = p256.getPublicKey(secretKey);
* const peer = p256.keygen();
* const shared = p256.getSharedSecret(secretKey, peer.publicKey);
* const msg = new TextEncoder().encode('hello noble');
* const sig = p256.sign(msg, secretKey);
* const sig = p256.sign(msg, secretKey, { lowS: true, prehash: true });
* const isValid = p256.verify(sig, msg, publicKey);

@@ -138,2 +140,1 @@ * // const sigKeccak = p256.sign(keccak256(msg), secretKey, { prehash: false });

export declare const p521_oprf: TRet<OPRF>;
//# sourceMappingURL=nist.d.ts.map
+13
-11
/**
* Internal module for NIST P256, P384, P521 curves.
* Do not use for now.
* NIST P256, P384, P521 curves.
* https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-256
* @module

@@ -9,5 +9,5 @@ */

import { createFROST } from "./abstract/frost.js";
import { createHasher } from "./abstract/hash-to-curve.js";
import { createHasher, mapToCurveSimpleSWU } from "./abstract/hash-to-curve.js";
import { createOPRF } from "./abstract/oprf.js";
import { ecdsa, mapToCurveSimpleSWU, weierstrass, } from "./abstract/weierstrass.js";
import { ecdsa, weierstrass, } from "./abstract/weierstrass.js";
import {} from "./utils.js";

@@ -64,5 +64,7 @@ // p = 2n**224n * (2n**32n-1n) + 2n**192n + 2n**96n - 1n

* const { secretKey, publicKey } = p256.keygen();
* // const publicKey = p256.getPublicKey(secretKey);
* const recovered = p256.getPublicKey(secretKey);
* const peer = p256.keygen();
* const shared = p256.getSharedSecret(secretKey, peer.publicKey);
* const msg = new TextEncoder().encode('hello noble');
* const sig = p256.sign(msg, secretKey);
* const sig = p256.sign(msg, secretKey, { lowS: true, prehash: true });
* const isValid = p256.verify(sig, msg, publicKey);

@@ -86,3 +88,3 @@ * // const sigKeccak = p256.sign(keccak256(msg), secretKey, { prehash: false });

B: p256_CURVE.b,
Z: p256_Point.Fp.create(BigInt('-10')),
Z: p256_Point.Fp.neg(BigInt(10)),
}), {

@@ -136,3 +138,2 @@ DST: 'P256_XMD:SHA-256_SSWU_RO_',

}))();
// NIST P384
const p384_Point = /* @__PURE__ */ weierstrass(p384_CURVE);

@@ -165,3 +166,3 @@ /**

B: p384_CURVE.b,
Z: p384_Point.Fp.create(BigInt('-12')),
Z: p384_Point.Fp.neg(BigInt(12)),
}), {

@@ -213,2 +214,4 @@ DST: 'P384_XMD:SHA-384_SSWU_RO_',

// default exact-66-byte scalar field path.
// A dedicated MersenneField primitive would allow speed-ups here: +40% getPublicKey, +23% sign,
// +53% verify, +53% getSharedSecret.
const p521_Point = /* @__PURE__ */ weierstrass(p521_CURVE);

@@ -243,3 +246,3 @@ /**

B: p521_CURVE.b,
Z: p521_Point.Fp.create(BigInt('-4')),
Z: p521_Point.Fp.neg(BigInt(4)),
}), {

@@ -275,2 +278,1 @@ DST: 'P521_XMD:SHA-512_SSWU_RO_',

}))();
//# sourceMappingURL=nist.js.map
{
"name": "@noble/curves",
"version": "2.2.0",
"version": "2.3.0",
"description": "Audited & minimal JS implementation of elliptic curve cryptography",
"files": [
"*.js",
"*.js.map",
"*.d.ts",
"*.d.ts.map",
"abstract",

@@ -14,6 +12,6 @@ "src"

"dependencies": {
"@noble/hashes": "2.2.0"
"@noble/hashes": "2.3.0"
},
"devDependencies": {
"@paulmillr/jsbt": "0.5.0",
"@paulmillr/jsbt": "0.6.5",
"@types/node": "25.3.0",

@@ -25,17 +23,11 @@ "fast-check": "4.2.0",

"scripts": {
"bench": "cd test/benchmark; node secp256k1.ts; node curves.ts; node utils.ts; node bls.ts",
"bench:install": "cd test/benchmark; npm install; npm install ../.. --install-links",
"benchmark": "node benchmark/main.ts",
"benchmark:ct": "node benchmark/ct.ts",
"build": "tsc",
"build:release": "npx --no @paulmillr/jsbt esbuild test/build",
"check": "npm run check:readme && npm run check:treeshake && npm run check:jsdoc",
"check:readme": "npx --no @paulmillr/jsbt readme package.json",
"check:treeshake": "npx --no @paulmillr/jsbt treeshake package.json test/build/out-treeshake",
"check:jsdoc": "npx --no @paulmillr/jsbt tsdoc package.json",
"build:clean": "rm {.,abstract}/*.{js,d.ts,d.ts.map,js.map} 2> /dev/null",
"build:clean": "rm {.,abstract}/*.{js,d.ts} 2> /dev/null",
"check": "jsbt-check",
"format": "prettier --write 'src/**/*.{js,ts}' 'test/*.{js,ts}'",
"test": "node test/index.ts",
"test:bun": "bun test/index.ts",
"test": "node --no-warnings test/index.ts",
"test:deno": "deno --allow-env --allow-read test/index.ts",
"test:node20": "cd test; npx tsc; node compiled/test/index.js",
"test:coverage": "npm install --no-save c8@10.1.2 && npx c8 npm test"
"test:bun": "bun test/index.ts"
},

@@ -46,2 +38,3 @@ "exports": {

"./abstract/curve.js": "./abstract/curve.js",
"./abstract/der.js": "./abstract/der.js",
"./abstract/edwards.js": "./abstract/edwards.js",

@@ -48,0 +41,0 @@ "./abstract/fft.js": "./abstract/fft.js",

+103
-81

@@ -6,10 +6,9 @@ # noble-curves

- 🔒 [**Audited**](#security) by independent security firms
- 🔻 Tree-shakeable: unused code is excluded from your builds
- 🪶 Minimal: 15KB (gzipped) secp256k1, unused code is excluded from your builds
- 🏎 Fast: hand-optimized for caveats of JS engines
- 🔍 Reliable: cross-library / wycheproof tests and fuzzing ensure correctness
- ➰ Weierstrass, Edwards, Montgomery curves; ECDSA, EdDSA, Schnorr, BLS signatures
- 🔍 Reliable: cross-library / wycheproof tests ensure correctness
- ➰ Weierstrass, Edwards curves; ECDSA, EdDSA, Schnorr, BLS signatures
- ✍️ ECDH, hash-to-curve, OPRF, FROST, Poseidon hash, FFT
- 🔖 Non-repudiation (SUF-CMA, SBS) & consensus-friendliness (ZIP215) in ed25519, ed448
- 🥈 Optional, friendly wrapper over native WebCrypto
- 🪶 32KB (gzipped) including bundled hashes, 11KB for single-curve build
- 🥈 Wrapper with identical API over native WebCrypto

@@ -20,4 +19,2 @@ Curves have 5kb sister projects

Take a glance at [GitHub Discussions](https://github.com/paulmillr/noble-curves/discussions) for questions and support.
### This library belongs to _noble_ cryptography

@@ -37,2 +34,3 @@

[ed25519](https://github.com/paulmillr/noble-ed25519)
- WASM version: [awasm-noble](https://github.com/paulmillr/awasm-noble)
- [Check out the homepage](https://paulmillr.com/noble/)

@@ -814,2 +812,26 @@ for reading resources, documentation, and apps built with noble

Within those limits, secret-scalar multiplication provides specific, measurable properties:
- **Fixed operation sequence:** `multiply()` uses signed fixed-window tables with
data-oblivious table scans — the number and order of point operations
is independent of the scalar value.
- **Scalar blinding:** secret scalars are additionally masked as `s + r·n` with a random
128-bit `r` before multiplication. This applies to all multiplications on cofactor-1
curves (p256, p384, p521, secp256k1), and to base-point multiplications everywhere.
- **Statistical validation:** a dudect-style Welch t-test harness (`benchmark/ct.ts`)
compares timing across adversarial scalar classes (sparse vs dense, low vs high bits,
near-order, bit patterns). Base-point multiplication shows no distinguishable timing on any
curve, and random-point multiplication shows none on the Weierstrass curves
(max |t| ≤ 2.8 at 1000 samples; threshold 4.5).
Known limitation: on cofactored Edwards curves (ed25519, ed448), multiplying a **non-base**
point by a secret scalar is not blinded. The same harness detects this reliably. EdDSA signing is
unaffected (it only multiplies the blinded base point), and X25519/X448 use a separate
Montgomery-ladder implementation (also unaffected). It matters for protocols that multiply arbitrary
Edwards/Ristretto points by long-lived secret scalars; prefer scalars that are
full-width by construction there. Note that detectability in an isolated harness does not
imply practical exploitability: we attempted scalar extraction in a realistic
cross-tenant / in-browser setting and were unable to recover Edwards scalars
even with 100,000 timing samples.
### Memory dumping

@@ -890,97 +912,97 @@

# secp256k1
init 10ms
getPublicKey x 9,099 ops/sec @ 109μs/op
sign x 7,182 ops/sec @ 139μs/op
verify x 1,188 ops/sec @ 841μs/op
recoverPublicKey x 1,265 ops/sec @ 790μs/op
getSharedSecret x 735 ops/sec @ 1ms/op
schnorr.sign x 957 ops/sec @ 1ms/op
schnorr.verify x 1,210 ops/sec @ 825μs/op
init 11ms
getPublicKey x 4,909 ops/sec @ 203μs/op
sign x 4,319 ops/sec @ 231μs/op
verify x 1,391 ops/sec @ 718μs/op
recoverPublicKey x 1,377 ops/sec @ 725μs/op
getSharedSecret x 793 ops/sec @ 1ms/op
schnorr.sign x 895 ops/sec @ 1ms/op
schnorr.verify x 1,418 ops/sec @ 704μs/op
# ed25519
init 14ms
getPublicKey x 14,216 ops/sec @ 70μs/op
sign x 6,849 ops/sec @ 145μs/op
verify x 1,400 ops/sec @ 713μs/op
init 9ms
getPublicKey x 7,161 ops/sec @ 139μs/op
sign x 3,541 ops/sec @ 282μs/op
verify x 1,483 ops/sec @ 674μs/op
# ed448
init 37ms
getPublicKey x 5,273 ops/sec @ 189μs/op
sign x 2,494 ops/sec @ 400μs/op
verify x 476 ops/sec @ 2ms/op
init 19ms
getPublicKey x 3,125 ops/sec @ 319μs/op
sign x 1,549 ops/sec @ 645μs/op
verify x 518 ops/sec @ 1ms/op ± 6.59% (1ms..15ms)
# p256
init 17ms
getPublicKey x 8,977 ops/sec @ 111μs/op
sign x 7,236 ops/sec @ 138μs/op
verify x 877 ops/sec @ 1ms/op
init 9ms
getPublicKey x 4,799 ops/sec @ 208μs/op
sign x 4,262 ops/sec @ 234μs/op
verify x 943 ops/sec @ 1ms/op
# p384
init 42ms
getPublicKey x 4,084 ops/sec @ 244μs/op
sign x 3,247 ops/sec @ 307μs/op
verify x 331 ops/sec @ 3ms/op
init 20ms
getPublicKey x 2,208 ops/sec @ 452μs/op
sign x 1,949 ops/sec @ 512μs/op
verify x 371 ops/sec @ 2ms/op
# p521
init 83ms
getPublicKey x 2,049 ops/sec @ 487μs/op
sign x 1,748 ops/sec @ 571μs/op
verify x 170 ops/sec @ 5ms/op
init 37ms
getPublicKey x 1,215 ops/sec @ 822μs/op
sign x 1,116 ops/sec @ 895μs/op
verify x 186 ops/sec @ 5ms/op
# ristretto255
add x 931,966 ops/sec @ 1μs/op
multiply x 15,444 ops/sec @ 64μs/op
encode x 21,367 ops/sec @ 46μs/op
decode x 21,715 ops/sec @ 46μs/op
add x 719,424 ops/sec @ 1μs/op
multiply x 7,214 ops/sec @ 138μs/op
encode x 21,337 ops/sec @ 46μs/op
decode x 20,682 ops/sec @ 48μs/op
# decaf448
add x 478,011 ops/sec @ 2μs/op
multiply x 416 ops/sec @ 2ms/op
encode x 8,562 ops/sec @ 116μs/op
decode x 8,636 ops/sec @ 115μs/op
add x 467,945 ops/sec @ 2μs/op
multiply x 682 ops/sec @ 1ms/op
encode x 8,279 ops/sec @ 120μs/op
decode x 8,044 ops/sec @ 124μs/op
# ECDH
x25519 x 1,981 ops/sec @ 504μs/op
x448 x 743 ops/sec @ 1ms/op
secp256k1 x 728 ops/sec @ 1ms/op
p256 x 705 ops/sec @ 1ms/op
p384 x 268 ops/sec @ 3ms/op
p521 x 137 ops/sec @ 7ms/op
x25519 x 1,631 ops/sec @ 612μs/op
x448 x 584 ops/sec @ 1ms/op
secp256k1 x 791 ops/sec @ 1ms/op
p256 x 757 ops/sec @ 1ms/op
p384 x 329 ops/sec @ 3ms/op
p521 x 175 ops/sec @ 5ms/op
# hash-to-curve
hashToPrivateScalar x 1,754,385 ops/sec @ 570ns/op
hash_to_field x 135,703 ops/sec @ 7μs/op
hashToCurve secp256k1 x 3,194 ops/sec @ 313μs/op
hashToCurve p256 x 5,962 ops/sec @ 167μs/op
hashToCurve p384 x 2,230 ops/sec @ 448μs/op
hashToCurve p521 x 1,063 ops/sec @ 940μs/op
hashToCurve ed25519 x 4,047 ops/sec @ 247μs/op
hashToCurve ed448 x 1,691 ops/sec @ 591μs/op
hash_to_ristretto255 x 8,733 ops/sec @ 114μs/op
hash_to_decaf448 x 3,882 ops/sec @ 257μs/op
hashToScalar x 212,404 ops/sec @ 4μs/op
hash_to_field x 239,578 ops/sec @ 4μs/op
hashToCurve secp256k1 x 5,101 ops/sec @ 196μs/op
hashToCurve p256 x 7,651 ops/sec @ 130μs/op
hashToCurve p384 x 3,275 ops/sec @ 305μs/op
hashToCurve p521 x 1,642 ops/sec @ 608μs/op
hashToCurve ed25519 x 6,679 ops/sec @ 149μs/op
hashToCurve ed448 x 2,911 ops/sec @ 343μs/op
hash_to_ristretto255 x 9,284 ops/sec @ 107μs/op
hash_to_decaf448 x 3,764 ops/sec @ 265μs/op
# modular over secp256k1 P field
invert a x 866,551 ops/sec @ 1μs/op
invert b x 693,962 ops/sec @ 1μs/op
sqrt p = 3 mod 4 x 25,738 ops/sec @ 38μs/op
sqrt tonneli-shanks x 847 ops/sec @ 1ms/op
invert a x 868,809 ops/sec @ 1μs/op
invert b x 662,251 ops/sec @ 1μs/op
sqrt p = 3 mod 4 x 24,440 ops/sec @ 40μs/op
sqrt tonneli-shanks x 803 ops/sec @ 1ms/op
# bls12-381
init 22ms
getPublicKey x 1,325 ops/sec @ 754μs/op
sign x 80 ops/sec @ 12ms/op
verify x 62 ops/sec @ 15ms/op
pairing x 166 ops/sec @ 6ms/op
pairing10 x 54 ops/sec @ 18ms/op ± 23.48% (15ms..36ms)
MSM 4096 scalars x points 3286ms
aggregatePublicKeys/8 x 173 ops/sec @ 5ms/op
aggregatePublicKeys/32 x 46 ops/sec @ 21ms/op
aggregatePublicKeys/128 x 11 ops/sec @ 84ms/op
aggregatePublicKeys/512 x 2 ops/sec @ 335ms/op
aggregatePublicKeys/2048 x 0 ops/sec @ 1346ms/op
aggregateSignatures/8 x 82 ops/sec @ 12ms/op
aggregateSignatures/32 x 21 ops/sec @ 45ms/op
aggregateSignatures/128 x 5 ops/sec @ 178ms/op
aggregateSignatures/512 x 1 ops/sec @ 705ms/op
aggregateSignatures/2048 x 0 ops/sec @ 2823ms/op
init 90ms
getPublicKey x 2,315 ops/sec @ 431μs/op
sign x 222 ops/sec @ 4ms/op
verify x 113 ops/sec @ 8ms/op
pairing x 160 ops/sec @ 6ms/op
pairing10 x 42 ops/sec @ 23ms/op ± 7.14% (22ms..36ms)
MSM 4096 scalars x points 564ms
aggregatePublicKeys/8 x 1,862 ops/sec @ 536μs/op
aggregatePublicKeys/32 x 1,589 ops/sec @ 629μs/op
aggregatePublicKeys/128 x 988 ops/sec @ 1ms/op
aggregatePublicKeys/512 x 396 ops/sec @ 2ms/op
aggregatePublicKeys/2048 x 115 ops/sec @ 8ms/op
aggregateSignatures/8 x 87 ops/sec @ 11ms/op
aggregateSignatures/32 x 23 ops/sec @ 43ms/op
aggregateSignatures/128 x 5 ops/sec @ 170ms/op
aggregateSignatures/512 x 1 ops/sec @ 680ms/op
aggregateSignatures/2048 x 0 ops/sec @ 2737ms/op
```

@@ -1119,3 +1141,3 @@

- `npm run bench` will run benchmarks
- `npm run build:release` will build single file
- `npm run bundle` will build single file

@@ -1122,0 +1144,0 @@ See [paulmillr.com/noble](https://paulmillr.com/noble/)

import { type CurveLengths } from './abstract/curve.ts';
import { type FROST } from './abstract/frost.ts';
import { type FROST, type FrostPublic, type FrostSecret } from './abstract/frost.ts';
import { type H2CHasher } from './abstract/hash-to-curve.ts';

@@ -48,2 +48,4 @@ import { type ECDSA, type WeierstrassPoint as PointType, type WeierstrassPointCons } from './abstract/weierstrass.ts';

lift_x: typeof lift_x;
frostTweakPublic: typeof frostTweakPublic;
frostTweakSecret: typeof frostTweakSecret;
};

@@ -138,2 +140,4 @@ /** Schnorr-specific secp256k1 API from BIP340. */

export declare const secp256k1_FROST: TRet<FROST>;
declare function frostTweakSecret(s: TArg<FrostSecret>, pub: TArg<FrostPublic>, merkleRoot?: TArg<Uint8Array>): TRet<FrostSecret>;
declare function frostTweakPublic(pub: TArg<FrostPublic>, merkleRoot?: TArg<Uint8Array>): TRet<FrostPublic>;
/**

@@ -155,2 +159,1 @@ * FROST threshold signatures over secp256k1-schnorr-taproot. RFC 9591.

export {};
//# sourceMappingURL=secp256k1.d.ts.map

@@ -13,5 +13,5 @@ /**

import { createFROST, } from "./abstract/frost.js";
import { createHasher, isogenyMap } from "./abstract/hash-to-curve.js";
import { createHasher, isogenyMap, mapToCurveSimpleSWU, } from "./abstract/hash-to-curve.js";
import { Field, mapHashToField, pow2 } from "./abstract/modular.js";
import { ecdsa, mapToCurveSimpleSWU, weierstrass, } from "./abstract/weierstrass.js";
import { ecdsa, weierstrass, } from "./abstract/weierstrass.js";
import { abytes, asciiToBytes, bytesToNumberBE, concatBytes, } from "./utils.js";

@@ -67,3 +67,3 @@ // Seems like generator was produced from some seed:

}
const Fpk1 = Field(secp256k1_CURVE.p, { sqrt: sqrtMod });
const Fpk1 = /* @__PURE__ */ Field(secp256k1_CURVE.p, { sqrt: sqrtMod });
const Pointk1 = /* @__PURE__ */ weierstrass(secp256k1_CURVE, {

@@ -96,3 +96,3 @@ Fp: Fpk1,

/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */
const TAGGED_HASH_PREFIXES = {};
const TAGGED_HASH_PREFIXES = Object.create(null);
// BIP-340 phrases tags as UTF-8, but all current standardized names here are 7-bit ASCII.

@@ -110,10 +110,12 @@ function taggedHash(tag, ...messages) {

const pointToBytes = (point) => point.toBytes(true).slice(1);
const hasEven = (y) => y % _2n === _0n;
const affineXToBytes = ({ x }) => Fpk1.toBytes(x);
const hasEven = (y) => !Fpk1.isOdd(y);
// Calculate point, scalar and bytes
function schnorrGetExtPubKey(priv) {
const { Fn, BASE } = Pointk1;
const d_ = Fn.fromBytes(priv);
const d_ = Fn.fromBytes(abytes(priv, 32, 'secretKey'));
const p = BASE.multiply(d_); // P = d'⋅G; 0 < d' < n check is done inside
const scalar = hasEven(p.y) ? d_ : Fn.neg(d_);
return { scalar, bytes: pointToBytes(p) };
const affine = p.toAffine();
const scalar = hasEven(affine.y) ? d_ : Fn.neg(d_);
return { scalar, bytes: affineXToBytes(affine) };
}

@@ -128,4 +130,4 @@ /**

throw new Error('invalid x: Fail if x ≥ p');
const xx = Fp.create(x * x);
const c = Fp.create(xx * x + BigInt(7)); // Let c = x³ + 7 mod p.
const xx = Fp.sqr(x);
const c = Fp.add(Fp.mulN(xx, x), BigInt(7)); // Let c = x³ + 7 mod p.
let y = Fp.sqrt(c); // Let y = c^(p+1)/4 mod p. Same as sqrt().

@@ -170,7 +172,8 @@ // Return the unique point P such that x(P) = x and

// BIP-340: "Let k' = int(rand) mod n. Fail if k' = 0. Let R = k'⋅G."
if (k_ === 0n)
if (k_ === _0n)
throw new Error('sign failed: k is zero');
const p = BASE.multiply(k_); // Rejects zero; only the raw nonce hash needs reduction.
const k = hasEven(p.y) ? k_ : Fn.neg(k_);
const rx = pointToBytes(p);
const affine = p.toAffine();
const k = hasEven(affine.y) ? k_ : Fn.neg(k_);
const rx = affineXToBytes(affine);
const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n.

@@ -196,3 +199,4 @@ const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n).

const P = lift_x(num(pub)); // P = lift_x(int(pk)); fail if that fails
const r = num(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p.
const rBytes = sig.subarray(0, 32);
const r = num(rBytes); // Let r = int(sig[0:32]); fail if r ≥ p.
if (!Fp.isValidNot0(r))

@@ -207,8 +211,8 @@ return false;

// int(challenge(bytes(r) || bytes(P) || m)) % n
const e = challenge(Fn.toBytes(r), pointToBytes(P), m);
const e = challenge(rBytes, pointToBytes(P), m);
// R = s⋅G - e⋅P, where -eP == (n-e)P
const R = BASE.multiplyUnsafe(s).add(P.multiplyUnsafe(Fn.neg(e)));
const R = BASE.mulAddUnsafe(s, P, Fn.neg(e)); // s⋅G + (-e)⋅P, joint Strauss–Shamir
const { x, y } = R.toAffine();
// Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r.
if (R.is0() || !hasEven(y) || x !== r)
if (R.is0() || !hasEven(y) || !Fp.eql(x, r))
return false;

@@ -221,3 +225,3 @@ return true;

}
export const __TEST = /* @__PURE__ */ Object.freeze({ lift_x });
export const __TEST = /* @__PURE__ */ Object.freeze({ lift_x, frostTweakPublic, frostTweakSecret });
/**

@@ -243,3 +247,3 @@ * Schnorr signatures over secp256k1.

seed = seed === undefined ? randomBytes(seedLength) : seed;
return mapHashToField(seed, secp256k1_CURVE.n);
return mapHashToField(abytes(seed, seedLength, 'seed'), secp256k1_CURVE.n);
};

@@ -386,4 +390,4 @@ return Object.freeze({

}
function frostNoncesToEvenY(PK, nonces) {
if (hasEven(PK.y))
function frostNoncesToEvenY(groupCommitment, nonces) {
if (hasEven(groupCommitment.y))
return nonces;

@@ -410,2 +414,6 @@ const Fn = Pointk1.Fn;

const t = tweak(Pointk1.fromBytes(PKPackage.commitments[0]), merkleRoot);
// Disabled TapTweak (t=0): return the even-Y-normalized package as-is. multiply() rejects
// zero scalars, and adding [0]G would be a no-op anyway.
if (t === _0n)
return PKPackage;
const tp = Pointk1.BASE.multiply(t);

@@ -478,2 +486,1 @@ const commitments = PKPackage.commitments.map((c, i) => (i === 0 ? Pointk1.fromBytes(c).add(tp) : Pointk1.fromBytes(c)).toBytes());

}))();
//# sourceMappingURL=secp256k1.js.map

@@ -18,3 +18,11 @@ /**

/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { abytes, notImplemented, randomBytes, type TArg, type TRet } from '../utils.ts';
import {
aarray,
abytes,
notImplemented,
randomBytes,
validateObject,
type TArg,
type TRet,
} from '../utils.ts';
import { type CurveLengths } from './curve.ts';

@@ -164,3 +172,3 @@ import {

* Build Miller-loop precomputes for one G2 point.
* @param p - G2 point to precompute.
* @param p - Valid non-ZERO G2 point to precompute.
* @returns Pairing precompute table.

@@ -220,3 +228,4 @@ */

* Optional RNG override used by helper constructors.
* Receives the requested byte length and returns random bytes.
* @param len - Requested byte length.
* @returns Random bytes.
*/

@@ -302,3 +311,5 @@ randomBytes?: (len?: number) => TRet<Uint8Array>;

ateLoopSize: bigint;
xNegative: boolean;
twistType: BlsTwistType;
postPrecompute?: BlsPostPrecomputeFn;
};

@@ -352,2 +363,4 @@ }

* Verify one signature against one public key and hashed message.
* Malformed encoded signatures or keys may throw during point decoding; `false` means
* well-formed inputs failed the pairing equation.
* @param signature - Signature point or encoded signature.

@@ -376,2 +389,4 @@ * @param message - Hashed message point.

* Add many public keys into one aggregate point.
* Encoded inputs are decoded through `fromBytes()`; point instances are treated as already
* validated caller-owned objects to keep aggregation linear in additions.
* @param publicKeys - Public keys to aggregate.

@@ -384,2 +399,4 @@ * @returns Aggregated public-key point. This is raw point addition and does not add proof of

* Add many signatures into one aggregate point.
* Encoded inputs are decoded through `fromBytes()`; point instances are treated as already
* validated caller-owned objects to keep aggregation linear in additions.
* @param signatures - Signatures to aggregate.

@@ -430,6 +447,124 @@ * @returns Aggregated signature point. This is raw point addition and does not change the proof

): BlsPairing {
const { Fr, Fp2, Fp12 } = fields;
validateObject(
fields as any,
{ Fp: 'object', Fr: 'object', Fp2: 'object', Fp12: 'object' },
{ Fp6: 'object' },
'fields'
);
if (typeof G1 !== 'function')
throw new TypeError('"G1_Point" expected point constructor, got type=' + typeof G1);
if (typeof G2 !== 'function')
throw new TypeError('"G2_Point" expected point constructor, got type=' + typeof G2);
validateObject(
params as any,
{ ateLoopSize: 'bigint', xNegative: 'boolean', twistType: 'string' },
{ randomBytes: 'function', postPrecompute: 'function' },
'params'
);
const { Fp, Fr, Fp2, Fp12 } = fields;
const { twistType, ateLoopSize, xNegative, postPrecompute } = params;
type G1 = typeof G1.BASE;
type G2 = typeof G2.BASE;
const fp2 = (c0: Fp, c1: Fp): Fp2 => ({ c0, c1 });
const fp2f = ({ c0, c1 }: Fp2): Fp2 => Object.freeze({ c0, c1 });
const add2 = (a: Fp2, b: Fp2) => fp2(Fp.add(a.c0, b.c0), Fp.add(a.c1, b.c1));
const sub2 = (a: Fp2, b: Fp2) => fp2(Fp.sub(a.c0, b.c0), Fp.sub(a.c1, b.c1));
const mul2 = (a: Fp2, b: Fp2) => {
const t0 = Fp.mul(a.c0, b.c0);
const t1 = Fp.mul(a.c1, b.c1);
return fp2(
Fp.sub(t0, t1),
Fp.sub(Fp.mul(Fp.add(a.c0, a.c1), Fp.add(b.c0, b.c1)), Fp.add(t0, t1))
);
};
const mul2ByFp = (a: Fp2, rhs: Fp) => fp2(Fp.mul(a.c0, rhs), Fp.mul(a.c1, rhs));
// Delegates to the tower's mulByNonresidue: it has fast paths for ξ = u+1 / ξ = a+u
// (adds/scalar-muls instead of a full Karatsuba Fp2 multiplication).
const mul2ByNonresidue = (a: Fp2): Fp2 => Fp2.mulByNonresidue(a);
const mul014ByLine = ({ c0: f0, c1: f1 }: Fp12, o0: Fp2, l1: Fp2, l4: Fp2, Px: Fp, Py: Fp) => {
const o1 = mul2ByFp(l1, Px);
const o4 = mul2ByFp(l4, Py);
const { c0: a0, c1: a1, c2: a2 } = f0;
const { c0: b0, c1: b1, c2: b2 } = f1;
// t0 = Fp6.mul01(f0, o0, o1)
const t0_0 = mul2(a0, o0);
const t0_1 = mul2(a1, o1);
const t0_c0 = add2(mul2ByNonresidue(sub2(mul2(add2(a1, a2), o1), t0_1)), t0_0);
const t0_c1 = sub2(sub2(mul2(add2(o0, o1), add2(a0, a1)), t0_0), t0_1);
const t0_c2 = add2(sub2(mul2(add2(a0, a2), o0), t0_0), t0_1);
// t1 = Fp6.mul1(f1, o4)
const t1_c0 = mul2ByNonresidue(mul2(b2, o4));
const t1_c1 = mul2(b0, o4);
const t1_c2 = mul2(b1, o4);
// t2 = Fp6.mul01(Fp6.add(f0, f1), o0, Fp2.add(o1, o4))
const s0 = add2(a0, b0);
const s1 = add2(a1, b1);
const s2 = add2(a2, b2);
const o14 = add2(o1, o4);
const t2_0 = mul2(s0, o0);
const t2_1 = mul2(s1, o14);
const t2_c0 = add2(mul2ByNonresidue(sub2(mul2(add2(s1, s2), o14), t2_1)), t2_0);
const t2_c1 = sub2(sub2(mul2(add2(o0, o14), add2(s0, s1)), t2_0), t2_1);
const t2_c2 = add2(sub2(mul2(add2(s0, s2), o0), t2_0), t2_1);
return Object.freeze({
c0: Object.freeze({
c0: fp2f(add2(mul2ByNonresidue(t1_c2), t0_c0)),
c1: fp2f(add2(t1_c0, t0_c1)),
c2: fp2f(add2(t1_c1, t0_c2)),
}),
c1: Object.freeze({
c0: fp2f(sub2(sub2(t2_c0, t0_c0), t1_c0)),
c1: fp2f(sub2(sub2(t2_c1, t0_c1), t1_c1)),
c2: fp2f(sub2(sub2(t2_c2, t0_c2), t1_c2)),
}),
});
};
// Like mul014ByLine, params are named after the sparse slot they end up in: l0 is scaled by
// Py into o0, l3 is scaled by Px into o3, o4 is used as-is.
const mul034ByLine = ({ c0: f0, c1: f1 }: Fp12, l0: Fp2, l3: Fp2, o4: Fp2, Px: Fp, Py: Fp) => {
const o0 = mul2ByFp(l0, Py);
const o3 = mul2ByFp(l3, Px);
const { c0: a0, c1: a1, c2: a2 } = f0;
const { c0: b0, c1: b1, c2: b2 } = f1;
// a = f0 * o0
const a_c0 = mul2(a0, o0);
const a_c1 = mul2(a1, o0);
const a_c2 = mul2(a2, o0);
// b = Fp6.mul01(f1, o3, o4)
const b0m = mul2(b0, o3);
const b1m = mul2(b1, o4);
const b_c0 = add2(mul2ByNonresidue(sub2(mul2(add2(b1, b2), o4), b1m)), b0m);
const b_c1 = sub2(sub2(mul2(add2(o3, o4), add2(b0, b1)), b0m), b1m);
const b_c2 = add2(sub2(mul2(add2(b0, b2), o3), b0m), b1m);
// e = Fp6.mul01(Fp6.add(f0, f1), Fp2.add(o0, o3), o4)
const s0 = add2(a0, b0);
const s1 = add2(a1, b1);
const s2 = add2(a2, b2);
const o03 = add2(o0, o3);
const e0m = mul2(s0, o03);
const e1m = mul2(s1, o4);
const e_c0 = add2(mul2ByNonresidue(sub2(mul2(add2(s1, s2), o4), e1m)), e0m);
const e_c1 = sub2(sub2(mul2(add2(o03, o4), add2(s0, s1)), e0m), e1m);
const e_c2 = add2(sub2(mul2(add2(s0, s2), o03), e0m), e1m);
return Object.freeze({
c0: Object.freeze({
c0: fp2f(add2(mul2ByNonresidue(b_c2), a_c0)),
c1: fp2f(add2(b_c0, a_c1)),
c2: fp2f(add2(b_c1, a_c2)),
}),
c1: Object.freeze({
c0: fp2f(sub2(sub2(e_c0, a_c0), b_c0)),
c1: fp2f(sub2(sub2(e_c1, a_c1), b_c1)),
c2: fp2f(sub2(sub2(e_c2, a_c2), b_c2)),
}),
});
};
// Applies sparse multiplication as line function

@@ -439,3 +574,3 @@ let lineFunction: (c0: Fp2, c1: Fp2, c2: Fp2, f: Fp12, Px: Fp, Py: Fp) => Fp12;

lineFunction = (c0: Fp2, c1: Fp2, c2: Fp2, f: Fp12, Px: Fp, Py: Fp) =>
Fp12.mul014(f, c0, Fp2.mul(c1, Px), Fp2.mul(c2, Py));
mul014ByLine(f, c0, c1, c2, Px, Py);
} else if (twistType === 'divisive') {

@@ -445,3 +580,3 @@ // NOTE: it should be [c0, c1, c2], but we use different order here to reduce complexity of

lineFunction = (c0: Fp2, c1: Fp2, c2: Fp2, f: Fp12, Px: Fp, Py: Fp) =>
Fp12.mul034(f, Fp2.mul(c2, Py), Fp2.mul(c1, Px), c0);
mul034ByLine(f, c2, c1, c0, Px, Py);
} else throw new Error('bls: unknown twist type');

@@ -496,2 +631,4 @@

const calcPairingPrecomputes = (point: G2) => {
if (!(point instanceof G2))
throw new TypeError('"point" expected G2 point, got type=' + typeof point);
const p = point;

@@ -521,2 +658,7 @@ const { x, y } = p.toAffine();

function millerLoopBatch(pairs: MillerInput, withFinalExponent: boolean = false) {
aarray<MillerInput[number]>(pairs, 'pairs', (pair, title) => {
aarray(pair, title);
if (pair.length !== 3) throw new TypeError(`"${title}" expected precompute tuple`);
aarray(pair[0], title + '[0]');
});
let f12 = Fp12.ONE;

@@ -526,3 +668,4 @@ if (pairs.length) {

for (let i = 0; i < ellLen; i++) {
f12 = Fp12.sqr(f12); // This allows us to do sqr only one time for all pairings
// sqr only one time for all pairings; skip sqr(ONE) at i=0
if (i !== 0) f12 = Fp12.sqr(f12);
// NOTE: we apply multiple pairings in parallel here

@@ -541,4 +684,12 @@ for (const [ell, Px, Py] of pairs) {

function pairingBatch(pairs: PairingInput[], withFinalExponent: boolean = true) {
aarray<PairingInput>(pairs, 'pairs');
const res: MillerInput = [];
for (const { g1, g2 } of pairs) {
for (let i = 0; i < pairs.length; i++) {
const pair = pairs[i];
validateObject(pair as any, { g1: 'object', g2: 'object' }, {}, 'pairs[' + i + ']');
const { g1, g2 } = pair;
if (!(g1 instanceof G1))
throw new TypeError('"pairs[' + i + '].g1" expected G1 point, got type=' + typeof g1);
if (!(g2 instanceof G2))
throw new TypeError('"pairs[' + i + '].g2" expected G2 point, got type=' + typeof g2);
// Mathematically, a zero pairing term contributes GT.ONE. We still reject it here because

@@ -559,2 +710,4 @@ // this API mainly backs BLS verification, where ZERO inputs usually mean broken hash /

function pairing(Q: G1, P: G2, withFinalExponent: boolean = true): Fp12 {
if (!(Q instanceof G1)) throw new TypeError('"Q" expected G1 point, got type=' + typeof Q);
if (!(P instanceof G2)) throw new TypeError('"P" expected G2 point, got type=' + typeof P);
return pairingBatch([{ g1: Q, g2: P }], withFinalExponent);

@@ -603,2 +756,3 @@ }

}
const sigCoder = SignatureCoder;
type PubPoint = WeierstrassPoint<P>;

@@ -610,3 +764,3 @@ type SigPoint = WeierstrassPoint<S>;

function normSig(point: SigPoint | BLSInput): SigPoint {
return point instanceof SigPoint ? (point as SigPoint) : SigPoint.fromBytes(point);
return point instanceof SigPoint ? (point as SigPoint) : sigCoder.fromBytes(point);
}

@@ -651,2 +805,3 @@ // Sign/verify here take points already hashed onto the signature subgroup.

const sec = PubPoint.Fn.fromBytes(secretKey);
// BLS/BN point APIs allow infinity for compatibility; raw message bytes still fail amsg().
amsg(message).assertValidity();

@@ -691,3 +846,3 @@ return message.multiply(sec);

const sig = normSig(signature);
const nMessages = items.map((i) => i.message);
const nMessages = items.map((i) => amsg(i.message));
const nPublicKeys = items.map((i) => normPub(i.publicKey));

@@ -741,6 +896,7 @@ // NOTE: this works only for exact same object

abytes(messageBytes);
const opts = DST ? { DST } : undefined;
// Only omitted DST uses the default; explicit empty DST must reach normDST validation.
const opts = DST === undefined ? undefined : { DST };
return hashToSigCurve(messageBytes, opts);
},
Signature: Object.freeze({ ...SignatureCoder }),
Signature: Object.freeze({ ...sigCoder }),
}) /*satisfies Signer */;

@@ -770,4 +926,5 @@ }

* import { bn254 } from '@noble/curves/bn254.js';
* // Pair a G1 point with a G2 point without the higher-level signer helpers.
* const gt = bn254.pairing(bn254.G1.Point.BASE, bn254.G2.Point.BASE);
* // Rebuild the pairing-only helper from a concrete curve's public pieces.
* const pair = blsBasic(bn254.fields, bn254.G1.Point, bn254.G2.Point, bn254.params);
* const gt = pair.pairing(pair.G1.Point.BASE, pair.G2.Point.BASE);
* ```

@@ -812,3 +969,5 @@ */

ateLoopSize: params.ateLoopSize,
xNegative: params.xNegative,
twistType: params.twistType,
postPrecompute: params.postPrecompute,
}),

@@ -831,2 +990,8 @@ utils: Object.freeze({

const base = blsBasic(fields, G1_Point, G2_Point, params);
validateObject(
hasherParams as any,
{ hasherOpts: 'object', hasherOptsG1: 'object', hasherOptsG2: 'object' },
{ mapToG1: 'function', mapToG2: 'function' },
'hasherParams'
);
// Missing map hooks intentionally fail closed via notImplemented on first hash use.

@@ -869,8 +1034,17 @@ const G1Hasher = createHasher(

* import { bls12_381 } from '@noble/curves/bls12-381.js';
* const sigs = bls12_381.longSignatures;
* // Use the full BLS helper set when you need hashing, keygen, signing, and verification.
* const { secretKey, publicKey } = sigs.keygen();
* const msg = sigs.hash(new TextEncoder().encode('hello noble'));
* const sig = sigs.sign(msg, secretKey);
* const isValid = sigs.verify(sig, msg, publicKey);
* // Rebuild a signer namespace from a concrete curve.
* // Applications usually import bls12_381 directly.
* const rebuilt = bls(
* bls12_381.fields,
* bls12_381.G1.Point,
* bls12_381.G2.Point,
* bls12_381.params,
* {
* hasherOpts: bls12_381.G2.defaults,
* hasherOptsG1: bls12_381.G1.defaults,
* hasherOptsG2: bls12_381.G2.defaults,
* },
* {}
* );
* const { secretKey, publicKey } = rebuilt.longSignatures.keygen();
* ```

@@ -877,0 +1051,0 @@ */

/**
* Methods for elliptic curve multiplication by scalars.
* Contains wNAF, pippenger.
* Contains wNAF-based ScalarMultiplier, pippenger.
* @module
*/
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { bitLen, bitMask, validateObject, type Signer, type TArg, type TRet } from '../utils.ts';
import {
aarray,
abool,
afunction,
aobject,
bitLen,
bitMask,
bytesToNumberBE,
inRange,
isBytes,
isPosBig,
validateObject,
type Signer,
type TArg,
type TRet,
} from '../utils.ts';
import { Field, FpInvertBatch, validateField, type IField } from './modular.ts';

@@ -12,2 +27,13 @@

const _1n = /* @__PURE__ */ BigInt(1);
const _4n = /* @__PURE__ */ BigInt(4);
const BLIND_BYTES = 16;
const BLIND_BITS = 128;
// Fixed-window width for the constant-time multiply of un-precomputed points (W===1).
// A flat 2^FW_WINDOW table has a small, scalar-independent build cost that amortizes over a single
// multiply, unlike the larger per-point wNAF tables that only pay off when cached.
const FW_WINDOW = 5;
// Precompute tables are capped at ~2 GiB of estimated heap. Rejecting larger windows up front
// turns a typo'd window size into an immediate error instead of a multi-GB allocation (or an
// effective hang) when the lazy table is built on first multiply.
const TABLE_BYTES_MAX = /* @__PURE__ */ (() => 2 ** 31)();

@@ -105,3 +131,4 @@ /** Affine point coordinates without projective fields. */

/**
* Massively speeds up `p.multiply(n)` by using precompute tables (caching). See {@link wNAF}.
* Massively speeds up `p.multiply(n)` by using precompute tables (caching).
* See {@link ScalarMultiplier}.
* Cache state lives in internal WeakMaps keyed by point identity, not on the point object.

@@ -236,20 +263,11 @@ * Repeating `precompute(...)` for the same point identity replaces the remembered window size

const pc = Point as unknown as CurvePointCons<any>;
if (typeof (pc as unknown) !== 'function') throw new TypeError('Point must be a constructor');
// validateObject only accepts plain objects, so copy the constructor statics into one bag first.
validateObject(
{
Fp: pc.Fp,
Fn: pc.Fn,
fromAffine: pc.fromAffine,
fromBytes: pc.fromBytes,
fromHex: pc.fromHex,
},
{
Fp: 'object',
Fn: 'object',
fromAffine: 'function',
fromBytes: 'function',
fromHex: 'function',
}
);
if (typeof (pc as unknown) !== 'function')
throw new TypeError('"Point" expected constructor, got type=' + typeof Point);
afunction(pc.fromAffine, 'Point.fromAffine');
afunction(pc.fromBytes, 'Point.fromBytes');
afunction(pc.fromHex, 'Point.fromHex');
// Generic helpers (ScalarMultiplier, normalizeZ, MSM) dereference BASE / ZERO:
// fail here with a typed error instead of an `undefined` access later.
aobject(pc.BASE, 'Point.BASE');
aobject(pc.ZERO, 'Point.ZERO');
validateField(pc.Fp);

@@ -279,22 +297,2 @@ validateField(pc.Fn);

/**
* Computes both candidates first, but the final selection still branches on `condition`, so this
* is not a strict constant-time CMOV primitive.
* @param condition - Whether to negate the point.
* @param item - Point-like value.
* @returns Original or negated value.
* @example
* Keep the point or return its negation based on one boolean branch.
*
* ```ts
* import { negateCt } from '@noble/curves/abstract/curve.js';
* import { p256 } from '@noble/curves/nist.js';
* const maybeNegated = negateCt(true, p256.Point.BASE);
* ```
*/
export function negateCt<T extends { negate: () => T }>(condition: boolean, item: T): T {
const neg = item.negate();
return condition ? neg : item;
}
/**
* Takes a bunch of Projective Points but executes only one

@@ -321,2 +319,8 @@ * inversion on all of them. Inversion is very slow operation,

): P[] {
// Match MSM helpers: reject malformed public inputs before reading projective internals.
validatePointCons(c);
validateMSMPoints(points, c);
// Identity points (Z=0) rely on an implicit contract: FpInvertBatch without `passZero`
// yields `undefined` for zero inputs, and `toAffine(undefined)` falls back to its internal
// is0 handling instead of using the batch inverse.
const invertedZs = FpInvertBatch(

@@ -329,56 +333,66 @@ c.Fp,

function validateW(W: number, bits: number) {
if (!Number.isSafeInteger(W) || W <= 0 || W > bits)
throw new Error('invalid window size, expected [1..' + bits + '], got W=' + W);
function validateW(W: number, bits: number, min: number = 1) {
if (!Number.isSafeInteger(W) || W < min || W > bits)
throw new Error('invalid window size, expected [' + min + '..' + bits + '], got W=' + W);
}
/** Internal wNAF opts for specific W and scalarBits.
* Zero digits are skipped, so tables store only the positive half-window and callers reserve one
* extra carry window.
*/
type WOpts = {
windows: number;
windowSize: number;
mask: bigint;
maxNumber: number;
shiftBy: bigint;
};
function calcWOpts(W: number, scalarBits: number): WOpts {
validateW(W, scalarBits);
const windows = Math.ceil(scalarBits / W) + 1; // W=8 33. Not 32, because we skip zero
const windowSize = 2 ** (W - 1); // W=8 128. Not 256, because we skip zero
const maxNumber = 2 ** W; // W=8 256
const mask = bitMask(W); // W=8 255 == mask 0b11111111
const shiftBy = BigInt(W); // W=8 8
return { windows, windowSize, mask, maxNumber, shiftBy };
// Rough per-point heap estimate for the {@link TABLE_BYTES_MAX} cap: up to 4 projective/extended
// coordinates of Fp.BYTES each, plus bigint/object overhead. Callers pass the point count of the
// largest table the checked parameters can produce.
function validateTableBytes(numPoints: number, fpBytes: number): void {
const bytes = numPoints * (4 * fpBytes + 128);
if (bytes > TABLE_BYTES_MAX)
throw new Error(
'invalid window size: table would need ~' +
Math.ceil(bytes / 2 ** 20) +
' MiB, max ' +
TABLE_BYTES_MAX / 2 ** 20 +
' MiB'
);
}
function calcOffsets(n: bigint, window: number, wOpts: WOpts) {
const { windowSize, mask, maxNumber, shiftBy } = wOpts;
let wbits = Number(n & mask); // extract W bits.
let nextN = n >> shiftBy; // shift number by W bits.
/** RNG interface used for scalar / nonce blinding. */
export type RandomBytes = (bytesLength?: number) => TRet<Uint8Array>;
// What actually happens here:
// const highestBit = Number(mask ^ (mask >> 1n));
// let wbits2 = wbits - 1; // skip zero
// if (wbits2 & highestBit) { wbits2 ^= Number(mask); // (~);
// split if bits > max: +224 => 256-32
if (wbits > windowSize) {
// we skip zero, which means instead of `>= size-1`, we do `> size`
wbits -= maxNumber; // -32, can be maxNumber - wbits, but then we need to set isNeg here.
nextN += _1n; // +256 (carry)
/**
* Probes an RNG once, at construction time: returns `undefined` when it is unavailable —
* throws or returns malformed bytes — so callers can downgrade to their unblinded /
* deterministic constant-time fallback. Blinding is defense-in-depth (DPA/template
* hardening), not a correctness or key-secrecy requirement, so availability-based
* downgrade is acceptable.
*
* The downgrade decision is deliberately static. After a successful probe the RNG becomes
* part of the trusted contract: later misbehavior must fail closed in per-call validation
* (throw), never downgrade — a dynamic fallback would let a tampered RNG silently strip
* blinding on demand. A probe can only ever classify broken environments, not adversarial
* RNGs: a stateful RNG can always behave while probed and misbehave later.
* @param randomBytes - RNG to probe, or `undefined` when the environment provides none.
* @param length - Byte length requested from the probe call.
* @returns The RNG when the probe produced `length` valid bytes; `undefined` otherwise.
* @example
* Probe an RNG once before enabling scalar blinding.
*
* ```ts
* import { probeRandomBytes } from '@noble/curves/abstract/curve.js';
* import { randomBytes } from '@noble/hashes/utils.js';
* const rng = probeRandomBytes(randomBytes, 16);
* ```
*/
export function probeRandomBytes(
randomBytes: TArg<RandomBytes | undefined>,
length: number
): TRet<RandomBytes | undefined> {
if (randomBytes === undefined) return undefined;
afunction(randomBytes, 'randomBytes');
try {
const probe = randomBytes(length);
if (!isBytes(probe) || probe.length !== length) return undefined;
} catch {
return undefined;
}
const offsetStart = window * windowSize;
const offset = offsetStart + Math.abs(wbits) - 1; // -1 because we skip zero; ignore when isZero
const isZero = wbits === 0; // is current window slice a 0?
const isNeg = wbits < 0; // is current window slice negative?
const isNegF = window % 2 !== 0; // fake branch noise only
const offsetF = offsetStart; // fake branch noise only
return { nextN, offset, isZero, isNeg, isNegF, offsetF };
return randomBytes as TRet<RandomBytes>;
}
function validateMSMPoints(points: any[], c: any) {
if (!Array.isArray(points)) throw new Error('array expected');
aarray(points, 'points');
points.forEach((p, i) => {

@@ -388,6 +402,9 @@ if (!(p instanceof c)) throw new Error('invalid point at index ' + i);

}
function validateMSMScalars(scalars: any[], field: any) {
// Default bound is field membership (0 <= s < field.ORDER); a `maxScalar` override widens it
// to 0 <= s < maxScalar for callers that accept oversized scalars.
function validateMSMScalars(scalars: any[], field: any, maxScalar?: bigint) {
if (!Array.isArray(scalars)) throw new Error('array of scalars expected');
scalars.forEach((s, i) => {
if (!field.isValid(s)) throw new Error('invalid scalar at index ' + i);
const ok = maxScalar === undefined ? field.isValid(s) : isPosBig(s) && s < maxScalar;
if (!ok) throw new Error('invalid scalar at index ' + i);
});

@@ -397,39 +414,113 @@ }

// Since points in different groups cannot be equal (different object constructor),
// we can have single place to store precomputes.
// we can have single place to store window sizes.
// Allows to make points frozen / immutable.
const pointPrecomputes = new WeakMap<any, any[]>();
type WnafPrecomputeEntry<T> = { W: number; bits: number; windows: number; comp: T[] };
/** Result of a constant-time multiply: real point `p`, fake accumulator `f` (discarded). */
type MulResult<P> = { p: P; f: P };
const pointWindowSizes = new WeakMap<any, number>();
function getW(P: any): number {
// To disable precomputes:
// return 1;
// `1` is also the uncached sentinel: use the ladder / non-precomputed path.
function getWindowSize(P: any): number {
// `1` is the uncached sentinel: use the non-precomputed (wNAF / fixed-window) path.
return pointWindowSizes.get(P) || 1;
}
function assert0(n: bigint): void {
// Internal invariant: a non-zero remainder here means the wNAF window decomposition or loop
// count is inconsistent, not that the original caller provided a bad scalar.
if (n !== _0n) throw new Error('invalid wNAF');
/** Table of odd multiples [1P, 3P, ..., (2⋅size−1)P]; width-W wNAF uses size = 2^(W−2). */
function oddMultiples<P extends { double(): P; add(other: P): P }>(p: P, size: number): P[] {
const dbl = p.double();
const t = [p];
for (let j = 1; j < size; j++) t.push(t[j - 1].add(dbl));
return t;
}
/**
* Elliptic curve multiplication of Point by scalar. Fragile.
* Table generation takes **30MB of ram and 10ms on high-end CPU**,
* but may take much longer on slow devices. Actual generation will happen on
* first call of `multiply()`. By default, `BASE` point is precomputed.
* Width-W wNAF signed-digit recoding (W >= 2), LSB-first: digits are 0 or odd with
* |digit| < 2^(W−1); nonzero density ~1/(W+1) (a nonzero digit is followed by W−1 zeros).
*/
function wnafDigits(n: bigint, W: number): number[] {
const size = 2 ** W;
const half = size / 2;
const mask = BigInt(size - 1);
const d: number[] = [];
while (n > _0n) {
let w = 0;
if (n & _1n) {
w = Number(n & mask); // n mod 2^W, odd
if (w >= half) w -= size; // signed residue
n -= BigInt(w); // n - w ≡ 0 mod 2^W: next W−1 digits are zero
}
d.push(w);
n >>= _1n;
}
return d;
}
/**
* Fixed-position signed-window recoding for precomputed wNAF: `n = Σ digits[w]⋅2^(w⋅W)` with
* digits in `[−2^(W−1)+1, 2^(W−1)]`. Digit count is fixed by `windows` (callers reserve one
* extra window for the final carry), so recoding length does not depend on the scalar.
*/
function signedWindowDigits(n: bigint, W: number, windows: number): number[] {
const size = 2 ** W;
const half = size / 2;
const mask = BigInt(size - 1);
const shiftBy = BigInt(W);
const d: number[] = [];
for (let w = 0; w < windows; w++) {
let v = Number(n & mask);
n >>= shiftBy;
if (v > half) {
v -= size; // negative digit, carry into the next window
n += _1n;
}
d.push(v);
}
// Internal invariant: leftover bits mean the window count did not cover the scalar.
if (n !== _0n) throw new Error('invalid wnaf');
return d;
}
/**
* Shared vartime walk over per-scalar wNAF digit streams: one doubling of a single shared
* accumulator per bit position of the longest recoding, one signed table addition per
* nonzero digit. `tables[i]` must hold the odd multiples of the i-th point.
*/
function wnafWalk<P extends { double(): P; add(other: P): P; negate(): P }>(
zero: P,
tables: P[][],
digits: number[][]
): P {
let max = 0;
for (const d of digits) max = Math.max(max, d.length);
let acc = zero;
for (let bit = max - 1; bit >= 0; bit--) {
if (bit !== max - 1) acc = acc.double();
for (let i = 0; i < digits.length; i++) {
const w = digits[i][bit]; // reads past shorter recodings yield undefined, skipped below
if (w) {
const item = tables[i][(Math.abs(w) - 1) >> 1];
acc = acc.add(w < 0 ? item.negate() : item);
}
}
}
return acc;
}
/**
* Elliptic curve multiplication of Point by scalar.
* Routes between cached-table, fixed-window, and one-shot wNAF paths; entry points validate
* their own scalars (`mulCT`/`mulCTBlinded`: `1 <= s < Fn.ORDER`; `mulUnsafe`: up to the
* `Fn.ORDER^4` DoS cap via {@link mulAddUnsafe}).
* Table generation is expensive and happens on first call of `multiply()`
* (or eagerly via `precompute(W, false)`). By default, `BASE` point is precomputed.
*
* Scalars should always be less than curve order: this should be checked inside of a curve itself.
* Creates precomputation tables for fast multiplication:
* - private scalar is split by fixed size windows of W bits
* - every window point is collected from window's table & added to accumulator
* - since windows are different, same point inside tables won't be accessed more than once per calc
* - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)
* - +1 window is neccessary for wNAF
* - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication
*
* TODO: research returning a 2d JS array of windows instead of a single window.
* This would allow windows to be in different memory locations.
* Cached algorithm is signed fixed-window wNAF:
* - table stores, for every window w, the multiples `[1..2^(W−1)]⋅2^(w⋅W)⋅P` — all doublings
* are baked in, so a multiplication is exactly one table addition per window
* - window count is fixed (`ceil(bits/W) + 1`), so the point-operation count is scalar-independent
* (basis of the constant-time path)
* - for a 256-bit curve and W=6: 44⋅32 = 1408 table points, 44 additions per multiply
* - secret scalars are additionally blinded (see {@link ScalarMultiplier.mulCTBlinded}), which
* widens tables by 128 bits
* @param Point - Point constructor.
* @param bits - Scalar bit length.
* @param randomBytes - RNG used for scalar blinding; required by the blinded secret path.
* @example

@@ -439,171 +530,269 @@ * Elliptic curve multiplication of Point by scalar.

* ```ts
* import { wNAF } from '@noble/curves/abstract/curve.js';
* import { ScalarMultiplier } from '@noble/curves/abstract/curve.js';
* import { p256 } from '@noble/curves/nist.js';
* const ladder = new wNAF(p256.Point, p256.Point.Fn.BITS);
* const mul = new ScalarMultiplier(p256.Point);
* ```
*/
export class wNAF<PC extends PC_ANY> {
export class ScalarMultiplier<PC extends PC_ANY> {
private readonly Point: PC;
private readonly BASE: PC_P<PC>;
private readonly ZERO: PC_P<PC>;
private readonly Fn: PC['Fn'];
private readonly randomBytes?: RandomBytes;
private readonly wnafPrecomputes = new WeakMap<PC_P<PC>, WnafPrecomputeEntry<PC_P<PC>>[]>();
private baseCanBeBlinded: boolean | undefined;
readonly bits: number;
// Parametrized with a given Point class (not individual point)
constructor(Point: PC, bits: number) {
constructor(Point: PC, randomBytes?: RandomBytes) {
validatePointCons(Point);
// Probe the RNG once (see {@link probeRandomBytes}): in environments without working
// randomness (e.g. no WebCrypto), shouldBlind() then routes secret multiplication to the
// unblinded constant-time path instead of throwing on every multiply(). The shape of
// returned bytes is still validated on every blinded call, where breakage fails closed.
this.randomBytes = probeRandomBytes(randomBytes, BLIND_BYTES);
this.Point = Point;
this.BASE = Point.BASE;
this.ZERO = Point.ZERO;
this.Fn = Point.Fn;
this.bits = bits;
this.bits = Point.Fn.BITS;
}
// non-const time multiplication ladder
_unsafeLadder(elm: PC_P<PC>, n: bigint, p: PC_P<PC> = this.ZERO): PC_P<PC> {
let d: PC_P<PC> = elm;
while (n > _0n) {
if (n & _1n) p = p.add(d);
d = d.double();
n >>= _1n;
}
return p;
}
/**
* Creates a wNAF precomputation window. Used for caching.
* Default window size is set by `utils.precompute()` and is equal to 8.
* Number of precomputed points depends on the curve size:
* 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:
* - 𝑊 is the window size
* - 𝑛 is the bitlength of the curve order.
* For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.
* Creates a signed fixed-window wNAF precomputation table: for every window w, the
* multiples `[1..2^(W−1)]⋅2^(w⋅W)⋅P`, flattened. All doublings are baked into the table,
* so cached multiplication is additions-only. `windows = ceil(bits/W) + 1`: the extra
* window absorbs the final carry of signed-digit recoding.
* For a 256-bit curve and W=6, the table is 44⋅32 = 1408 points.
* @param point - Point instance
* @param W - window size
* @returns precomputed point tables flattened to a single array
* @param bits - scalar bitlength the table must cover
*/
private precomputeWindow(point: PC_P<PC>, W: number): PC_P<PC>[] {
const { windows, windowSize } = calcWOpts(W, this.bits);
const points: PC_P<PC>[] = [];
let p: PC_P<PC> = point;
let base = p;
for (let window = 0; window < windows; window++) {
base = p;
points.push(base);
// i=1, bc we skip 0
for (let i = 1; i < windowSize; i++) {
base = base.add(p);
points.push(base);
private buildWnafTable(point: PC_P<PC>, W: number, bits: number): WnafPrecomputeEntry<PC_P<PC>> {
// W needs no re-validation: its only source is setWindowSize(), which enforces
// 1 <= W <= Fn.BITS <= bits (the blinded path only ever widens bits) and caps the
// resulting table at ~2 GiB (sized against the wider blinded layout).
const windows = Math.ceil(bits / W) + 1;
const half = 2 ** (W - 1);
const comp: PC_P<PC>[] = [];
let base = point;
for (let w = 0; w < windows; w++) {
let acc = base;
for (let i = 0; i < half; i++) {
comp.push(acc);
acc = acc.add(base);
}
p = base.double();
base = comp[comp.length - 1].double(); // 2⋅(2^(W−1)⋅base) = next window's base
}
return points;
return { W, bits, windows, comp };
}
/**
* Implements ec multiplication using precomputed tables and w-ary non-adjacent form.
* More compact implementation:
* https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541
* Implements ec multiplication using precomputed signed fixed-window wNAF tables.
* Constant-time: fixed window count with one table addition per window — zero digits feed
* the fake accumulator — and no doublings; the lookup scans the whole window slice.
* Scalar bounds are validated by the public entry points ({@link ScalarMultiplier.mulCT},
* {@link ScalarMultiplier.mulCTBlinded}, {@link ScalarMultiplier.mulUnsafe});
* signedWindowDigits throws if `n` exceeds the table.
* @returns real and fake (for const-time) points
*/
private wNAF(W: number, precomputes: PC_P<PC>[], n: bigint): { p: PC_P<PC>; f: PC_P<PC> } {
// Scalar should be smaller than field order
if (!this.Fn.isValid(n)) throw new Error('invalid scalar');
// Accumulators
private wnafCachedCT(precomputes: WnafPrecomputeEntry<PC_P<PC>>, n: bigint): MulResult<PC_P<PC>> {
const { W, windows, comp } = precomputes;
const half = 2 ** (W - 1);
const digits = signedWindowDigits(n, W, windows);
let p = this.ZERO;
let f = this.BASE;
// This code was first written with assumption that 'f' and 'p' will never be infinity point:
// since each addition is multiplied by 2 ** W, it cannot cancel each other. However,
// there is negate now: it is possible that negated element from low value
// would be the same as high element, which will create carry into next window.
// It's not obvious how this can fail, but still worth investigating later.
const wo = calcWOpts(W, this.bits);
for (let window = 0; window < wo.windows; window++) {
// (n === _0n) is handled and not early-exited. isEven and offsetF are used for noise
const { nextN, offset, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window, wo);
n = nextN;
if (isZero) {
// bits are 0: add garbage to fake point
// Important part for const-time getPublicKey: add random "noise" point to f.
f = f.add(negateCt(isNegF, precomputes[offsetF]));
} else {
// bits are 1: add to result point
p = p.add(negateCt(isNeg, precomputes[offset]));
}
for (let w = 0; w < windows; w++) {
const digit = digits[w];
const start = w * half;
// Data-oblivious select: touch every entry of the window before the digit branch.
const idx = Math.abs(digit) - 1; // -1 for zero digits: matches nothing, `sel` unused
let sel = comp[start];
for (let i = 1; i < half; i++) sel = i === idx ? comp[start + i] : sel;
const neg = sel.negate(); // compute both signs; the digit only picks one
if (digit === 0) f = f.add(comp[start]);
else p = p.add(digit < 0 ? neg : sel);
}
assert0(n);
// Return both real and fake points so JIT keeps the noise path alive.
// Known caveat: negate/carry interactions can still drive `f` to infinity even when `p` is not,
// which weakens the noise path and leaves this only "less const-time" by about one bigint mul.
return { p, f };
}
/**
* Implements unsafe EC multiplication using precomputed tables
* and w-ary non-adjacent form.
* @param acc - accumulator point to add result of multiplication
* @returns point
*/
private wNAFUnsafe(
// Cache key is point identity plus (W, bits); at most two entries exist per point (public-width
// `Fn.BITS` and blinded `Fn.BITS + BLIND_BITS`). Callers must not reuse the same point with
// incompatible `transform(...)` layouts and expect a separate cache entry.
private getWnafPrecomputes(
W: number,
precomputes: PC_P<PC>[],
n: bigint,
acc: PC_P<PC> = this.ZERO
): PC_P<PC> {
const wo = calcWOpts(W, this.bits);
for (let window = 0; window < wo.windows; window++) {
if (n === _0n) break; // Early-exit, skip 0 value
const { nextN, offset, isZero, isNeg } = calcOffsets(n, window, wo);
n = nextN;
if (isZero) {
// Window bits are 0: skip processing.
// Move to next window.
continue;
} else {
const item = precomputes[offset];
acc = acc.add(isNeg ? item.negate() : item); // Re-using acc allows to save adds in MSM
point: PC_P<PC>,
bits: number,
transform?: Mapper<PC_P<PC>>
): WnafPrecomputeEntry<PC_P<PC>> {
let entries = this.wnafPrecomputes.get(point);
let comp = entries?.find((entry) => entry.W === W && entry.bits === bits);
if (!comp) {
comp = this.buildWnafTable(point, W, bits);
if (typeof transform === 'function') comp = { ...comp, comp: transform(comp.comp) };
if (!entries) {
entries = [];
this.wnafPrecomputes.set(point, entries);
}
entries.push(comp);
}
assert0(n);
return acc;
return comp;
}
private getPrecomputes(W: number, point: PC_P<PC>, transform?: Mapper<PC_P<PC>>): PC_P<PC>[] {
// Cache key is only point identity plus the remembered window size; callers must not reuse the
// same point with incompatible `transform(...)` layouts and expect a separate cache entry.
let comp = pointPrecomputes.get(point);
if (!comp) {
comp = this.precomputeWindow(point, W) as PC_P<PC>[];
if (W !== 1) {
// Doing transform outside of if brings 15% perf hit
if (typeof transform === 'function') comp = transform(comp);
pointPrecomputes.set(point, comp);
}
private assertPoint(point: PC_P<PC>): void {
if (!(point instanceof this.Point))
throw new TypeError('"point" expected Point instance, got type=' + typeof point);
}
// Shared prologue of the constant-time entry points. Rejects scalar 0: in key/signature-style
// callers a zero scalar means broken upstream plumbing, and concrete Points already reject it.
// Uses inRange instead of Fn.isValidNot0: validateField() only certifies the arithmetic subset.
private validateMulInput(point: PC_P<PC>, scalar: bigint): void {
this.assertPoint(point);
if (!inRange(scalar, _1n, this.Point.Fn.ORDER)) throw new Error('invalid scalar');
}
// Constant-time dispatch shared by mulCT / mulCTBlinded. Un-precomputed points (W===1, e.g.
// ECDH peer keys) skip building a throwaway cached table in favor of a small fixed-window
// multiply. `n` must be < 2^bits.
private runCT(
point: PC_P<PC>,
n: bigint,
bits: number,
transform?: Mapper<PC_P<PC>>
): MulResult<PC_P<PC>> {
const W = getWindowSize(point);
if (W === 1) return this.fixedWindowCT(point, n, bits);
return this.wnafCachedCT(this.getWnafPrecomputes(W, point, bits, transform), n);
}
mulCT(point: PC_P<PC>, scalar: bigint, transform?: Mapper<PC_P<PC>>): MulResult<PC_P<PC>> {
this.validateMulInput(point, scalar);
return this.runCT(point, scalar, this.bits, transform);
}
mulCTBlinded(point: PC_P<PC>, scalar: bigint, transform?: Mapper<PC_P<PC>>): MulResult<PC_P<PC>> {
this.validateMulInput(point, scalar);
// Blinding computes n = scalar + blind*Fn.ORDER, then n*P via a constant-time multiply. This
// equals scalar*P only when Fn.ORDER*P == O; callers guarantee that via shouldBlind() (always
// for cofactor-1 curves; for cofactored curves only BASE, and only after checking BASE*n == O).
// Fail before building the (large) precompute table if randomness is unavailable.
if (this.randomBytes === undefined)
throw new Error('randomBytes is required for scalar blinding');
const bits = this.Point.Fn.BITS + BLIND_BITS;
const blind = this.randomBytes(BLIND_BYTES);
if (!isBytes(blind) || blind.length !== BLIND_BYTES)
throw new Error('randomBytes returned invalid byte array');
// Force the top two bits of the 128-bit blind to 10xxxxxx, so blind is in [2^127, 1.5*2^127):
// * `| 0x80` (bit 127 = 1) is the load-bearing part: it guarantees blind >= 2^127, so the blind
// is always a full-width, nonzero factor and the scalar is masked even with a degenerate RNG.
// * `& 0x3f` (bit 126 = 0) is a safety margin: it caps blind < 1.5*2^127, keeping
// blind*Fn.ORDER + scalar < 0.75*2^(nBits+128), i.e. ~half a window below the 2^(nBits+128)
// ceiling. Not strictly required for the bound (see below), but it reserves headroom so the
// guarantee does not rest on the tight `Fn.ORDER < 2^Fn.BITS` fact and the final carry window
// only ever holds a small carry, never a full digit.
blind[0] = (blind[0] & 0x3f) | 0x80;
// Even at the extreme (blind < 2^128, scalar < Fn.ORDER < 2^nBits): n <= 2^128*Fn.ORDER - 1 <
// 2^(nBits+128), so n stays below 2^bits and within the blinded table's
// window count. Both cached CT kernels run a fixed number of windows/rows with one point-add
// each, so the add count is independent of scalar (constant-time).
const n = scalar + bytesToNumberBE(blind) * this.Point.Fn.ORDER;
return this.runCT(point, n, bits, transform);
}
/**
* Constant-time multiplication `n*point` for an un-precomputed point, via a small fixed window.
* A cached wNAF table only pays off when reused; a flat 2^FW_WINDOW table (`size-1` adds) is
* far cheaper to build for a single use. The point-operation sequence is independent of `n`:
* build the table, then per window exactly FW_WINDOW doublings, a data-oblivious scan over
* every table entry, and one addition (adds the identity when the window digit is 0 — never
* skipped).
*
* `n` must be `< 2^bits`. Assumes complete addition (adding the identity costs the same as any
* add), which holds for the Weierstrass/Edwards point types used here. The table is left in
* projective form (no normalizeZ): normalizing this small a table costs more than the
* mixed-add savings it would buy for a single multiply.
* @returns real point `p`; `f` duplicates it only to match {@link wnafCachedCT}'s return shape
* (this path needs no fake accumulator — its op-count is already scalar-independent).
*/
private fixedWindowCT(point: PC_P<PC>, n: bigint, bits: number): MulResult<PC_P<PC>> {
const W = FW_WINDOW;
const size = 1 << W;
const mask = bitMask(W);
// Flat table [O, point, 2*point, ..., (size-1)*point].
const table: PC_P<PC>[] = new Array(size);
table[0] = this.ZERO;
for (let i = 1; i < size; i++) table[i] = table[i - 1].add(point);
// Horner MSB->LSB. windows*W >= bits and n < 2^bits, so every bit of n is consumed.
const windows = Math.ceil(bits / W);
let acc = this.ZERO;
for (let window = windows - 1; window >= 0; window--) {
// W doublings per window; skipped for the first (topmost) window, where acc is still the
// identity. The skip is scalar-independent: it depends only on the loop index.
if (window !== windows - 1) for (let d = 0; d < W; d++) acc = acc.double();
const digit = Number((n >> BigInt(window * W)) & mask);
// Data-oblivious select: touch every entry, same as wnafCachedCT.
let sel = table[0];
for (let i = 1; i < size; i++) sel = i === digit ? table[i] : sel;
acc = acc.add(sel); // one add per window, even for digit 0
}
return comp;
return { p: acc, f: acc };
}
cached(
private shouldBlind(point: PC_P<PC>, cofactor: bigint): boolean {
// No usable RNG (probed in the constructor): blinding is impossible, use the plain CT path.
if (this.randomBytes === undefined) return false;
if (cofactor === _1n) return true;
if (point !== this.BASE) return false;
if (this.baseCanBeBlinded === undefined)
this.baseCanBeBlinded = this.mulUnsafe(this.BASE, this.Point.Fn.ORDER).is0();
return this.baseCanBeBlinded;
}
mulSecret(
point: PC_P<PC>,
scalar: bigint,
cofactor: bigint,
transform?: Mapper<PC_P<PC>>
): { p: PC_P<PC>; f: PC_P<PC> } {
const W = getW(point);
return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar);
): MulResult<PC_P<PC>> {
return this.shouldBlind(point, cofactor)
? this.mulCTBlinded(point, scalar, transform)
: this.mulCT(point, scalar, transform);
}
unsafe(point: PC_P<PC>, scalar: bigint, transform?: Mapper<PC_P<PC>>, prev?: PC_P<PC>): PC_P<PC> {
const W = getW(point);
if (W === 1) return this._unsafeLadder(point, scalar, prev); // For W=1 ladder is ~x2 faster
return this.wNAFUnsafe(W, this.getPrecomputes(W, point, transform), scalar, prev);
mulUnsafe(point: PC_P<PC>, scalar: bigint, transform?: Mapper<PC_P<PC>>): PC_P<PC> {
this.assertPoint(point);
if (!isPosBig(scalar)) throw new Error('invalid scalar');
const W = getWindowSize(point);
// W === 1 (un-precomputed): one-shot width-4 wNAF via {@link mulAddUnsafe} with L=1 —
// a cached table would be thrown away after one use. `allowOversized` swaps the
// `s < Fn.ORDER` check for mulAddUnsafe's `Fn.ORDER^4` DoS cap.
//
// Oversized scalar could happen when:
// a) user passes large scalar on their own (rare)
// b) `assertValidity()` calls `isTorsionFree()`, which multiplies point by `Fn.ORDER`
if (W === 1 || scalar >= this.Point.Fn.ORDER)
return mulAddUnsafe(this.Point, [point], [scalar], true);
// Precomputed points reuse the CT kernel (fake accumulator discarded): with W=6 only
// ~1/64 of window-adds are skippable, so a dedicated vartime kernel saved just ~6% on
// this path while doubling the cached-table code surface.
const precomputes = this.getWnafPrecomputes(W, point, this.bits, transform);
return this.wnafCachedCT(precomputes, scalar).p;
}
// We calculate precomputes for elliptic curve point multiplication
// using windowed method. This specifies window size and
// stores precomputed values. Usually only base point would be precomputed.
createCache(P: PC_P<PC>, W: number): void {
// Remembers the window size used for precomputed wNAF multiplication of the given point
// and drops any previously built tables. Usually only the base point is precomputed.
// W=1 resets the point to the un-precomputed (table-less) paths.
// W is additionally capped so tables stay under ~2 GiB ({@link TABLE_BYTES_MAX}).
setWindowSize(point: PC_P<PC>, W: number): void {
this.assertPoint(point);
validateW(W, this.bits);
pointWindowSizes.set(P, W);
pointPrecomputes.delete(P);
// Size against the widest table this W can produce: the blinded path adds BLIND_BITS.
const windows = Math.ceil((this.bits + BLIND_BITS) / W) + 1;
validateTableBytes(windows * 2 ** (W - 1), this.Point.Fp.BYTES);
pointWindowSizes.set(point, W);
this.wnafPrecomputes.delete(point);
}
hasCache(elm: PC_P<PC>): boolean {
return getW(elm) !== 1;
// True when a window size is set: tables themselves are built lazily on first multiply.
hasWindowSize(point: PC_P<PC>): boolean {
return getWindowSize(point) !== 1;
}

@@ -613,35 +802,45 @@ }

/**
* Endomorphism-specific multiplication for Koblitz curves.
* Cost: 128 dbl, 0-256 adds.
* @param Point - Point constructor.
* @param point - Input point.
* @param k1 - First non-negative absolute scalar chunk.
* @param k2 - Second non-negative absolute scalar chunk.
* @returns Partial multiplication results.
* Combined multi-scalar multiplication `Σ scalars[i]⋅points[i]` via interleaved width-4 wNAF
* (Strauss–Shamir). Every input gets its own table of odd multiples `[1P, 3P, 5P, 7P]` and
* signed-digit recoding, but all walks share one doubling chain, so total cost is
* `~bits` doublings + `L⋅bits/5` additions instead of `L⋅bits` doublings for separate
* multiplications. Intended for the 2-4 point shapes of signature verification
* (`R = u1⋅G + u2⋅P`); use {@link pippenger} for larger batches.
*
* Not constant-time: only for public inputs. Scalars must satisfy `0 <= s < Fn.ORDER`;
* fold negative signs into the points before calling.
* @param c - Point constructor.
* @param points - Array of curve points.
* @param scalars - Array of non-negative scalars, same length as points.
* @param allowOversized - Replace the `s < Fn.ORDER` scalar check with a `Fn.ORDER^4` DoS cap.
* Off by default. For scalars that must NOT be reduced mod ORDER: torsion checks
* (`Fn.ORDER⋅P ≟ O`) and cofactor-clearing multiples. Walk length grows with `bitLen(s)`.
* @returns Combined multiplication result; identity for empty input.
* @throws If the point set or scalar set is invalid. {@link Error}
* @example
* Endomorphism-specific multiplication for Koblitz curves.
* Combined multi-scalar multiplication via Strauss–Shamir.
*
* ```ts
* import { mulEndoUnsafe } from '@noble/curves/abstract/curve.js';
* import { secp256k1 } from '@noble/curves/secp256k1.js';
* const parts = mulEndoUnsafe(secp256k1.Point, secp256k1.Point.BASE, 3n, 5n);
* import { mulAddUnsafe } from '@noble/curves/abstract/curve.js';
* import { p256 } from '@noble/curves/nist.js';
* const G = p256.Point.BASE;
* const R = mulAddUnsafe(p256.Point, [G, G.double()], [2n, 3n]); // 2⋅G + 3⋅(2⋅G)
* ```
*/
export function mulEndoUnsafe<P extends CurvePoint<any, P>, PC extends CurvePointCons<P>>(
Point: PC,
point: P,
k1: bigint,
k2: bigint
): { p1: P; p2: P } {
let acc = point;
let p1 = Point.ZERO;
let p2 = Point.ZERO;
while (k1 > _0n || k2 > _0n) {
if (k1 & _1n) p1 = p1.add(acc);
if (k2 & _1n) p2 = p2.add(acc);
acc = acc.double();
k1 >>= _1n;
k2 >>= _1n;
}
return { p1, p2 };
export function mulAddUnsafe<P extends CurvePoint<any, P>, PC extends CurvePointCons<P>>(
c: PC,
points: P[],
scalars: bigint[],
allowOversized: boolean = false
): P {
validatePointCons(c);
validateMSMPoints(points, c);
abool(allowOversized, 'allowOversized');
// Oversized cap is ORDER^4: hard bound to mitigate DoS, walk length grows with bitLen(s).
validateMSMScalars(scalars, c.Fn, allowOversized ? c.Fn.ORDER ** _4n : undefined);
if (points.length !== scalars.length)
throw new Error('arrays of points and scalars must have equal length');
const tables = points.map((p) => oddMultiples(p, 4));
const digits = scalars.map((n) => wnafDigits(n, 4));
return wnafWalk(c.ZERO, tables, digits);
}

@@ -653,3 +852,9 @@

* For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL.
* Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0.
* Point-operation count is scalar-independent (for same L), even when 1 point + scalar, or when
* scalar = 0 — but bucket indices are scalar windows, so the memory-access pattern is
* scalar-dependent: do not rely on this for secret scalars.
*
* A repaired LFG bucket-set variant from ePrint 2024/750 was benchmarked on BLS12-381 G1
* against this implementation: ~1.4x faster at 2048 points and ~1.1-1.25x faster at
* 4096-32768 points, at the cost of extra recoding and multiplier-table complexity.
* @param c - Curve Point constructor

@@ -674,8 +879,4 @@ * @param points - array of L curve points

): P {
// If we split scalars by some window (let's say 8 bits), every chunk will only
// take 256 buckets even if there are 4096 scalars, also re-uses double.
// TODO:
// - https://eprint.iacr.org/2024/750.pdf
// - https://tches.iacr.org/index.php/TCHES/article/view/10287
// 0 is accepted in scalars
validatePointCons(c);
const fieldN = c.Fn;

@@ -687,4 +888,5 @@ validateMSMPoints(points, c);

if (plength !== slength) throw new Error('arrays of points and scalars must have equal length');
// if (plength === 0) throw new Error('array must be of length >= 2');
const zero = c.ZERO;
// Without this, the window loop below would still run ~Fn.BITS doublings of ZERO.
if (plength === 0) return zero as P;
const wbits = bitLen(BigInt(plength));

@@ -718,20 +920,33 @@ let windowSize = 1; // bits

/**
* Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
* Interleaved wNAF multi-scalar multiplication (MSM, Pa + Qb + Rc + ...) over a FIXED set
* of points: each point gets a one-time table of odd multiples
* `[1P, 3P, ..., (2^(W−1)−1)P]`, and the returned closure evaluates MSMs against those
* tables. All scalars share one doubling chain (Straus 1964) — one doubling per scalar bit
* plus one signed table addition per nonzero width-W wNAF digit (density ~1/(W+1)) — the
* "interleaving" method of Möller, "Algorithms for multi-exponentiation" (SAC 2001).
*
* Table memory is `L⋅2^(W−2)` points, capped at ~2 GiB. Prefer this over {@link pippenger}
* when the same points are reused across many MSMs (fixed-base commitments etc.) and up to a
* few hundred points; prefer pippenger for one-shot MSMs or thousands of points, where
* bucketing beats per-point tables.
*
* Not constant-time (zero digits are skipped): public inputs only.
* @param c - Curve Point constructor
* @param points - array of L curve points
* @param windowSize - Precompute window size.
* @returns Function which multiplies points with scalars. The closure accepts
* `scalars.length <= points.length`, and omitted trailing scalars are treated as zero.
* @param points - array of L curve points, captured by the returned closure
* @param windowSize - window width W in bits, from 2 to Fn.BITS; also capped so the
* per-closure tables stay under ~2 GiB
* @returns Function which multiplies points with scalars. The closure accepts at most
* `points.length` scalars, and omitted trailing scalars are treated as zero.
* @throws If the point set or precompute window is invalid. {@link Error}
* @example
* Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
* Interleaved wNAF multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
*
* ```ts
* import { precomputeMSMUnsafe } from '@noble/curves/abstract/curve.js';
* import { interleavedMSMUnsafe } from '@noble/curves/abstract/curve.js';
* import { p256 } from '@noble/curves/nist.js';
* const msm = precomputeMSMUnsafe(p256.Point, [p256.Point.BASE], 4);
* const msm = interleavedMSMUnsafe(p256.Point, [p256.Point.BASE], 4);
* const point = msm([3n]);
* ```
*/
export function precomputeMSMUnsafe<P extends CurvePoint<any, P>, PC extends CurvePointCons<P>>(
export function interleavedMSMUnsafe<P extends CurvePoint<any, P>, PC extends CurvePointCons<P>>(
c: PC,

@@ -741,69 +956,18 @@ points: P[],

): (scalars: bigint[]) => P {
/**
* Performance Analysis of Window-based Precomputation
*
* Base Case (256-bit scalar, 8-bit window):
* - Standard precomputation requires:
* - 31 additions per scalar × 256 scalars = 7,936 ops
* - Plus 255 summary additions = 8,191 total ops
* Note: Summary additions can be optimized via accumulator
*
* Chunked Precomputation Analysis:
* - Using 32 chunks requires:
* - 255 additions per chunk
* - 256 doublings
* - Total: (255 × 32) + 256 = 8,416 ops
*
* Memory Usage Comparison:
* Window Size | Standard Points | Chunked Points
* ------------|-----------------|---------------
* 4-bit | 520 | 15
* 8-bit | 4,224 | 255
* 10-bit | 13,824 | 1,023
* 16-bit | 557,056 | 65,535
*
* Key Advantages:
* 1. Enables larger window sizes due to reduced memory overhead
* 2. More efficient for smaller scalar counts:
* - 16 chunks: (16 × 255) + 256 = 4,336 ops
* - ~2x faster than standard 8,191 ops
*
* Limitations:
* - Not suitable for plain precomputes (requires 256 constant doublings)
* - Performance degrades with larger scalar counts:
* - Optimal for ~256 scalars
* - Less efficient for 4096+ scalars (Pippenger preferred)
*/
validatePointCons(c);
const fieldN = c.Fn;
validateW(windowSize, fieldN.BITS);
// Signed odd digits need at least width 2 (W=2 is plain NAF with a single-entry table).
validateW(windowSize, fieldN.BITS, 2);
validateMSMPoints(points, c);
const zero = c.ZERO;
const tableSize = 2 ** windowSize - 1; // table size (without zero)
const chunks = Math.ceil(fieldN.BITS / windowSize); // chunks of item
const MASK = bitMask(windowSize);
const tables = points.map((p: P) => {
const res = [];
for (let i = 0, acc = p; i < tableSize; i++) {
res.push(acc);
acc = acc.add(p);
}
return res;
});
validateTableBytes(points.length * 2 ** (windowSize - 2), c.Fp.BYTES);
const tables = points.map((p) => oddMultiples(p, 2 ** (windowSize - 2)));
return (scalars: bigint[]): P => {
validateMSMScalars(scalars, fieldN);
if (scalars.length > points.length)
throw new Error('array of scalars must be smaller than array of points');
let res = zero;
for (let i = 0; i < chunks; i++) {
// No need to double if accumulator is still zero.
if (res !== zero) for (let j = 0; j < windowSize; j++) res = res.double();
const shiftBy = BigInt(chunks * windowSize - (i + 1) * windowSize);
for (let j = 0; j < scalars.length; j++) {
const n = scalars[j];
const curr = Number((n >> shiftBy) & MASK);
if (!curr) continue; // skip zero scalars chunks
res = res.add(tables[j][curr - 1]);
}
}
return res;
throw new Error('array of scalars must not be larger than array of points');
return wnafWalk(
c.ZERO,
tables,
scalars.map((n) => wnafDigits(n, windowSize))
);
};

@@ -858,3 +1022,3 @@ }

* @param CURVE - Curve parameters.
* @param curveOpts - Optional field overrides:
* @param curveOpts - Optional field overrides. See {@link FpFn}:
* - `Fp` (optional): Optional base-field override.

@@ -886,8 +1050,11 @@ * - `Fn` (optional): Optional scalar-field override.

): TRet<FpFn<T> & { CURVE: ValidCurveParams<T> }> {
if (type !== 'weierstrass' && type !== 'edwards')
throw new Error('expected curve type "weierstrass" or "edwards"');
if (FpFnLE === undefined) FpFnLE = type === 'edwards';
if (!CURVE || typeof CURVE !== 'object') throw new Error(`expected valid ${type} CURVE object`);
// Validate before reading Fp/Fn so explicit null fails with an options-object error.
validateObject(curveOpts);
for (const p of ['p', 'n', 'h'] as const) {
const val = CURVE[p];
if (!(typeof val === 'bigint' && val > _0n))
throw new Error(`CURVE.${p} must be positive bigint`);
if (!(isPosBig(val) && val !== _0n)) throw new Error(`CURVE.${p} must be positive bigint`);
}

@@ -907,6 +1074,3 @@ const Fp = createField(CURVE.p, curveOpts.Fp, FpFnLE);

type KeygenFn = (
seed?: Uint8Array,
isCompressed?: boolean
) => { secretKey: Uint8Array; publicKey: Uint8Array };
type KeygenFn = (seed?: Uint8Array) => { secretKey: Uint8Array; publicKey: Uint8Array };
/**

@@ -913,0 +1077,0 @@ * @param randomSecretKey - Secret-key generator.

@@ -31,3 +31,4 @@ /**

normalizeZ,
wNAF,
ScalarMultiplier,
validatePointCons,
type AffinePoint,

@@ -38,7 +39,7 @@ type CurveLengths,

} from './curve.ts';
import { type IField } from './modular.ts';
import { FpLegendre, type IField } from './modular.ts';
// Be friendly to bad ECMAScript parsers by not using bigint literals
// prettier-ignore
const _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _8n = /* @__PURE__ */ BigInt(8);
const _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _4n = /* @__PURE__ */ BigInt(4), _8n = /* @__PURE__ */ BigInt(8);

@@ -125,2 +126,4 @@ /** Extended Edwards point with X/Y/Z/T coordinates. */

uvRatio: (u: bigint, v: bigint) => { isValid: boolean; value: bigint };
/** RNG override used for scalar blinding. */
randomBytes: (bytesLength?: number) => TRet<Uint8Array>;
}>;

@@ -145,2 +148,6 @@

mapToCurve: (scalar: bigint[]) => AffinePoint<bigint>;
/** Optional conversion from this Edwards curve to a birational/isogenous Montgomery curve. */
toMontgomery: (point: EdwardsPoint) => TRet<Uint8Array>;
/** Optional secret-key conversion for the same Montgomery curve as `toMontgomery`. */
toMontgomerySecret: (secretKey: TArg<Uint8Array>) => TRet<Uint8Array>;
/** Optional prehash function used before signing or verifying messages. */

@@ -192,2 +199,4 @@ prehash: FHash;

* - `zip215` (optional): Whether to accept ZIP-215 encodings.
* @throws Malformed argument or option types may throw; `false` means well-formed inputs
* failed verification. {@link Error}
* @returns Whether the signature is valid.

@@ -217,2 +226,3 @@ */

* Converts ed public key to x public key.
* Throws when the Edwards curve has no supported Montgomery conversion.
*

@@ -237,2 +247,3 @@ * There is NO `fromMontgomery`:

* Converts ed secret key to x secret key.
* Throws when the Edwards curve has no supported Montgomery conversion.
* @example

@@ -280,3 +291,3 @@ * Converts ed secret key to x secret key.

* validation here adds about 10-15ms to heavyweight imports like ed448.
* The returned constructor also eagerly marks `Point.BASE` for W=8
* The returned constructor also eagerly marks `Point.BASE` for W=6
* precompute caching. Some code paths still assume

@@ -298,2 +309,3 @@ * `Fp.BYTES === Fn.BYTES`, so mismatched byte lengths are not fully audited here.

): EdwardsPointCons {
validateObject(extraOpts as any, {}, {}, 'extraOpts');
const opts = extraOpts as EdwardsExtraOpts;

@@ -304,11 +316,22 @@ const validated = createCurveFields('edwards', params as EdwardsOpts, opts, opts.FpFnLE);

const { h: cofactor } = CURVE;
validateObject(opts, {}, { uvRatio: 'function' });
// The unified add-2008-hwcd formulas (see EdwardsPoint.add/double) are complete —
// exception-free for every input pair — only when a is a square and d a non-square in Fp
// (Bernstein–Birkner–Joye–Lange–Peters, "Twisted Edwards curves", thm 3.3). The constant-time
// kernels in curve.ts assume completeness, so an incomplete curve could silently produce
// wrong results on exceptional inputs. Fail construction instead.
if (FpLegendre(Fp, CURVE.a) !== 1)
throw new Error('edwards: CURVE.a must be a square in Fp for complete addition formulas');
if (FpLegendre(Fp, CURVE.d) !== -1)
throw new Error('edwards: CURVE.d must be a non-square in Fp for complete addition formulas');
validateObject(opts, {}, { uvRatio: 'function', randomBytes: 'function' });
const randomBytes = opts.randomBytes === undefined ? wcRandomBytes : opts.randomBytes;
// Important:
// There are some places where Fp.BYTES is used instead of nByteLength.
// So far, everything has been tested with curves of Fp.BYTES == nByteLength.
// TODO: test and find curves which behave otherwise.
const MASK = _2n << (BigInt(Fn.BYTES * 8) - _1n);
const modP = (n: bigint) => Fp.create(n); // Function overrides
// Coordinate and ZIP-215 bounds follow the base-field byte container, not scalar bytes.
const MASK = _2n << (BigInt(Fp.BYTES * 8) - _1n);
function isOdd(n: bigint): boolean {
if (!Fp.isOdd) throw new Error('Field does not have .isOdd()');
return Fp.isOdd(n);
}
// sqrt(u/v)

@@ -331,2 +354,10 @@ const uvRatio =

// Multiplication by param `a` sits on the double() / add() hot paths. For the common twists
// a=-1 (ed25519, jubjub) and a=1 (ed448) the full field multiplication is replaced with
// negation / identity. Selection depends only on public curve constants.
const mulA =
Fp.eql(CURVE.a, Fp.neg(Fp.ONE)) ? (x: bigint): bigint => Fp.neg(x)
: Fp.eql(CURVE.a, Fp.ONE) ? (x: bigint): bigint => x
: (x: bigint): bigint => Fp.mul(CURVE.a, x); // prettier-ignore
/**

@@ -349,9 +380,5 @@ * Asserts coordinate is valid: 0 <= n < MASK.

class Point implements EdwardsPoint {
// base / generator point
static readonly BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy));
// zero / infinity / identity point
static readonly ZERO = new Point(_0n, _1n, _1n, _0n); // 0, 1, 1, 0
// math field
static readonly BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE, Fp.mul(CURVE.Gx, CURVE.Gy));
static readonly ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ONE, Fp.ZERO);
static readonly Fp = Fp;
// scalar field
static readonly Fn = Fn;

@@ -386,3 +413,3 @@

acoord('y', y);
return new Point(x, y, _1n, modP(x * y));
return new Point(x, y, Fp.ONE, Fp.mul(x, y));
}

@@ -410,13 +437,13 @@

// ax²+y²=1+dx²y² => y²-1=dx²y²-ax² => y²-1=x²(dy²-a) => x²=(y²-1)/(dy²-a)
const y2 = modP(y * y); // denominator is always non-0 mod p.
const u = modP(y2 - _1n); // u = y² - 1
const v = modP(d * y2 - a); // v = d y² + 1.
const y2 = Fp.sqr(y); // denominator is always non-0 mod p.
const u = Fp.sub(y2, Fp.ONE); // u = y² - 1
const v = Fp.sub(Fp.mulN(d, y2), a); // v = d y² - a.
let { isValid, value: x } = uvRatio(u, v); // √(u/v)
if (!isValid) throw new Error('bad point: invalid y coordinate');
const isXOdd = (x & _1n) === _1n; // There are 2 square roots. Use x_0 bit to select proper
const isXOdd = isOdd(x); // There are 2 square roots. Use x_0 bit to select proper
const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit
if (!zip215 && x === _0n && isLastByteOdd)
if (!zip215 && Fp.is0(x) && isLastByteOdd)
// if x=0 and x_0 = 1, fail
throw new Error('bad point: x=0 and x_0=1');
if (isLastByteOdd !== isXOdd) x = modP(-x); // if x_0 != x mod 2, set x = p-x
if (isLastByteOdd !== isXOdd) x = Fp.neg(x); // if x_0 != x mod 2, set x = p-x
return Point.fromAffine({ x, y });

@@ -436,4 +463,4 @@ }

precompute(windowSize: number = 8, isLazy = true) {
wnaf.createCache(this, windowSize);
precompute(windowSize: number = 6, isLazy = true) {
wnaf.setWindowSize(this, windowSize);
if (!isLazy) this.multiply(_2n); // random number

@@ -455,14 +482,14 @@ return this;

const { X, Y, Z, T } = p;
const X2 = modP(X * X); // X²
const Y2 = modP(Y * Y); // Y²
const Z2 = modP(Z * Z); // Z²
const Z4 = modP(Z2 * Z2); // Z⁴
const aX2 = modP(X2 * a); // aX²
const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z²
const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y²
if (left !== right) throw new Error('bad point: equation left != right (1)');
const X2 = Fp.sqr(X); // X²
const Y2 = Fp.sqr(Y); // Y²
const Z2 = Fp.sqr(Z); // Z²
const Z4 = Fp.sqr(Z2); // Z⁴
const aX2 = Fp.mul(X2, a); // aX²
const left = Fp.mul(Fp.add(aX2, Y2), Z2); // (aX² + Y²)Z²
const right = Fp.add(Z4, Fp.mul(d, Fp.mul(X2, Y2))); // Z⁴ + dX²Y²
if (!Fp.eql(left, right)) throw new Error('bad point: equation left != right (1)');
// In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T
const XY = modP(X * Y);
const ZT = modP(Z * T);
if (XY !== ZT) throw new Error('bad point: equation left != right (2)');
const XY = Fp.mul(X, Y);
const ZT = Fp.mul(Z, T);
if (!Fp.eql(XY, ZT)) throw new Error('bad point: equation left != right (2)');
}

@@ -475,7 +502,7 @@

const { X: X2, Y: Y2, Z: Z2 } = other;
const X1Z2 = modP(X1 * Z2);
const X2Z1 = modP(X2 * Z1);
const Y1Z2 = modP(Y1 * Z2);
const Y2Z1 = modP(Y2 * Z1);
return X1Z2 === X2Z1 && Y1Z2 === Y2Z1;
const X1Z2 = Fp.mul(X1, Z2);
const X2Z1 = Fp.mul(X2, Z1);
const Y1Z2 = Fp.mul(Y1, Z2);
const Y2Z1 = Fp.mul(Y2, Z1);
return Fp.eql(X1Z2, X2Z1) && Fp.eql(Y1Z2, Y2Z1);
}

@@ -489,3 +516,3 @@

// Flips point sign to a negative one (-x, y in affine coords)
return new Point(modP(-this.X), this.Y, this.Z, modP(-this.T));
return new Point(Fp.neg(this.X), this.Y, this.Z, Fp.neg(this.T));
}

@@ -497,17 +524,16 @@

double(): Point {
const { a } = CURVE;
const { X: X1, Y: Y1, Z: Z1 } = this;
const A = modP(X1 * X1); // A = X12
const B = modP(Y1 * Y1); // B = Y12
const C = modP(_2n * modP(Z1 * Z1)); // C = 2*Z12
const D = modP(a * A); // D = a*A
const x1y1 = X1 + Y1;
const E = modP(modP(x1y1 * x1y1) - A - B); // E = (X1+Y1)2-A-B
const G = D + B; // G = D+B
const F = G - C; // F = G-C
const H = D - B; // H = D-B
const X3 = modP(E * F); // X3 = E*F
const Y3 = modP(G * H); // Y3 = G*H
const T3 = modP(E * H); // T3 = E*H
const Z3 = modP(F * G); // Z3 = F*G
const A = Fp.sqr(X1); // A = X12
const B = Fp.sqr(Y1); // B = Y12
const C = Fp.mul(Fp.sqr(Z1), _2n); // C = 2*Z12
const D = mulA(A); // D = a*A
const x1y1 = Fp.addN(X1, Y1);
const E = Fp.sub(Fp.subN(Fp.sqr(x1y1), A), B); // E = (X1+Y1)2-A-B
const G = Fp.addN(D, B); // G = D+B
const F = Fp.subN(G, C); // F = G-C
const H = Fp.subN(D, B); // H = D-B
const X3 = Fp.mul(E, F); // X3 = E*F
const Y3 = Fp.mul(G, H); // Y3 = G*H
const T3 = Fp.mul(E, H); // T3 = E*H
const Z3 = Fp.mul(F, G); // Z3 = F*G
return new Point(X3, Y3, Z3, T3);

@@ -521,17 +547,18 @@ }

aedpoint(other);
const { a, d } = CURVE;
const { d } = CURVE;
const { X: X1, Y: Y1, Z: Z1, T: T1 } = this;
const { X: X2, Y: Y2, Z: Z2, T: T2 } = other;
const A = modP(X1 * X2); // A = X1*X2
const B = modP(Y1 * Y2); // B = Y1*Y2
const C = modP(T1 * d * T2); // C = T1*d*T2
const D = modP(Z1 * Z2); // D = Z1*Z2
const E = modP((X1 + Y1) * (X2 + Y2) - A - B); // E = (X1+Y1)*(X2+Y2)-A-B
const F = D - C; // F = D-C
const G = D + C; // G = D+C
const H = modP(B - a * A); // H = B-a*A
const X3 = modP(E * F); // X3 = E*F
const Y3 = modP(G * H); // Y3 = G*H
const T3 = modP(E * H); // T3 = E*H
const Z3 = modP(F * G); // Z3 = F*G
const A = Fp.mul(X1, X2); // A = X1*X2
const B = Fp.mul(Y1, Y2); // B = Y1*Y2
const C = Fp.mul(Fp.mulN(T1, d), T2); // C = T1*d*T2
const D = Fp.mul(Z1, Z2); // D = Z1*Z2
// E = (X1+Y1)*(X2+Y2)-A-B
const E = Fp.sub(Fp.subN(Fp.mulN(Fp.addN(X1, Y1), Fp.addN(X2, Y2)), A), B);
const F = Fp.subN(D, C); // F = D-C
const G = Fp.addN(D, C); // G = D+C
const H = Fp.sub(B, mulA(A)); // H = B-a*A
const X3 = Fp.mul(E, F); // X3 = E*F
const Y3 = Fp.mul(G, H); // Y3 = G*H
const T3 = Fp.mul(E, H); // T3 = E*H
const Z3 = Fp.mul(F, G); // Z3 = F*G
return new Point(X3, Y3, Z3, T3);

@@ -555,4 +582,4 @@ }

throw new RangeError('invalid scalar: expected 1 <= sc < curve.n');
const { p, f } = wnaf.cached(this, scalar, (p) => normalizeZ(Point, p));
return normalizeZ(Point, [p, f])[0];
const { p, f } = wnaf.mulSecret(this, scalar, cofactor, normalize);
return normalize([p, f])[0];
}

@@ -570,3 +597,3 @@

if (this.is0() || scalar === _1n) return this;
return wnaf.unsafe(this, scalar, (p) => normalizeZ(Point, p));
return wnaf.mulUnsafe(this, scalar, normalize);
}

@@ -585,3 +612,3 @@

isTorsionFree(): boolean {
return wnaf.unsafe(this, CURVE.n).is0();
return wnaf.mulUnsafe(this, CURVE.n).is0();
}

@@ -594,10 +621,12 @@

let iz = invertedZ;
if (iz != null && typeof iz !== 'bigint')
throw new TypeError('"invertedZ" expected bigint, got type=' + typeof iz);
const { X, Y, Z } = p;
const is0 = p.is0();
if (iz == null) iz = is0 ? _8n : (Fp.inv(Z) as bigint); // 8 was chosen arbitrarily
const x = modP(X * iz);
const y = modP(Y * iz);
if (iz == null) iz = is0 ? Fp.create(_8n) : (Fp.inv(Z) as bigint);
const x = Fp.mul(X, iz);
const y = Fp.mul(Y, iz);
const zz = Fp.mul(Z, iz);
if (is0) return { x: _0n, y: _1n };
if (zz !== _1n) throw new Error('invZ was invalid');
if (is0) return { x: Fp.ZERO, y: Fp.ONE };
if (!Fp.eql(zz, Fp.ONE)) throw new Error('invZ was invalid');
return { x, y };

@@ -608,2 +637,6 @@ }

if (cofactor === _1n) return this;
// 2.8-3.8x speed-up vs naive
if (cofactor === _2n) return this.double();
if (cofactor === _4n) return this.double().double();
if (cofactor === _8n) return this.double().double().double();
return this.multiplyUnsafe(cofactor);

@@ -618,3 +651,3 @@ }

// When compressing, it's enough to store y and use the last byte to encode sign of x
bytes[bytes.length - 1] |= x & _1n ? 0x80 : 0;
bytes[bytes.length - 1] |= isOdd(x) ? 0x80 : 0;
return bytes;

@@ -630,3 +663,2 @@ }

}
const wnaf = new wNAF(Point, Fn.BITS);
// Keep constructor work cheap: subgroup/generator validation belongs to the caller's curve

@@ -641,5 +673,7 @@ // parameters, and doing the extra checks here adds about 10-15ms to heavy module imports.

// }
// Tiny toy curves can have scalar fields narrower than 8 bits. Skip the
// eager W=8 cache there instead of rejecting an otherwise valid constructor.
if (Fn.BITS >= 8) Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms.
const normalize = (points: TArg<Point[]>) => normalizeZ(Point, points);
const wnaf = new ScalarMultiplier(Point, randomBytes);
// Enable W=6 wNAF precomputes. Slows down first publicKey computation.
// Disable for tiny toy curves, with scalar fields < 6 bits.
if (wnaf.bits >= 6) Point.BASE.precompute(6);
Object.freeze(Point.prototype);

@@ -811,2 +845,3 @@ Object.freeze(Point);

): EdDSA {
validatePointCons(Point);
if (typeof cHash !== 'function') throw new Error('"hash" function param is required');

@@ -825,2 +860,4 @@ const hash = cHash as FHash;

mapToCurve: 'function',
toMontgomery: 'function',
toMontgomerySecret: 'function',
}

@@ -842,2 +879,4 @@ );

const randomBytes = opts.randomBytes === undefined ? wcRandomBytes : opts.randomBytes;
const toMontgomery = opts.toMontgomery;
const toMontgomerySecret = opts.toMontgomerySecret;
const adjustScalarBytes =

@@ -905,2 +944,3 @@ opts.adjustScalarBytes === undefined

): TRet<Uint8Array> {
validateObject(options as any, {}, {}, 'options');
msg = abytes(msg, undefined, 'message');

@@ -938,2 +978,4 @@ if (prehash) msg = prehash(msg); // for ed25519ph etc.

): boolean {
// Validate before destructuring so explicit null follows the standard options error.
validateObject(options);
// Preserve the wrapper-selected default for `{}` / `{ zip215: undefined }`, not just omitted opts.

@@ -1010,24 +1052,12 @@ const { context } = options;

isValidPublicKey,
/**
* Converts ed public key to x public key. Uses formula:
* - ed25519:
* - `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)`
* - `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))`
* - ed448:
* - `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)`
* - `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))`
*/
/** Converts an Edwards public key to a companion Montgomery public key. */
toMontgomery(publicKey: TArg<Uint8Array>): TRet<Uint8Array> {
const { y } = Point.fromBytes(publicKey);
const size = lengths.publicKey;
const is25519 = size === 32;
if (!is25519 && size !== 57) throw new Error('only defined for 25519 and 448');
const u = is25519 ? Fp.div(_1n + y, _1n - y) : Fp.div(y - _1n, y + _1n);
return Fp.toBytes(u) as TRet<Uint8Array>;
if (toMontgomery === undefined)
throw new Error('Montgomery conversion is not supported for this curve');
return toMontgomery(Point.fromBytes(publicKey));
},
toMontgomerySecret(secretKey: TArg<Uint8Array>): TRet<Uint8Array> {
const size = lengths.secretKey;
abytes(secretKey, size);
const hashed = hash(secretKey.subarray(0, size));
return adjustScalarBytes(hashed).subarray(0, size) as TRet<Uint8Array>;
if (toMontgomerySecret === undefined)
throw new Error('Montgomery conversion is not supported for this curve');
return toMontgomerySecret(secretKey);
},

@@ -1034,0 +1064,0 @@ };

@@ -6,4 +6,4 @@ /**

*/
import type { TArg } from '../utils.ts';
import type { IField } from './modular.ts';
import { aarray, validateObject, type TArg } from '../utils.ts';
import { validateField, type IField } from './modular.ts';

@@ -37,6 +37,8 @@ /** Array-like coefficient storage that can be mutated in place. */

function checkU32(n: number) {
function checkU32(n: number, title = 'n') {
// 0xff_ff_ff_ff
if (typeof n !== 'number')
throw new TypeError(`wrong u32 integer "${title}": expected number, got type=${typeof n}`);
if (!Number.isSafeInteger(n) || n < 0 || n > 0xffffffff)
throw new Error('wrong u32 integer:' + n);
throw new RangeError(`wrong u32 integer "${title}": expected 0..4294967295, got ${n}`);
return n;

@@ -49,3 +51,2 @@ }

* @returns `true` when the value is a power of two.
* @throws If `x` is not a valid unsigned 32-bit integer. {@link Error}
* @example

@@ -59,3 +60,3 @@ * Validate that an FFT size is a power of two.

export function isPowerOfTwo(x: number): boolean {
checkU32(x);
checkU32(x, 'x');
return (x & (x - 1)) === 0 && x !== 0;

@@ -98,2 +99,4 @@ }

checkU32(n);
if (typeof bits !== 'number')
throw new TypeError('"bits" expected number, got type=' + typeof bits);
if (!Number.isSafeInteger(bits) || bits < 0 || bits > 32)

@@ -111,3 +114,2 @@ throw new Error(`expected integer 0 <= bits <= 32, got ${bits}`);

* @returns Base-2 logarithm. For `n = 0`, the current implementation returns `-1`.
* @throws If `n` is not a valid unsigned 32-bit integer. {@link Error}
* @example

@@ -141,2 +143,8 @@ * Compute the radix-2 stage count for one transform size.

export function bitReversalInplace<T extends MutableArrayLike<any>>(values: T): T {
if (
!values ||
typeof values !== 'object' ||
typeof (values as MutableArrayLike<any>).length !== 'number'
)
throw new TypeError('"values" expected array-like, got type=' + typeof values);
const n = values.length;

@@ -169,2 +177,3 @@ // Size-1 FFT is the identity, so bit-reversal must stay a no-op there instead of rejecting it.

export function bitReversalPermutation<T>(values: T[]): T[] {
aarray(values, 'values');
return bitReversalInplace(values.slice()) as T[];

@@ -215,5 +224,5 @@ }

/**
* We limit roots up to 2**31, which is a lot: 2-billion polynomimal should be rare.
* We limit roots up to 2**31, which is a lot: 2-billion polynomial should be rare.
* @param field - Field implementation.
* @param generator - Optional generator override.
* @param generator - Optional trusted non-quadratic-residue override for callers that already know the field.
* @returns Roots-of-unity cache.

@@ -231,2 +240,5 @@ * @example

export function rootsOfUnity(field: TArg<IField<bigint>>, generator?: bigint): RootsOfUnity {
validateField(field);
if (generator !== undefined && typeof generator !== 'bigint')
throw new TypeError('"generator" expected bigint, got type=' + typeof generator);
// Factor field.ORDER-1 as oddFactor * 2^powerOfTwo

@@ -246,3 +258,3 @@ let oddFactor = field.ORDER - _1n;

const checkBits = (bits: number) => {
checkU32(bits);
checkU32(bits, 'bits');
if (bits > 31 || bits > powerOfTwo)

@@ -256,5 +268,12 @@ throw new Error('rootsOfUnity: wrong bits ' + bits + ' powerOfTwo=' + powerOfTwo);

if (rootsCache[power]) continue; // Skip if we've already computed roots for this power
const above = rootsCache[power + 1];
const rootsAtPower: bigint[] = [];
for (let j = 0, cur = field.ONE; j < 2 ** power; j++, cur = field.mul(cur, omegas[power]))
rootsAtPower.push(cur);
if (above) {
// ω_{2^p} = ω_{2^{p+1}}², so the smaller table is the even-index stride of the bigger
// one: only the largest requested power pays for the multiplication chain.
for (let j = 0; j < 2 ** power; j++) rootsAtPower.push(above[2 * j]);
} else {
for (let j = 0, cur = field.ONE; j < 2 ** power; j++, cur = field.mul(cur, omegas[power]))
rootsAtPower.push(cur);
}
rootsCache[power] = rootsAtPower;

@@ -269,3 +288,3 @@ }

// NOTE: we use bits instead of power, because power = 2**bits,
// but power is not neccesary isPowerOfTwo(power)!
// but power is not necessarily isPowerOfTwo(power)!
return {

@@ -290,3 +309,6 @@ info: { G, powerOfTwo, oddFactor },

else {
const res = field.invertBatch(this.roots(b));
// ωᴺ = 1, so inv(ωᵏ) = ωᴺ⁻ᵏ: the inverse table is the reversed roots table.
// Value-identical to field.invertBatch(roots), but skips its 3N muls + inversion.
const r = this.roots(b);
const res = [r[0]].concat(r.slice(1).reverse());
inverseCache.set(b, res);

@@ -372,3 +394,3 @@ return res;

*
* - DIT (Decimation-in-Time): Bottom-Up (leaves to root), Cool-Turkey
* - DIT (Decimation-in-Time): Bottom-Up (leaves to root), Cooley-Tukey
* - DIF (Decimation-in-Frequency): Top-Down (root to leaves), Gentleman-Sande

@@ -385,4 +407,12 @@ *

* Negacyclic NTT: Rq = Zq[x]/(x^n+1). butterfly_DIT+loop_DIF, at least for mlkem / mldsa
*
* `invertButterflies` indexes roots by a per-butterfly-group counter (`grp`): forward
* (`dit: false`) reads `roots[grp]` with grp = 1..; inverse (`dit: true`) reads `roots[N - grp]`
* with grp restarting at 1. With `skipStages: 0` one table serves both directions (ωᴺ = 1 makes
* the reversed walk self-inverse). With `skipStages > 0` the inverse walk starts at `N - 1`
* instead of continuing where the skipped stages would have left off, so the caller must supply
* a table shaped for that (ML-KEM: `ζ^BitRev7(i)` over all N=256 indices, whose aliased upper
* half is exactly the FIPS 203 inverse walk).
* @param F - Field operations.
* @param coreOpts - FFT configuration:
* @param coreOpts - FFT configuration. See {@link FFTCoreOpts}:
* - `N`: Transform size. Must be a power of two.

@@ -409,5 +439,17 @@ * - `roots`: Stage roots for the selected transform size.

export const FFTCore = <T, R>(F: FFTOpts<T, R>, coreOpts: FFTCoreOpts<R>): FFTCoreLoop<T> => {
validateObject(
coreOpts as unknown as Record<string, any>,
{ N: 'number', roots: 'object', dit: 'boolean' },
{ invertButterflies: 'boolean', skipStages: 'number', brp: 'boolean' },
'coreOpts'
);
const { N, roots, dit, invertButterflies = false, skipStages = 0, brp = true } = coreOpts;
checkU32(N, 'coreOpts.N');
const bits = log2(N);
if (!isPowerOfTwo(N)) throw new Error('FFT: Polynomial size should be power of two');
checkU32(skipStages, 'coreOpts.skipStages');
const maxSkipStages = bits === 0 ? 0 : bits - 1;
// Skipping every stage leaves only boundary layout changes, not a valid FFT loop shape.
if (skipStages > maxSkipStages)
throw new Error(`FFT: wrong skipStages: expected 0 <= skipStages <= ${maxSkipStages}`);
// Wrong-sized root tables can stay in-bounds for some loop shapes and silently compute nonsense.

@@ -417,3 +459,2 @@ if (roots.length !== N)

const isDit = dit !== invertButterflies;
isDit;
return <P extends Polynomial<T>>(values: P): P => {

@@ -496,17 +537,29 @@ if (values.length !== N) throw new Error('FFT: wrong Polynomial length');

export function FFT<T>(roots: RootsOfUnity, opts: FFTOpts<T, bigint>): FFTMethods<T> {
// Loops are cached per (size, direction, brp flags): FFTCore construction validates options
// and allocates closures, which costs more than a small transform itself. The cached loop
// closes over the root table active at first use; `roots.clear()` rebuilds value-identical
// tables, so a stale reference stays correct.
const loops = new Map<number, FFTCoreLoop<T>>();
const getLoop = (
N: number,
roots: Polynomial<bigint>,
brpInput = false,
brpOutput = false
rootsTable: Polynomial<bigint>,
key: number
): (<P extends Polynomial<T>>(values: P) => P) => {
const cached = loops.get(key);
if (cached) return cached;
const brpInput = !!(key & 2);
const brpOutput = !!(key & 1);
let loop: FFTCoreLoop<T>;
if (brpInput && brpOutput) {
// we cannot optimize this case, but lets support it anyway
return (values) =>
FFTCore(opts, { N, roots, dit: false, brp: false })(bitReversalInplace(values));
}
if (brpInput) return FFTCore(opts, { N, roots, dit: true, brp: false });
if (brpOutput) return FFTCore(opts, { N, roots, dit: false, brp: false });
return FFTCore(opts, { N, roots, dit: true, brp: true }); // all natural
const core = FFTCore(opts, { N, roots: rootsTable, dit: false, brp: false });
loop = (values) => core(bitReversalInplace(values));
} else if (brpInput) loop = FFTCore(opts, { N, roots: rootsTable, dit: true, brp: false });
else if (brpOutput) loop = FFTCore(opts, { N, roots: rootsTable, dit: false, brp: false });
else loop = FFTCore(opts, { N, roots: rootsTable, dit: true, brp: true }); // all natural
loops.set(key, loop);
return loop;
};
const loopKey = (bits: number, isInverse: boolean, brpInput: boolean, brpOutput: boolean) =>
(bits << 3) | (isInverse ? 4 : 0) | (brpInput ? 2 : 0) | (brpOutput ? 1 : 0);
return {

@@ -517,3 +570,4 @@ direct<P extends Polynomial<T>>(values: P, brpInput = false, brpOutput = false): P {

const bits = log2(N);
return getLoop(N, roots.roots(bits), brpInput, brpOutput)<P>(values.slice());
const key = loopKey(bits, false, brpInput, brpOutput);
return getLoop(N, roots.roots(bits), key)<P>(values.slice());
},

@@ -524,3 +578,4 @@ inverse<P extends Polynomial<T>>(values: P, brpInput = false, brpOutput = false): P {

const bits = log2(N);
const res = getLoop(N, roots.inverse(bits), brpInput, brpOutput)(values.slice());
const key = loopKey(bits, true, brpInput, brpOutput);
const res = getLoop(N, roots.inverse(bits), key)(values.slice());
const ivm = opts.inv(BigInt(values.length)); // scale

@@ -697,2 +752,3 @@ // we can get brp output if we use dif instead of dit!

): PolyFn<any, T> {
validateField(field);
const F = field as IField<T>;

@@ -715,8 +771,13 @@ const _create =

};
const checkLength = (...lst: P[]): number => {
if (!lst.length) return 0;
for (const i of lst) if (!isPoly(i)) throw new Error('poly: not polynomial: ' + i);
const L = lst[0].length;
for (let i = 1; i < lst.length; i++)
if (lst[i].length !== L) throw new Error(`poly: mismatched lengths ${L} vs ${lst[i].length}`);
const checkPoly = (title: string, value: P): void => {
if (!isPoly(value))
throw new TypeError(`"${title}" expected polynomial, got type=${typeof value}`);
};
const checkLength = (a: P, b?: P): number => {
checkPoly('a', a);
const L = a.length;
if (b !== undefined) {
checkPoly('b', b);
if (b.length !== L) throw new Error(`poly: mismatched lengths ${L} vs ${b.length}`);
}
if (length !== undefined && L !== length)

@@ -726,5 +787,6 @@ throw new Error(`poly: expected fixed length ${length}, got ${L}`);

};
function findOmegaIndex(x: T, n: number, brp = false): number {
const bits = log2(n);
const omega = brp ? roots.brp(bits) : roots.roots(bits);
function findOmegaIndex(x: T, n: number, brp = false, weights?: P): number {
if (!isPowerOfTwo(n)) throw new Error('poly.lagrange: expected power of two length, got ' + n);
// Explicit weights define the interpolation domain, including the Kronecker-δ shortcut.
const omega = weights || (brp ? roots.brp(log2(n)) : roots.roots(log2(n)));
for (let i = 0; i < n; i++) if (F.eql(x, omega[i] as T)) return i;

@@ -795,2 +857,4 @@ return -1;

convolve(a: P, b: P): P {
checkPoly('a', a);
checkPoly('b', b);
const len = nextPowerOfTwo(a.length + b.length - 1);

@@ -800,3 +864,7 @@ return this.mul(this.extend(a, len), this.extend(b, len));

shift(p: P, factor: bigint): P {
const out = _create(checkLength(p));
checkPoly('p', p);
const out = _create(p.length);
if (length !== undefined && p.length !== length)
throw new Error(`poly: expected fixed length ${length}, got ${p.length}`);
if (!p.length) return out;
out[0] = p[0];

@@ -841,2 +909,4 @@ for (let i = 1, power = F.ONE; i < p.length; i++) {

basis: (x: T, n: number, brp = false, weights?: P): P => {
if (!isPowerOfTwo(n))
throw new Error('poly.lagrange: expected power of two length, got ' + n);
const bits = log2(n);

@@ -846,3 +916,3 @@ const cache = weights || (brp ? roots.brp(bits) : roots.roots(bits)); // [ω⁰, ω¹, ..., ωⁿ⁻¹]

// Fast Kronecker-δ shortcut
const idx = findOmegaIndex(x, n, brp);
const idx = findOmegaIndex(x, n, brp, weights);
if (idx !== -1) {

@@ -871,3 +941,5 @@ out[idx] = F.ONE;

vanishing(roots: P): P {
checkLength(roots);
checkPoly('roots', roots);
if (length !== undefined && roots.length !== length)
throw new Error(`poly: expected fixed length ${length}, got ${roots.length}`);
const out = _create(roots.length + 1, F.ZERO);

@@ -874,0 +946,0 @@ out[0] = F.ONE;

/**
* FROST: Flexible Round-Optimized Schnorr Threshold Protocol for Two-Round Schnorr Signatures.
*
* See [RFC 9591](https://datatracker.ietf.org/doc/rfc9591/) and [frost.zfnd.org](https://frost.zfnd.org).
* See {@link https://datatracker.ietf.org/doc/rfc9591/ | RFC 9591} and
* {@link https://frost.zfnd.org | frost.zfnd.org}.
* @module

@@ -9,2 +10,6 @@ */

import {
aarray,
abytes,
asafenumber,
astring,
bytesToHex,

@@ -20,3 +25,3 @@ bytesToNumberBE,

} from '../utils.ts';
import { pippenger, validatePointCons, type CurvePoint, type CurvePointCons } from './curve.ts';
import { mulAddUnsafe, validatePointCons, type CurvePoint, type CurvePointCons } from './curve.ts';
import { poly, type RootsOfUnity } from './fft.ts';

@@ -26,12 +31,26 @@ import { type H2CDSTOpts } from './hash-to-curve.ts';

/** Cryptographically secure random byte generator. */
export type RNG = typeof randomBytes;
export type Identifier = string; // Identifiers are hex to make comparison easier
export type Commitment = Uint8Array; // serialized point
export type Coefficient = Uint8Array; // serialized scalar
/** Serialized participant identifier. Identifiers are hex to make comparison easier. */
export type Identifier = string;
/** Serialized point commitment. */
export type Commitment = Uint8Array;
/** Serialized scalar coefficient. */
export type Coefficient = Uint8Array;
/** Serialized Schnorr signature. */
export type Signature = Uint8Array;
export type Signers = { min: number; max: number };
export type SecretKey = Uint8Array; // Secret key
/** Threshold participant counts. */
export type Signers = {
/** Minimum number of signers required to produce a signature. */
min: number;
/** Maximum number of participants in the key set. */
max: number;
};
/** Serialized secret key bytes. */
export type SecretKey = Uint8Array;
/** Byte array alias used by FROST public packages. */
export type Bytes = Uint8Array;
type Point = Uint8Array;
/** Public DKG round-1 broadcast plus proof of knowledge. */
export type DKG_Round1 = {

@@ -41,94 +60,249 @@ // If identifiers were assigned via fromNumber before, it is worth checking

// But we throw on duplicate identifiers.
/** Sender identifier. */
identifier: Identifier;
commitment: TRet<Commitment[]>; // sender identifier
/** VSS commitment points. */
commitment: TRet<Commitment[]>;
/** Signature proving knowledge of the sender's secret coefficient. */
proofOfKnowledge: TRet<Signature>;
};
/** Public DKG round-2 recipient share package. */
export type DKG_Round2 = {
identifier: Identifier; // sender identifier
/** Sender identifier. */
identifier: Identifier;
/** Signing share for one receiver. */
signingShare: TRet<Bytes>;
};
// This is internal, so we can use bigints
/** Internal mutable DKG state package. */
export type DKG_Secret = {
/** Local participant identifier as a scalar. */
identifier: bigint;
/** Local secret polynomial coefficients while DKG is in progress. */
coefficients?: bigint[];
/** Local VSS commitment points. */
commitment: TRet<Point[]>;
/** Threshold participant counts. */
signers: Signers;
// Keep the local polynomial until round3 succeeds so late DKG failures can be retried.
/** Cached round2 packages from the first successful round2 call. */
round2Cache?: Record<Identifier, DKG_Round2>;
/** Current DKG state-machine step. */
step?: 1 | 2 | 3;
};
/** Shared public FROST package for one key set. */
export type FrostPublic = {
/** Threshold participant counts. */
signers: Signers;
commitments: TRet<Bytes[]>; // Point[], where commitments[0] is the group public key
verifyingShares: TRet<Record<Identifier, Bytes>>; // id -> Point
/** Serialized commitment points; `commitments[0]` is the group public key. */
commitments: TRet<Bytes[]>;
/** Map from participant identifier to serialized verifying-share point. */
verifyingShares: TRet<Record<Identifier, Bytes>>;
};
/** Secret FROST share for one participant. */
export type FrostSecret = {
/** Participant identifier. */
identifier: Identifier;
signingShare: TRet<Bytes>; // Scalar
/** Serialized scalar signing share. */
signingShare: TRet<Bytes>;
};
export type Key = { public: FrostPublic; secret: FrostSecret };
/** Combined public and secret FROST packages for one participant. */
export type Key = {
/** Shared public package. */
public: FrostPublic;
/** Participant secret package. */
secret: FrostSecret;
};
/** Trusted-dealer output containing public data and all participant shares. */
export type DealerShares = {
/** Shared public package. */
public: FrostPublic;
/** Map from participant identifier to its secret share. */
secretShares: Record<Identifier, FrostSecret>;
};
// Sign stuff
/** Private nonce scalars used once during signing. */
export type Nonces = {
hiding: TRet<Bytes>; // Scalar
binding: TRet<Bytes>; // Scalar
/** Serialized hiding nonce scalar. */
hiding: TRet<Bytes>;
/** Serialized binding nonce scalar. */
binding: TRet<Bytes>;
};
/** Public nonce commitments broadcast for one signing attempt. */
export type NonceCommitments = {
/** Participant identifier. */
identifier: Identifier;
hiding: TRet<Bytes>; // Point
binding: TRet<Bytes>; // Point
/** Serialized hiding nonce point. */
hiding: TRet<Bytes>;
/** Serialized binding nonce point. */
binding: TRet<Bytes>;
};
/** Generated nonce package containing private nonces and public commitments. */
export type GenNonce = {
/** Private nonce scalars. */
nonces: Nonces;
/** Public nonce commitments. */
commitments: NonceCommitments;
};
/** Point interface required by the generic FROST implementation. */
export interface FROSTPoint<T extends CurvePoint<any, T>> extends CurvePoint<any, T> {
/**
* Adds another point.
* @param rhs - Point to add.
* @returns Point sum.
*/
add(rhs: T): T;
/**
* Multiplies by a scalar.
* @param rhs - Scalar multiplier.
* @returns Scalar multiplication result.
*/
multiply(rhs: bigint): T;
/**
* Compares two points.
* @param rhs - Point to compare.
* @returns Whether points are equal.
*/
equals(rhs: T): boolean;
/**
* Serializes a point.
* @param compressed - Whether to use compressed encoding.
* @returns Encoded point bytes.
*/
toBytes(compressed?: boolean): Bytes;
/**
* Clears the point cofactor.
* @returns Cofactor-cleared point.
*/
clearCofactor(): T;
}
/** Point constructor surface required by FROST. */
export interface FROSTPointConstructor<T extends FROSTPoint<T>> extends CurvePointCons<T> {
/**
* Parses a point from bytes.
* @param a - Encoded point bytes.
* @returns Parsed point.
*/
fromBytes(a: Bytes): T;
/** Scalar field used by the point group. */
Fn: IField<bigint>;
}
// Opts
/** Construction options for a concrete FROST ciphersuite. */
export type FrostOpts<P extends FROSTPoint<P>> = {
/** Ciphersuite name. */
readonly name: string;
/** Point constructor for the signing group. */
readonly Point: FROSTPointConstructor<P>;
/** Optional scalar-field override. */
readonly Fn?: IField<bigint>;
/** Optional suite hook that tightens canonical decoding with subgroup / identity checks. */
/**
* Optional suite hook that tightens canonical decoding with subgroup / identity checks.
* @param p - Point to validate.
*/
readonly validatePoint?: (p: P) => void;
/** Optional public-key parser. Implementations MUST preserve the same subgroup / identity policy
* as `validatePoint`, because this bypasses generic canonical decoding in `parsePoint()`. */
/**
* Optional public-key parser. Implementations MUST preserve the same subgroup / identity policy
* as `validatePoint`, because this bypasses generic canonical decoding in `parsePoint()`.
* @param bytes - Encoded public key.
* @returns Parsed public point.
*/
readonly parsePublicKey?: (bytes: TArg<Uint8Array>) => P;
/**
* Hash function used by the suite.
* @param msg - Message bytes to hash.
* @returns Hash output bytes.
*/
readonly hash: (msg: TArg<Uint8Array>) => TRet<Uint8Array>;
/** Custom scalar hash hook. Implementations MUST treat `msg` and `options` as read-only. */
/**
* Custom scalar hash hook. Implementations MUST treat `msg` and `options` as read-only.
* @param msg - Message bytes to hash.
* @param options - Hash-to-curve options. See {@link H2CDSTOpts}.
* @returns Scalar field element.
*/
readonly hashToScalar?: (msg: TArg<Uint8Array>, options?: TArg<H2CDSTOpts>) => bigint;
// Hacks for taproot support
/**
* Optional scalar adjustment hook.
* @param n - Scalar to adjust.
* @returns Adjusted scalar.
*/
readonly adjustScalar?: (n: bigint) => bigint;
/**
* Optional point adjustment hook.
* @param n - Point to adjust.
* @returns Adjusted point.
*/
readonly adjustPoint?: (n: P) => P;
/**
* Optional challenge override.
* @param R - Group commitment point.
* @param PK - Group public key point.
* @param msg - Message bytes.
* @returns Challenge scalar.
*/
readonly challenge?: (R: P, PK: P, msg: TArg<Uint8Array>) => bigint;
readonly adjustNonces?: (PK: P, nonces: TArg<Nonces>) => TRet<Nonces>;
/**
* Optional nonce-package adjustment hook.
* @param R - Group commitment point for the current signing session.
* @param nonces - Nonce package.
* @returns Adjusted nonce package.
*/
readonly adjustNonces?: (R: P, nonces: TArg<Nonces>) => TRet<Nonces>;
/**
* Optional secret-package adjustment hook.
* @param secret - Secret package.
* @param pub - Public package.
* @returns Adjusted secret package.
*/
readonly adjustSecret?: (secret: TArg<FrostSecret>, pub: TArg<FrostPublic>) => TRet<FrostSecret>;
/**
* Optional public-package adjustment hook.
* @param pub - Public package.
* @returns Adjusted public package.
*/
readonly adjustPublic?: (pub: TArg<FrostPublic>) => TRet<FrostPublic>;
/**
* Optional group commitment-share adjustment hook.
* @param GC - Group commitment.
* @param GCShare - Participant commitment share.
* @returns Adjusted group commitment share.
*/
readonly adjustGroupCommitmentShare?: (GC: P, GCShare: P) => P;
/** Optional transaction encoder / decoder adjustment. */
readonly adjustTx?: {
/**
* Encode transaction bytes before signing.
* @param tx - Transaction bytes.
* @returns Encoded transaction bytes.
*/
readonly encode: (tx: TArg<Uint8Array>) => TRet<Uint8Array>;
/**
* Decode transaction bytes after verification.
* @param tx - Encoded transaction bytes.
* @returns Decoded transaction bytes.
*/
readonly decode: (tx: TArg<Uint8Array>) => TRet<Uint8Array>;
};
/**
* Optional DKG output adjustment hook.
* @param k - DKG key package.
* @returns Adjusted DKG key package.
*/
readonly adjustDKG?: (k: TArg<Key>) => TRet<Key>;
// Hash function prefixes
/** Prefix for RFC 9591 H1. */
readonly H1?: string;
/** Prefix for RFC 9591 H2. */
readonly H2?: string;
/** Prefix for RFC 9591 H3. */
readonly H3?: string;
/** Prefix for RFC 9591 H4. */
readonly H4?: string;
/** Prefix for RFC 9591 H5. */
readonly H5?: string;
/** Prefix for DKG hashing. */
readonly HDKG?: string;
/** Prefix for identifier derivation. */
readonly HID?: string;

@@ -139,8 +313,6 @@ };

* FROST: Threshold Protocol for Two‑Round Schnorr Signatures
* from [RFC 9591](https://datatracker.ietf.org/doc/rfc9591/).
* from {@link https://datatracker.ietf.org/doc/rfc9591/ | RFC 9591}.
*/
export type FROST = {
/**
* Methods to construct participant identifiers.
*/
/** Methods to construct participant identifiers. */
Identifier: {

@@ -328,5 +500,3 @@ /**

combineSecret(shares: TArg<FrostSecret[]>, signers: Signers): TRet<Uint8Array>;
/**
* Low-level helper utilities (field arithmetic and polynomial tools).
*/
/** Low-level helper utilities (field arithmetic and polynomial tools). */
utils: {

@@ -367,5 +537,6 @@ /**

const validateSigners = (signers: Signers) => {
if (!Number.isSafeInteger(signers.min) || !Number.isSafeInteger(signers.max))
throw new Error('Wrong signers info: min=' + signers.min + ' max=' + signers.max);
const validateSigners = (signers: Signers, title: string = 'signers') => {
validateObject(signers as any, { min: 'number', max: 'number' }, {}, title);
asafenumber(signers.min, title + '.min');
asafenumber(signers.max, title + '.max');
// Compatibility with frost-rs intentionally narrows RFC 9591's positive-nonzero threshold rule

@@ -392,2 +563,19 @@ // to `min >= 2`, even though the RFC text itself allows `MIN_PARTICIPANTS = 1`.

/**
* Builds a FROST ciphersuite API from concrete curve and hash hooks.
* @param opts - Ciphersuite construction options. See {@link FrostOpts}.
* @returns FROST API bound to the supplied ciphersuite.
* @example
* Create a suite from a curve-specific option object.
* ```ts
* import { createFROST } from '@noble/curves/abstract/frost.js';
* import { ed25519 } from '@noble/curves/ed25519.js';
* import { sha512 } from '@noble/hashes/sha2.js';
* const frost = createFROST({
* name: 'FROST-ED25519-SHA512-v1',
* Point: ed25519.Point,
* hash: sha512,
* });
* ```
*/
export function createFROST<P extends FROSTPoint<P>>(opts: FrostOpts<P>): TRet<FROST> {

@@ -447,2 +635,4 @@ validateObject(

const randomScalar = (rng: RNG = randomBytes) => {
if (typeof rng !== 'function')
throw new TypeError('"rng" expected function, got type=' + typeof rng);
// Intentional divergence from RFC 9591 §4.1 / §5.1: the RFC nonce_generate helper outputs a

@@ -482,3 +672,4 @@ // Scalar in [0, p-1], but round-one commit publishes ScalarBaseMult(nonce) values and §3.1

const serializeIdentifier = (id: bigint) => bytesToHex(Fn.toBytes(validateIdentifier(id)));
const parseIdentifier = (id: string) => {
const parseIdentifier = (id: string, title: string = 'identifier') => {
astring(id, title);
const n = validateIdentifier(Fn.fromBytes(hexToBytes(id)));

@@ -501,3 +692,7 @@ // Keep string-keyed maps stable by accepting only the canonical serialized form.

// We don't know size of point, but we know size of scalar
const R = parsePoint(sig.subarray(0, -Fn.BYTES));
const Rbytes = sig.subarray(0, -Fn.BYTES);
const R = parsePoint(Rbytes);
// RFC 9591 Section 3.1 SerializeElement is canonical: a signature must not verify under an
// alternative point encoding (e.g. re-encoding a weierstrass R uncompressed as 65 bytes).
if (serializePoint(R).length !== Rbytes.length) throw new Error('invalid signature encoding');
const z = Fn.fromBytes(sig.subarray(-Fn.BYTES));

@@ -535,3 +730,5 @@ return { R, z };

const Poly = poly(Fn, noRoots);
const msm = (points: P[], scalars: bigint[]) => pippenger(Point, points, scalars);
// Variable-time MSM over public inputs only (VSS / nonce commitments, binding factors).
// Interleaved wNAF beats pippenger ~3x at FROST-sized inputs (n <= dozens of signers).
const msm = (points: P[], scalars: bigint[]) => mulAddUnsafe(Point, points, scalars);

@@ -574,2 +771,6 @@ // Internal stuff uses bigints & Points, external Uint8Arrays

validateSigners(signers);
if (secret !== undefined) abytes(secret, Fn.BYTES, 'secret');
if (coeffs !== undefined) aarray(coeffs, 'coeffs');
if (typeof rng !== 'function')
throw new TypeError('"rng" expected function, got type=' + typeof rng);
// Dealer/DKG polynomial sampling reuses the same hardened scalar derivation as round-one

@@ -605,4 +806,4 @@ // nonces: overriding `rng` only swaps the entropy source, not the non-zero `1..n-1` policy.

const c = this.challenge(id, phi, R);
// R === z*G - phi*c
if (!R.equals(Point.BASE.multiply(z).subtract(phi.multiply(c))))
// R === z*G - phi*c. All inputs are public: variable-time multiplication is safe here.
if (!R.equals(Point.BASE.multiplyUnsafe(z).subtract(phi.multiplyUnsafe(c))))
throw new Error('invalid proof of knowledge');

@@ -626,5 +827,6 @@ },

if (opts.adjustPoint) R = opts.adjustPoint(R);
// Signature, message and public key are all public: variable-time is safe on this path.
const c = this.challenge(R, PK, msg);
const zB = Point.BASE.multiply(z); // z*G
const cA = PK.multiply(c); // c*PK
const zB = Point.BASE.multiplyUnsafe(z); // z*G
const cA = PK.multiplyUnsafe(c); // c*PK
let check = zB.subtract(cA).subtract(R); // zB - cA - R

@@ -653,3 +855,3 @@ // No clearCoffactor on ristretto

derive(s: string): Identifier {
if (typeof s !== 'string') throw new Error('wrong identifier string: ' + s);
astring(s, 's');
// Derived identifiers may land anywhere in the scalar field; they are not restricted to

@@ -688,2 +890,5 @@ // sequential `1..max_signers` values.

}
// Hiding commitments all carry scalar 1, so add them directly and keep only the
// binding commitments in the MSM: same result, half the MSM size.
let hidingSum = Point.ZERO;
const points: P[] = [];

@@ -693,6 +898,7 @@ const scalars: bigint[] = [];

if (Point.ZERO.equals(hC) || Point.ZERO.equals(bC)) throw new Error('infinity commitment');
points.push(hC, bC);
scalars.push(Fn.ONE, bindingFactors[i]);
hidingSum = hidingSum.add(hC);
points.push(bC);
scalars.push(bindingFactors[i]);
}
const groupCommitment = msm(points, scalars); // GC += hC + bC*bindingFactor
const groupCommitment = hidingSum.add(msm(points, scalars)); // GC += hC + bC*bindingFactor
const identifiers = CL.map((i) => i[1]);

@@ -733,4 +939,4 @@ return { identifiers, groupCommitment, bindingFactors };

) => {
const idNum = parseIdentifier(id, 'id');
validateSigners(signers);
const idNum = parseIdentifier(id);
const { coefficients, commitment } = generateSecretPolynomial(

@@ -764,2 +970,10 @@ signers,

): TRet<Record<string, DKG_Round2>> => {
validateObject(
secret as any,
{ identifier: 'bigint', commitment: 'object', signers: 'object' },
{ coefficients: 'object', round2Cache: 'object', step: 'number' },
'secret'
);
validateSigners(secret.signers, 'secret.signers');
aarray(others, 'others');
if (others.length !== secret.signers.max - 1)

@@ -769,2 +983,4 @@ throw new Error('wrong number of round1 packages');

throw new Error('round3 package used in round2');
if (secret.round2Cache !== undefined)
return secret.round2Cache as TRet<Record<string, DKG_Round2>>;
const res: Record<Identifier, DKG_Round2> = {};

@@ -786,2 +1002,3 @@ for (const p of others) {

}
secret.round2Cache = res;
secret.step = 2;

@@ -795,2 +1012,11 @@ return res as TRet<Record<string, DKG_Round2>>;

): TRet<Key> => {
validateObject(
secret as any,
{ identifier: 'bigint', commitment: 'object', signers: 'object' },
{ coefficients: 'object', round2Cache: 'object', step: 'number' },
'secret'
);
validateSigners(secret.signers, 'secret.signers');
aarray(round1, 'round1');
aarray(round2, 'round2');
// DKG is outside RFC 9591's signing flow; callers are expected to reuse the same

@@ -868,2 +1094,3 @@ // remote round1 packages already accepted in round2, like frost-rs documents.

delete secret.coefficients;
delete secret.round2Cache;
secret.step = 3;

@@ -873,2 +1100,8 @@ return res;

clean(secret: TArg<DKG_Secret>) {
validateObject(
secret as any,
{ identifier: 'bigint', commitment: 'object', signers: 'object' },
{ coefficients: 'object', round2Cache: 'object', step: 'number' },
'secret'
);
// Instead of replacing secret bigint with another (zero?), we subtract it from itself

@@ -883,2 +1116,3 @@ // in the hope that JIT will modify it inplace, instead of creating new value.

// for (const c of secret.commitment) c.fill(0);
delete secret.round2Cache;
secret.step = 3;

@@ -901,3 +1135,4 @@ },

} else {
if (!Array.isArray(identifiers) || identifiers.length !== signers.max)
aarray(identifiers, 'identifiers');
if (identifiers.length !== signers.max)
throw new Error('identifiers should be array of ' + signers.max);

@@ -934,2 +1169,16 @@ }

validateSecret(secret: TArg<FrostSecret>, pub: TArg<FrostPublic>) {
validateObject(secret as any, { identifier: 'string', signingShare: 'object' }, {}, 'secret');
abytes(secret.signingShare, Fn.BYTES, 'secret.signingShare');
validateObject(
pub as any,
{
signers: 'object',
commitments: 'object',
verifyingShares: 'object',
},
{},
'pub'
);
validateSigners(pub.signers, 'pub.signers');
aarray(pub.commitments, 'pub.commitments');
const id = parseIdentifier(secret.identifier);

@@ -948,2 +1197,6 @@ const commitment = pub.commitments.map(parsePoint);

commit(secret: TArg<FrostSecret>, rng: RNG = randomBytes): TRet<GenNonce> {
validateObject(secret as any, { identifier: 'string', signingShare: 'object' }, {}, 'secret');
abytes(secret.signingShare, Fn.BYTES, 'secret.signingShare');
if (typeof rng !== 'function')
throw new TypeError('"rng" expected function, got type=' + typeof rng);
const secretScalar = Fn.fromBytes(secret.signingShare);

@@ -964,2 +1217,21 @@ const hiding = generateNonce(secretScalar, rng);

): TRet<Uint8Array> {
validateObject(secret as any, { identifier: 'string', signingShare: 'object' }, {}, 'secret');
abytes(secret.signingShare, Fn.BYTES, 'secret.signingShare');
validateObject(
pub as any,
{
signers: 'object',
commitments: 'object',
verifyingShares: 'object',
},
{},
'pub'
);
validateSigners(pub.signers, 'pub.signers');
aarray(pub.commitments, 'pub.commitments');
validateObject(nonces as any, { hiding: 'object', binding: 'object' }, {}, 'nonces');
abytes(nonces.hiding, Fn.BYTES, 'nonces.hiding');
abytes(nonces.binding, Fn.BYTES, 'nonces.binding');
aarray(commitmentList, 'commitmentList');
abytes(msg, undefined, 'msg');
validateCommitmentsNum(pub.signers, commitmentList.length);

@@ -1015,2 +1287,18 @@ const hidingNonce0 = Fn.fromBytes(nonces.hiding);

) {
validateObject(
pub as any,
{
signers: 'object',
commitments: 'object',
verifyingShares: 'object',
},
{},
'pub'
);
validateSigners(pub.signers, 'pub.signers');
aarray(pub.commitments, 'pub.commitments');
aarray(commitmentList, 'commitmentList');
abytes(msg, undefined, 'msg');
parseIdentifier(identifier);
abytes(sigShare, Fn.BYTES, 'sigShare');
if (opts.adjustPublic) pub = opts.adjustPublic(pub);

@@ -1028,9 +1316,12 @@ const comm = commitmentList.find((i) => i.identifier === identifier);

);
// Signature shares, commitments and verifying shares are public: vartime is safe here.
// hC + bC * bF
let commShare = hidingNonceCommitment.add(bindingNonceCommitment.multiply(bindingFactor));
let commShare = hidingNonceCommitment.add(
bindingNonceCommitment.multiplyUnsafe(bindingFactor)
);
if (opts.adjustGroupCommitmentShare)
commShare = opts.adjustGroupCommitmentShare(groupCommitment, commShare);
const l = Point.BASE.multiply(Fn.fromBytes(sigShare)); // sigShare*G
const l = Point.BASE.multiplyUnsafe(Fn.fromBytes(sigShare)); // sigShare*G
// commShare + PK * (challenge * lambda)
const r = commShare.add(PK.multiply(Fn.mul(challenge, lambda)));
const r = commShare.add(PK.multiplyUnsafe(Fn.mul(challenge, lambda)));
return l.equals(r);

@@ -1045,2 +1336,19 @@ },

): TRet<Uint8Array> {
validateObject(
pub as any,
{
signers: 'object',
commitments: 'object',
verifyingShares: 'object',
},
{},
'pub'
);
validateSigners(pub.signers, 'pub.signers');
aarray(pub.commitments, 'pub.commitments');
aarray(commitmentList, 'commitmentList');
abytes(msg, undefined, 'msg');
validateObject(sigShares as any, {}, {}, 'sigShares');
// verifyShare() applies adjustPublic too, so keep the original package for attribution.
const rawPub = pub;
if (opts.adjustPublic) pub = opts.adjustPublic(pub);

@@ -1053,2 +1361,8 @@ try {

const ids = commitmentList.map((i) => i.identifier);
const seen = new Set<Identifier>();
for (const id of ids) {
// `sigShares` is identifier-keyed, so duplicate commitments would reuse one share twice.
if (seen.has(id)) throw new AggErr('aggregation failed', []);
seen.add(id);
}
if (ids.length !== Object.keys(sigShares).length) throw new AggErr('aggregation failed', []);

@@ -1067,3 +1381,3 @@ for (const id of ids) {

for (const id of ids) {
if (!this.verifyShare(pub, commitmentList, msg, id, sigShares[id])) cheaters.push(id);
if (!this.verifyShare(rawPub, commitmentList, msg, id, sigShares[id])) cheaters.push(id);
}

@@ -1089,4 +1403,5 @@ throw new AggErr('aggregation failed', cheaters);

combineSecret(shares: TArg<FrostSecret[]>, signers: Signers): TRet<Uint8Array> {
aarray(shares, 'shares');
validateSigners(signers);
if (!Array.isArray(shares) || shares.length < signers.min)
if (shares.length < signers.min || shares.length > signers.max)
throw new Error('wrong secret shares array');

@@ -1093,0 +1408,0 @@ const points = [];

@@ -10,2 +10,3 @@ /**

import {
aarray,
abytes,

@@ -15,4 +16,4 @@ asafenumber,

bytesToNumberBE,
concatBytes,
copyBytes,
concatBytes,
isBytes,

@@ -22,4 +23,7 @@ validateObject,

import type { AffinePoint, PC_ANY, PC_F, PC_P } from './curve.ts';
import { FpInvertBatch, mod, type IField } from './modular.ts';
import { FpInvertBatch, FpIsSquare, mod, validateField, type IField } from './modular.ts';
// prettier-ignore
const _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3), _4n = /* @__PURE__ */ BigInt(4);
/** ASCII domain-separation tag or raw bytes. */

@@ -196,2 +200,5 @@ export type AsciiOrBytes = string | Uint8Array;

asafenumber(lenInBytes);
if (typeof H !== 'function') throw new Error('expand_message_xmd: expected hash function');
asafenumber(H.outputLen, 'hash.outputLen');
asafenumber(H.blockLen, 'hash.blockLen');
DST = normDST(DST);

@@ -258,3 +265,9 @@ // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3

asafenumber(lenInBytes);
asafenumber(k, 'k');
if (k < 0) throw new Error('expand_message_xof: invalid k');
if (typeof H !== 'function') throw new Error('expand_message_xof: expected XOF function');
if (typeof H.create !== 'function') throw new Error('expand_message_xof: expected XOF create');
DST = normDST(DST);
if (lenInBytes < 0 || lenInBytes > 65535)
throw new Error('expand_message_xof: invalid lenInBytes');
// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3

@@ -266,4 +279,5 @@ // RFC 9380 §5.3.3: DST = H("H2C-OVERSIZE-DST-" || a_very_long_DST, ceil(2 * k / 8)).

}
if (lenInBytes > 65535 || DST.length > 255)
throw new Error('expand_message_xof: invalid lenInBytes');
// Oversize DSTs are compressed above; fail closed if a custom XOF still returns one
// (possible when k > 1020 makes the compression dkLen itself exceed 255 bytes).
if (DST.length > 255) throw new Error('expand_message_xof: invalid DST');
return (

@@ -319,6 +333,11 @@ H.create({ dkLen: lenInBytes })

asafenumber(count);
// RFC 9380 §5.2 defines hash_to_field over a list of one or more field elements and requires
asafenumber(m, 'm');
asafenumber(k, 'k');
// RFC 9380 §5.2 defines hash_to_field over a list of one or more field elements and an integer
// extension degree `m >= 1`; rejecting here avoids degenerate `[]` / `[[]]` helper outputs.
// The RFC also treats `p` as a finite-field characteristic; bad values degenerate log2/mod.
if (p <= BigInt(1)) throw new Error('hash_to_field: expected valid field characteristic');
if (count < 1) throw new Error('hash_to_field: expected count >= 1');
if (m < 1) throw new Error('hash_to_field: expected m >= 1');
if (k < 0) throw new Error('hash_to_field: invalid k');
const log2p = p.toString(2).length;

@@ -333,3 +352,4 @@ const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above

} else if (expand === '_internal_pass') {
// for internal tests only
// for internal tests only: msg is used as the uniform bytes directly. Short msg is allowed
// on purpose (subarray() slices are short): zkcrypto map_scalar vectors feed empty okm.
prb = msg;

@@ -370,4 +390,10 @@ } else {

export function isogenyMap<T, F extends IField<T>>(field: F, map: XYRatio<T>): XY<T> {
validateField(field);
// Make same order as in spec
const coeff = map.map((i) => Array.from(i).reverse());
aarray<T[]>(map, 'map');
const coeff = map.map((i, row) => {
aarray(i, 'map[' + row + ']');
if (i.length < 1) throw new Error('isogenyMap: expected non-empty coefficients');
return Array.from(i).reverse();
});
return (x: T, y: T) => {

@@ -377,4 +403,3 @@ const [xn, xd, yn, yd] = coeff.map((val) =>

);
// RFC 9380 §6.6.3 / Appendix E: denominator-zero exceptional cases must
// return the identity on E.
const isZero = field.is0(xd) || field.is0(yd);
// Shipped Weierstrass consumers encode that affine identity as all-zero

@@ -386,3 +411,5 @@ // coordinates, so `passZero=true` intentionally collapses zero

y = field.mul(y, field.mul(yn, yd_inv)); // y * (yNum / yDev)
return { x, y };
// RFC 9380 §6.6.3: if the denominator of either isogeny rational function is
// zero, the exceptional case must return the identity point on E.
return isZero ? { x: field.ZERO, y: field.ZERO } : { x, y };
};

@@ -402,4 +429,4 @@ }

* @param mapToCurve - Map-to-curve function.
* @param defaults - Default hash-to-curve options. This object is frozen in place and reused as
* the shared defaults bundle for the returned helpers.
* @param defaults - Default hash-to-curve options. A frozen detached snapshot is reused as the
* shared defaults bundle for the returned helpers.
* @returns Hash-to-curve helper namespace.

@@ -432,2 +459,3 @@ * @throws If the map-to-curve callback or default hash-to-curve options are invalid. {@link Error}

if (typeof mapToCurve !== 'function') throw new Error('mapToCurve() must be defined');
validateObject(defaults);
// `Point` is intentionally not shape-validated eagerly here: point constructors vary across

@@ -449,2 +477,7 @@ // curve families, so this helper only checks the hooks it can validate cheaply. Misconfigured

const safeDefaults = snapshot(defaults);
// Per-call options are H2CDSTOpts: only DST may be overridden. Copying just that key keeps
// off-type option objects from silently replacing suite parameters (p/m/k/hash/expand) at
// runtime — same pinning hashToScalar always did for p/m.
const dstOverride = (options?: TArg<H2CDSTOpts>) =>
options && options.DST !== undefined ? { DST: options.DST } : undefined;
function map(num: bigint[]): PC_P<PC> {

@@ -469,3 +502,3 @@ return Point.fromAffine(mapToCurve(num)) as PC_P<PC>;

hashToCurve(msg: TArg<Uint8Array>, options?: TArg<H2CDSTOpts>): PC_P<PC> {
const opts = Object.assign({}, safeDefaults, options);
const opts = Object.assign({}, safeDefaults, dstOverride(options));
const u = hash_to_field(msg, 2, opts);

@@ -477,4 +510,4 @@ const u0 = map(u[0]);

encodeToCurve(msg: TArg<Uint8Array>, options?: TArg<H2CDSTOpts>): PC_P<PC> {
const optsDst = safeDefaults.encodeDST ? { DST: safeDefaults.encodeDST } : {};
const opts = Object.assign({}, safeDefaults, optsDst, options);
const optsDst = safeDefaults.encodeDST === undefined ? {} : { DST: safeDefaults.encodeDST };
const opts = Object.assign({}, safeDefaults, optsDst, dstOverride(options));
const u = hash_to_field(msg, 1, opts);

@@ -492,2 +525,5 @@ const u0 = map(u[0]);

if (!Array.isArray(scalars)) throw new Error('expected array of bigints');
// RFC 9380 represents one GF(p^m) element as exactly m base-field scalars.
if (scalars.length !== safeDefaults.m)
throw new Error(`expected array of ${safeDefaults.m} bigints`);
for (const i of scalars)

@@ -504,3 +540,6 @@ if (typeof i !== 'bigint') throw new Error('expected array of bigints');

const N = Point.Fn.ORDER;
const opts = Object.assign({}, safeDefaults, { p: N, m: 1, DST: _DST_scalar }, options);
const opts = Object.assign({}, safeDefaults, { DST: _DST_scalar }, dstOverride(options), {
p: N,
m: 1,
});
return hash_to_field(msg, 1, opts)[0][0];

@@ -510,1 +549,188 @@ },

}
/**
* Implementation of the Shallue and van de Woestijne method for any weierstrass curve.
* TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.
* b = True and y = sqrt(u / v) if (u / v) is square in F, and
* b = False and y = sqrt(Z * (u / v)) otherwise.
* RFC 9380 expects callers to provide `v != 0`; this helper does not enforce it.
* @param Fp - Field implementation.
* @param Z - Simplified SWU map parameter.
* @returns Square-root ratio helper.
* @example
* Build the square-root ratio helper used by SWU map implementations.
*
* ```ts
* import { SWUFpSqrtRatio } from '@noble/curves/abstract/hash-to-curve.js';
* import { Field } from '@noble/curves/abstract/modular.js';
* const Fp = Field(17n);
* const sqrtRatio = SWUFpSqrtRatio(Fp, 3n);
* const out = sqrtRatio(4n, 1n);
* ```
*/
export function SWUFpSqrtRatio<T>(
Fp: TArg<IField<T>>,
Z: T
): (u: T, v: T) => { isValid: boolean; value: T } {
// Fail with the usual field-shape error before touching pow/cmov on malformed field shims.
const F = validateField(Fp as IField<T>) as IField<T>;
// Generic implementation
const q = F.ORDER;
let l = _0n;
for (let o = q - _1n; o % _2n === _0n; o /= _2n) l += _1n;
const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.
// We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<.
// 2n ** c1 == 2n << (c1-1)
const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n);
const _2n_pow_c1 = _2n_pow_c1_1 * _2n;
const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic
const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic
const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic
const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic
const c6 = F.pow(Z, c2); // 6. c6 = Z^c2
const c7 = F.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)
// RFC 9380 Appendix F.2.1.1 defines sqrt_ratio(u, v) only for v != 0.
// We keep v=0 on the regular result path with isValid=false instead of
// throwing so the helper stays closer to the RFC's fixed control flow.
let sqrtRatio = (u: T, v: T): { isValid: boolean; value: T } => {
let tv1 = c6; // 1. tv1 = c6
let tv2 = F.pow(v, c4); // 2. tv2 = v^c4
let tv3 = F.sqr(tv2); // 3. tv3 = tv2^2
tv3 = F.mul(tv3, v); // 4. tv3 = tv3 * v
let tv5 = F.mul(u, tv3); // 5. tv5 = u * tv3
tv5 = F.pow(tv5, c3); // 6. tv5 = tv5^c3
tv5 = F.mul(tv5, tv2); // 7. tv5 = tv5 * tv2
tv2 = F.mul(tv5, v); // 8. tv2 = tv5 * v
tv3 = F.mul(tv5, u); // 9. tv3 = tv5 * u
let tv4 = F.mul(tv3, tv2); // 10. tv4 = tv3 * tv2
tv5 = F.pow(tv4, c5); // 11. tv5 = tv4^c5
let isQR = F.eql(tv5, F.ONE); // 12. isQR = tv5 == 1
tv2 = F.mul(tv3, c7); // 13. tv2 = tv3 * c7
tv5 = F.mul(tv4, tv1); // 14. tv5 = tv4 * tv1
tv3 = F.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)
tv4 = F.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)
// 17. for i in (c1, c1 - 1, ..., 2):
for (let i = c1; i > _1n; i--) {
let tv5 = i - _2n; // 18. tv5 = i - 2
tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5
let tvv5 = F.pow(tv4, tv5); // 20. tv5 = tv4^tv5
const e1 = F.eql(tvv5, F.ONE); // 21. e1 = tv5 == 1
tv2 = F.mul(tv3, tv1); // 22. tv2 = tv3 * tv1
tv1 = F.mul(tv1, tv1); // 23. tv1 = tv1 * tv1
tvv5 = F.mul(tv4, tv1); // 24. tv5 = tv4 * tv1
tv3 = F.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1)
tv4 = F.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1)
}
// RFC 9380 Appendix F.2.1.1 defines sqrt_ratio(u, v) for v != 0.
// When u = 0 and v != 0, u / v = 0 is square and the computed root is
// still 0, so widen only the final flag and keep the full control flow.
return { isValid: !F.is0(v) && (isQR || F.is0(u)), value: tv3 };
};
if (F.ORDER % _4n === _3n) {
// sqrt_ratio_3mod4(u, v)
const c1 = (F.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic
const c2 = F.sqrt(F.neg(Z)); // 2. c2 = sqrt(-Z)
sqrtRatio = (u: T, v: T) => {
let tv1 = F.sqr(v); // 1. tv1 = v^2
const tv2 = F.mul(u, v); // 2. tv2 = u * v
tv1 = F.mul(tv1, tv2); // 3. tv1 = tv1 * tv2
let y1 = F.pow(tv1, c1); // 4. y1 = tv1^c1
y1 = F.mul(y1, tv2); // 5. y1 = y1 * tv2
const y2 = F.mul(y1, c2); // 6. y2 = y1 * c2
const tv3 = F.mul(F.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v
const isQR = F.eql(tv3, u); // 9. isQR = tv3 == u
let y = F.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)
return { isValid: !F.is0(v) && isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2
};
}
// No curves uses that
// if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8
return sqrtRatio;
}
/**
* Simplified Shallue-van de Woestijne-Ulas Method
* See {@link https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2 | RFC 9380 section 6.6.2}.
* @param Fp - Field implementation.
* @param opts - SWU parameters:
* - `A`: Curve parameter `A`.
* - `B`: Curve parameter `B`.
* - `Z`: Simplified SWU map parameter.
* @returns Deterministic map-to-curve function.
* @throws If the SWU parameters are invalid or the field lacks the required helpers. {@link Error}
* @example
* Map one field element to a Weierstrass curve point with the SWU recipe.
*
* ```ts
* import { mapToCurveSimpleSWU } from '@noble/curves/abstract/hash-to-curve.js';
* import { Field } from '@noble/curves/abstract/modular.js';
* const Fp = Field(17n);
* const map = mapToCurveSimpleSWU(Fp, { A: 1n, B: 2n, Z: 3n });
* const point = map(5n);
* ```
*/
export function mapToCurveSimpleSWU<T>(
Fp: TArg<IField<T>>,
opts: {
A: T;
B: T;
Z: T;
}
): (u: T) => { x: T; y: T } {
const F = validateField(Fp as IField<T>) as IField<T>;
validateObject(opts as any, {}, {}, 'opts');
const { A, B, Z } = opts;
if (!F.isValidNot0(A) || !F.isValidNot0(B) || !F.isValid(Z))
throw new Error('mapToCurveSimpleSWU: invalid opts');
// RFC 9380 §6.6.2 and Appendix H.2 require:
// 1. Z is non-square in F
// 2. Z != -1 in F
// 3. g(x) - Z is irreducible over F
// 4. g(B / (Z * A)) is square in F
// We can enforce 1, 2, and 4 with the current field API.
// Criterion 3 is not checked here because generic `IField<T>` does not expose
// polynomial-ring / irreducibility operations, and this helper is used for
// both prime and extension fields.
if (F.eql(Z, F.neg(F.ONE)) || FpIsSquare(F, Z))
throw new Error('mapToCurveSimpleSWU: invalid opts');
// RFC 9380 Appendix H.2 criterion 4: g(B / (Z * A)) is square in F.
// x = B / (Z * A)
const x = F.mul(B, F.inv(F.mul(Z, A)));
// g(x) = x^3 + A*x + B
const gx = F.add(F.add(F.mul(F.sqr(x), x), F.mul(A, x)), B);
if (!FpIsSquare(F, gx)) throw new Error('mapToCurveSimpleSWU: invalid opts');
const sqrtRatio = SWUFpSqrtRatio(F, Z);
if (!F.isOdd) throw new Error('Field does not have .isOdd()');
// Input: u, an element of F.
// Output: (x, y), a point on E.
return (u: T): { x: T; y: T } => {
// prettier-ignore
let tv1, tv2, tv3, tv4, tv5, tv6, x, y;
tv1 = F.sqr(u); // 1. tv1 = u^2
tv1 = F.mul(tv1, Z); // 2. tv1 = Z * tv1
tv2 = F.sqr(tv1); // 3. tv2 = tv1^2
tv2 = F.add(tv2, tv1); // 4. tv2 = tv2 + tv1
tv3 = F.add(tv2, F.ONE); // 5. tv3 = tv2 + 1
tv3 = F.mul(tv3, B); // 6. tv3 = B * tv3
tv4 = F.cmov(Z, F.neg(tv2), !F.eql(tv2, F.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0)
tv4 = F.mul(tv4, A); // 8. tv4 = A * tv4
tv2 = F.sqr(tv3); // 9. tv2 = tv3^2
tv6 = F.sqr(tv4); // 10. tv6 = tv4^2
tv5 = F.mul(tv6, A); // 11. tv5 = A * tv6
tv2 = F.add(tv2, tv5); // 12. tv2 = tv2 + tv5
tv2 = F.mul(tv2, tv3); // 13. tv2 = tv2 * tv3
tv6 = F.mul(tv6, tv4); // 14. tv6 = tv6 * tv4
tv5 = F.mul(tv6, B); // 15. tv5 = B * tv6
tv2 = F.add(tv2, tv5); // 16. tv2 = tv2 + tv5
x = F.mul(tv1, tv3); // 17. x = tv1 * tv3
const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)
y = F.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1
y = F.mul(y, value); // 20. y = y * y1
x = F.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square)
y = F.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square)
const e1 = F.isOdd!(u) === F.isOdd!(y); // 23. e1 = sgn0(u) == sgn0(y)
y = F.cmov(F.neg(y), y, e1); // 24. y = CMOV(-y, y, e1)
const tv4_inv = FpInvertBatch(F, [tv4], true)[0];
x = F.mul(x, tv4_inv); // 25. x = x / tv4
return { x, y };
};
}

@@ -9,5 +9,8 @@ /**

import {
aarray,
abool,
abytes,
afunction,
anumber,
aobject,
asafenumber,

@@ -19,3 +22,2 @@ bitLen,

numberToBytesLE,
validateObject,
type TArg,

@@ -32,3 +34,7 @@ type TRet,

const _7n = /* @__PURE__ */ BigInt(7), _8n = /* @__PURE__ */ BigInt(8), _9n = /* @__PURE__ */ BigInt(9);
const _16n = /* @__PURE__ */ BigInt(16);
const _15n = /* @__PURE__ */ BigInt(15),
_16n = /* @__PURE__ */ BigInt(16);
// 2^64: exponents below this use plain square-and-multiply in pow()/FpPow(); the windowed path's
// table build (14 multiplications) only pays off for longer exponents (break-even ~50 bits).
const POW_WINDOWED_MIN = /* @__PURE__ */ BigInt('0x10000000000000000');

@@ -70,3 +76,45 @@ /**

export function pow(num: bigint, power: bigint, modulo: bigint): bigint {
return FpPow(Field(modulo), num, power);
if (modulo <= _1n) throw new Error('pow: expected modulus > 1, got ' + modulo);
// Non-bigint exponents coerce every comparison below to false and would silently return 1.
if (typeof power !== 'bigint')
throw new TypeError('invalid exponent: expected bigint, got ' + typeof power);
if (power < _0n) throw new Error('invalid exponent, negatives unsupported');
if (power === _0n) return _1n;
if (power === _1n) return num;
let d = num % modulo;
if (d < _0n) d += modulo;
// Control flow in both branches below depends only on the exponent, never on `num` — invertCt()
// relies on that for its (public-exponent) secret-independence guarantee.
if (power < POW_WINDOWED_MIN) {
// Square-and-multiply: cheaper than the windowed path for short exponents.
let p = _1n;
while (power > _0n) {
if (power & _1n) p = (p * d) % modulo;
d = (d * d) % modulo;
power >>= _1n;
}
return p;
}
// Fixed 4-bit windows, MSB-first: a 14-multiplication table drops per-window cost to <1
// multiplication (vs ~2 per window for square-and-multiply), ~25-30% faster for the dense
// 256-bit exponents of sqrt / Legendre / invertCt.
const digits: number[] = [];
while (power > _0n) {
digits.push(Number(power & _15n));
power >>= _4n;
}
const table: bigint[] = new Array(16);
table[0] = _1n;
table[1] = d;
for (let i = 2; i < 16; i++) table[i] = (table[i - 1] * d) % modulo;
let p = table[digits[digits.length - 1]]; // top digit is nonzero: the loop above stops on 0
for (let w = digits.length - 2; w >= 0; w--) {
p = (p * p) % modulo;
p = (p * p) % modulo;
p = (p * p) % modulo;
p = (p * p) % modulo;
const digit = digits[w];
if (digit !== 0) p = (p * table[digit]) % modulo;
}
return p;
}

@@ -91,2 +139,3 @@

export function pow2(x: bigint, power: bigint, modulo: bigint): bigint {
if (modulo <= _1n) throw new Error('pow2: expected modulus > 1, got ' + modulo);
if (power < _0n) throw new Error('pow2: expected non-negative exponent, got ' + power);

@@ -105,3 +154,3 @@ let res = x;

* @param number - Value to invert.
* @param modulo - Positive modulus.
* @param modulo - Modulus greater than 1.
* @returns Multiplicative inverse.

@@ -118,8 +167,13 @@ * @throws If the modulus is invalid or the inverse does not exist. {@link Error}

if (number === _0n) throw new Error('invert: expected non-zero number');
if (modulo <= _0n) throw new Error('invert: expected positive modulus, got ' + modulo);
// Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower.
// modulo = 1 is the zero ring: gcd(x, 1) = 1 makes the loop below "succeed" and return the
// useless inverse 0. Reject it like pow() and invertCt() do.
if (modulo <= _1n) throw new Error('invert: expected modulus > 1, got ' + modulo);
// This is variable-time: the loop count depends on `number`. For a secret-independent
// (Fermat) alternative over a prime modulus, see {@link invertCt} (~4x slower).
let a = mod(number, modulo);
let b = modulo;
// Only the Bézout coefficient of `number` (x/u chain) is tracked; the coefficient of `modulo`
// never affects the output, so it is not computed.
// prettier-ignore
let x = _0n, y = _1n, u = _1n, v = _0n;
let x = _0n, u = _1n;
while (a !== _0n) {

@@ -129,5 +183,4 @@ const q = b / a;

const m = x - u * q;
const n = y - v * q;
// prettier-ignore
b = a, a = r, x = u, y = v, u = m, v = n;
b = a, a = r, x = u, u = m;
}

@@ -139,2 +192,38 @@ const gcd = b;

/**
* Inverses number over modulo using Fermat's little theorem: `a^(p-2) ≡ a⁻¹ (mod p)`.
*
* Unlike {@link invert} (extended Euclidean), the exponent `p-2` is a public constant, so the
* underlying square-and-multiply has the same control flow for every secret `a`: there is no
* data-dependent branching or loop count that could leak `a` through timing (e.g. Minerva-style
* ECDSA nonce-inversion attacks). This is only "algorithmically" constant-time — JS bigint
* multiplication/reduction is still value-dependent — and it is roughly 4x slower than
* {@link invert}.
*
* REQUIRES a prime modulus; Fermat's theorem does not hold otherwise. The result is verified to be
* a real inverse, so a non-prime modulus (or a non-invertible input) fails closed with an error
* instead of returning a wrong value.
* @param a - Value to invert.
* @param prime - Prime modulus.
* @returns Multiplicative inverse in `[1, prime)`.
* @throws If the modulus is below 2, the input reduces to zero, or the inverse does not exist.
* {@link Error}
* @example
* Compute one modular inverse without secret-dependent branching.
*
* ```ts
* invertCt(3n, 11n); // 4n, since 3 * 4 = 12 ≡ 1 (mod 11)
* ```
*/
export function invertCt(a: bigint, prime: bigint): bigint {
if (prime <= _1n) throw new Error('invertCt: expected prime modulus > 1, got ' + prime);
const an = mod(a, prime);
if (an === _0n) throw new Error('invertCt: expected non-zero number');
// Exponent (prime - 2) is public, so FpPow's square-and-multiply is secret-independent.
const inverse = pow(an, prime - _2n, prime);
// O(1) safety net: verifies the inverse and rejects composite moduli where a^(p-2) is not one.
if (mod(an * inverse, prime) !== _1n) throw new Error('invertCt: does not exist');
return inverse;
}
function assertIsSquare<T>(Fp: TArg<IField<T>>, root: T, n: T): void {

@@ -145,2 +234,11 @@ const F = Fp as IField<T>;

// The Legendre symbol and every sqrt variant here are only defined over an odd (prime) modulus.
// An even ORDER makes their integer divisions — (p-1)/2, (p+1)/4, (p-5)/8, (p+7)/16 — truncate and
// silently return a wrong result, so reject it explicitly at the entry points instead. This is a
// cheap necessary-condition check, not a primality test (composite odd moduli are caught later by
// the Legendre-result / assertIsSquare checks).
function aoddModulus(order: bigint, fnName: string): void {
if ((order & _1n) === _0n) throw new Error(fnName + ': expected odd modulus, got ' + order);
}
// Not all roots are possible! Example which will throw:

@@ -220,2 +318,3 @@ // const NUM =

if (P < _3n) throw new Error('sqrt is not defined for small field');
aoddModulus(P, 'tonelliShanks');
// Factor P - 1 = Q * 2^S, where Q is odd

@@ -259,3 +358,5 @@ let Q = P - _1n;

while (!F.eql(t, F.ONE)) {
if (F.is0(t)) return F.ZERO; // if t=0 return R=0
// Unreachable over a genuine field (no zero divisors; n=0 already returned above). A zero t
// means composite ORDER, where a fabricated root would be wrong: fail closed instead.
if (F.is0(t)) throw new Error('Cannot find square root: probably non-prime P');
let i = 1;

@@ -310,2 +411,3 @@

export function FpSqrt(P: bigint): TRet<<T>(Fp: IField<T>, n: T) => T> {
aoddModulus(P, 'Fp.sqrt');
// P ≡ 3 (mod 4) => √n = n^((P+1)/4)

@@ -487,3 +589,2 @@ if (P % _4n === _3n) return sqrt3mod4 as TRet<<T>(Fp: IField<T>, n: T) => T>;

isOdd?(num: T): boolean;
// legendre?(num: T): T;
/**

@@ -545,16 +646,10 @@ * Invert many field elements in one batch.

export function validateField<T>(field: TArg<IField<T>>): TRet<IField<T>> {
const initial = {
ORDER: 'bigint',
BYTES: 'number',
BITS: 'number',
} as Record<string, string>;
const opts = FIELD_FIELDS.reduce((map, val: string) => {
map[val] = 'function';
return map;
}, initial);
validateObject(field, opts);
aobject(field as any, 'field');
if (typeof field.ORDER !== 'bigint')
throw new TypeError('param "ORDER" is invalid: expected bigint, got ' + typeof field.ORDER);
// Runtime field implementations must expose real integer byte/bit sizes; fractional / NaN /
// infinite metadata leaks through validateObject(type='number') but breaks encoders and caches.
// infinite metadata breaks encoders and caches.
asafenumber(field.BYTES, 'BYTES');
asafenumber(field.BITS, 'BITS');
for (const name of FIELD_FIELDS) afunction((field as any)[name], 'field.' + name);
// Runtime field implementations must expose positive byte/bit sizes; zero leaks through the

@@ -587,13 +682,40 @@ // numeric shape checks above but still breaks encoding helpers and cached-length assumptions.

export function FpPow<T>(Fp: TArg<IField<T>>, num: T, power: bigint): T {
validateField(Fp);
const F = Fp as IField<T>;
// Non-bigint exponents (e.g. an accidental field element) coerce every comparison below to
// false and would silently return ONE.
if (typeof power !== 'bigint')
throw new TypeError('invalid exponent: expected bigint, got ' + typeof power);
if (power < _0n) throw new Error('invalid exponent, negatives unsupported');
if (power === _0n) return F.ONE;
if (power === _1n) return num;
let p = F.ONE;
let d = num;
if (power < POW_WINDOWED_MIN) {
// Square-and-multiply: cheaper than the windowed path for short exponents (e.g. poseidon
// sbox x^5), which would waste the 14-multiplication table build.
let p = F.ONE;
let d = num;
while (power > _0n) {
if (power & _1n) p = F.mul(p, d);
d = F.sqr(d);
power >>= _1n;
}
return p;
}
// Fixed 4-bit windows, MSB-first — same shape as pow() above, over generic field ops.
// Speeds up dense long exponents (extension-field sqrt / Legendre, e.g. Fp2 decompression).
const digits: number[] = [];
while (power > _0n) {
if (power & _1n) p = F.mul(p, d);
d = F.sqr(d);
power >>= _1n;
digits.push(Number(power & _15n));
power >>= _4n;
}
const table: T[] = new Array(16);
table[0] = F.ONE;
table[1] = num;
for (let i = 2; i < 16; i++) table[i] = F.mul(table[i - 1], num);
let p = table[digits[digits.length - 1]]; // top digit is nonzero: the loop above stops on 0
for (let w = digits.length - 2; w >= 0; w--) {
p = F.sqr(F.sqr(F.sqr(F.sqr(p))));
const digit = digits[w];
if (digit !== 0) p = F.mul(p, table[digit]);
}
return p;

@@ -604,7 +726,11 @@ }

* Efficiently invert an array of Field elements.
* Exception-free. Zero-valued field elements stay `undefined` unless `passZero` is enabled.
* Zero-valued inputs are not inverted: by default their slot stays `undefined` (hence the
* `(T | undefined)[]` return type), or becomes `0` when `passZero` is enabled. Because of that the
* batch never calls `inv` on a zero, so over a prime field it is exception-free. The single
* `Fp.inv` of the accumulated product can still throw, but only for a non-invertible product, which
* a prime `ORDER` cannot produce (it requires a composite / non-field `ORDER`).
* @param Fp - Field implementation.
* @param nums - Values to invert.
* @param passZero - map 0 to 0 (instead of undefined)
* @returns Inverted values.
* @returns Inverted values; entries for zero inputs are `undefined` unless `passZero` is set.
* @example

@@ -619,5 +745,18 @@ * Invert several field elements with one shared inversion.

*/
export function FpInvertBatch<T>(Fp: TArg<IField<T>>, nums: T[], passZero = false): T[] {
export function FpInvertBatch<T>(Fp: TArg<IField<T>>, nums: T[], passZero: true): T[];
export function FpInvertBatch<T>(
Fp: TArg<IField<T>>,
nums: T[],
passZero?: boolean
): (T | undefined)[];
export function FpInvertBatch<T>(
Fp: TArg<IField<T>>,
nums: T[],
passZero = false
): (T | undefined)[] {
validateField(Fp);
aarray(nums, 'nums');
abool(passZero, 'passZero');
const F = Fp as IField<T>;
const inverted = new Array(nums.length).fill(passZero ? F.ZERO : undefined) as T[];
const inverted = new Array(nums.length).fill(passZero ? F.ZERO : undefined) as (T | undefined)[];
// Walk from first to last, multiply them by each other MOD p

@@ -634,3 +773,4 @@ const multipliedAcc = nums.reduce((acc, num, i) => {

if (F.is0(num)) return acc;
inverted[i] = F.mul(acc, inverted[i]);
// Non-zero `num` means the forward pass already stored a defined prefix product at index i.
inverted[i] = F.mul(acc, inverted[i]!);
return F.mul(acc, num);

@@ -657,2 +797,3 @@ }, invertedAcc);

export function FpDiv<T>(Fp: TArg<IField<T>>, lhs: T, rhs: T | bigint): T {
validateField(Fp);
const F = Fp as IField<T>;

@@ -673,3 +814,3 @@ return F.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, F.ORDER) : F.inv(rhs));

* @returns Legendre symbol.
* @throws If the field returns an invalid Legendre symbol value. {@link Error}
* @throws If the powered value does not match a valid Legendre symbol. {@link Error}
* @example

@@ -685,3 +826,5 @@ * Compute the Legendre symbol of one field element.

export function FpLegendre<T>(Fp: TArg<IField<T>>, n: T): -1 | 0 | 1 {
validateField(Fp);
const F = Fp as IField<T>;
aoddModulus(F.ORDER, 'FpLegendre');
// We can use 3rd argument as optional cache of this value

@@ -749,3 +892,3 @@ // but seems unneeded for now. The operation is very fast.

if (nBitLength !== undefined && nBitLength < bits)
throw new Error(`invalid n length: expected bit length (${bits}) >= n.length (${nBitLength})`);
throw new Error(`invalid n length: expected nBitLength (${nBitLength}) >= bitLen(n) (${bits})`);
const _nBitLength = nBitLength !== undefined ? nBitLength : bits;

@@ -840,3 +983,3 @@ const nByteLength = Math.ceil(_nBitLength / 8);

pow(num: bigint, power: bigint): bigint {
return FpPow(this, num, power);
return pow(num, power, this.ORDER);
}

@@ -906,3 +1049,6 @@ div(lhs: bigint, rhs: bigint) {

invertBatch(lst: bigint[]): bigint[] {
return FpInvertBatch(this, lst);
// `passZero` keeps the `bigint[]` contract honest: zero inputs map to `0` instead of leaking
// `undefined` into a `bigint[]`. Callers that must distinguish non-invertible inputs should use
// `FpInvertBatch` directly, whose default omits `passZero` and returns `(bigint | undefined)[]`.
return FpInvertBatch(this, lst, true);
}

@@ -918,5 +1064,2 @@ // We can't move this out because Fp6, Fp12 implement it

}
// Freeze the shared method surface too; otherwise callers can still poison every Field instance by
// monkey-patching `_Field.prototype` even if each instance is frozen.
Object.freeze(_Field.prototype);

@@ -950,19 +1093,10 @@ /**

export function Field(ORDER: bigint, opts: FieldOpts = {}): TRet<Readonly<FpField>> {
// Freeze the shared method surface before any instance is reachable; otherwise callers can
// poison every Field instance by monkey-patching `_Field.prototype` even if each instance is
// frozen. Freezing here instead of module scope keeps `_Field` tree-shakeable for importers
// that never construct a field; the call is idempotent and cheap.
Object.freeze(_Field.prototype);
return new _Field(ORDER, opts);
}
// Generic random scalar, we can do same for other fields if via Fp2.mul(Fp2.ONE, Fp2.random)?
// This allows unsafe methods like ignore bias or zero. These unsafe, but often used in different protocols (if deterministic RNG).
// which mean we cannot force this via opts.
// Not sure what to do with randomBytes, we can accept it inside opts if wanted.
// Probably need to export getMinHashLength somewhere?
// random(bytes?: Uint8Array, unsafeAllowZero = false, unsafeAllowBias = false) {
// const LEN = !unsafeAllowBias ? getMinHashLength(ORDER) : BYTES;
// if (bytes === undefined) bytes = randomBytes(LEN); // _opts.randomBytes?
// const num = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);
// // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0
// const reduced = unsafeAllowZero ? mod(num, ORDER) : mod(num, ORDER - _1n) + _1n;
// return reduced;
// },
/**

@@ -984,2 +1118,3 @@ * @param Fp - Field implementation.

export function FpSqrtOdd<T>(Fp: TArg<IField<T>>, elm: T): T {
validateField(Fp);
const F = Fp as IField<T>;

@@ -1006,2 +1141,3 @@ if (!F.isOdd) throw new Error("Field doesn't have isOdd");

export function FpSqrtEven<T>(Fp: TArg<IField<T>>, elm: T): T {
validateField(Fp);
const F = Fp as IField<T>;

@@ -1094,5 +1230,9 @@ if (!F.isOdd) throw new Error("Field doesn't have isOdd");

const num = isLE ? bytesToNumberLE(key) : bytesToNumberBE(key);
// `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0
// Map into the non-zero scalar range [1, fieldOrder-1]: reduce mod (fieldOrder-1) to land in
// [0, fieldOrder-2], then add 1. This shifts the range off zero; it is NOT equal to
// `mod(num, fieldOrder)` (which spans [0, fieldOrder-1] and can be 0). A residual modulo bias
// remains but is negligible (~2^-(nBits/2), e.g. ~2^-128 for a 256-bit order) because `key` is
// required to be at least `getMinHashLength(fieldOrder)` (~1.5x field size) bytes of input.
const reduced = mod(num, fieldOrder - _1n) + _1n;
return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
}

@@ -23,5 +23,5 @@ /**

const _0n = BigInt(0);
const _1n = BigInt(1);
const _2n = BigInt(2);
const _0n = /* @__PURE__ */ BigInt(0);
const _1n = /* @__PURE__ */ BigInt(1);
const _2n = /* @__PURE__ */ BigInt(2);

@@ -48,5 +48,16 @@ /** Curve-specific hooks required to build one X25519/X448 helper. */

* Optional randomness source for `keygen()` and `utils.randomSecretKey()`.
* Receives the requested byte length and returns fresh random bytes.
* @param bytesLength - Requested byte length.
* @returns Random bytes.
*/
randomBytes?: (bytesLength?: number) => TRet<Uint8Array>;
/**
* Optional fast fixed-base multiplication, replacing the Montgomery ladder in
* `scalarMultBase()` / `getPublicKey()` only. Standard implementation computes `[k]B` on the
* equivalent Edwards curve with cached base-point tables and maps the result back to a
* Montgomery `u` coordinate (libsodium does the same for X25519); ~3x faster than the ladder.
* @param k - Decoded, clamped scalar; guaranteed to be in the RFC 7748 clamped range.
* @returns `u([k]G)` as an integer. Must return `0` when `[k]G` is the point at infinity
* (`k ≡ 0 mod n`) so the caller can reject it exactly like the ladder path does.
*/
scalarMultBase?: (k: bigint) => bigint;
};

@@ -103,2 +114,79 @@

// cswap from RFC7748 "example code", adapted to BigInt.
//
// RFC: "dummy = mask(swap) AND (x_2 XOR x_3), where mask(swap) is the all-1 or all-0 word of the
// same length as x_2 and x_3". On fixed-width machine words both cases cost the same. BigInt has
// no fixed width, so a {0n, 1n} selector does not: V8 short-circuits `0n * v` - and, identically,
// `0n & v`, `v + 0n`, `v - 0n` - to a no-op, while `1n * v` is a real multiply. The ladder calls
// this with swap = k_t XOR k_(t+1), which would make total running time a linear function of how
// often adjacent bits of the secret scalar differ: remotely measurable, and worth ~4 bits of a
// long-term key.
//
// So select with a full-width mask instead, and interpolate rather than mask off a dummy.
/**
* Selector for cswap(): `P` to keep, `P + 1` to swap, chosen by the low bit of `swap`.
* Higher bits are ignored, and `swap` is passed in whole rather than as a {0n, 1n} bit on
* purpose: `P + (swap & _1n)` would short-circuit the addition whenever the bit is clear, which
* is the very leak this construction avoids, one round-trip further down. Subtracting `swap`
* with its low bit cleared keeps every operand full-width instead.
* @param P - Field modulus.
* @param swap - Value whose low bit selects; ignored above that bit.
* @returns `P` when the low bit is clear, `P + 1` when it is set.
*/
function cmask(P: bigint, swap: bigint): bigint {
return P + swap - ((swap >> _1n) << _1n);
}
/**
* Swap two field elements when `mask` is `P + 1`, keep them when it is `P`:
*
* d = 6P + x_3 - x_2
* x_2' = d * mask + x_2 (mod P) x_3' = (x_2 + x_3) - x_2'
*
* The extra `6P * mask` vanishes modulo P, so `mask === P` leaves x_2 and `mask === P + 1`
* leaves x_3. Without the offset, the reduction dividend changes sign with input order and crosses
* BigInt limb boundaries; those classes measured differently on the tested Node/V8 build. For
* canonical inputs, the deliberately left-associative `offset + x_3 - x_2` is between 5P and 7P,
* keeping the dividend positive and in one word-count band for both RFC fields and masks. Six is
* the smallest coefficient `c` for which the shared offset `cP` has that property.
*
* This reduced the tested sign/size timing ratios, but JavaScript BigInt has no constant-time
* contract and the contents of the multiply and remainder still vary. Valid ladder states can
* contain genuine zero coordinates; this construction does not mask those value-shape effects.
* Computing `x_3'` independently as `((6P + x_2 - x_3) * mask + x_3) % P` is more symmetric.
* On the tested Node/V8 build, it reduced the timing difference between keeping `(0, v)` and
* swapping `(v, 0)`—both return `(0, v)`—from about 10%/13% for X25519/X448 to about 3%.
* Successful calls cannot reach that zero-in-the-first-output case. For the case they can reach,
* swapping `(0, v)` and keeping `(v, 0)` both return `(v, 0)`; the difference instead grew from
* about 0.7%/1.1% to 2.7%/2.8%. The extra multiply/remainder also made public
* `getSharedSecret()` about 16% slower. The retained one-remainder form measured about 2.5%
* slower than the prior helper for public X25519 `getSharedSecret()` in the same environment.
* x_3' falls out of the sum, which a swap leaves invariant: no second multiply or reduction is
* needed. Bind `6P` once per field so production and the timing regression exercise the same
* configured helper without paying for the multiplication in every ladder round.
*
* The returned function is called twice per ladder round, so it validates nothing. Both elements
* MUST already be reduced mod P; unreduced input silently corrupts the kept-side output.
* @param P - Field modulus.
* @returns A field-bound swap function taking mask, x_2, and x_3.
*/
function cswap(
P: bigint
): (mask: bigint, x_2: bigint, x_3: bigint) => { x_2: bigint; x_3: bigint } {
const offset = BigInt(6) * P;
return (mask: bigint, x_2: bigint, x_3: bigint): { x_2: bigint; x_3: bigint } => {
const sum = x_2 + x_3;
const d = offset + x_3 - x_2;
const a = (d * mask + x_2) % P;
return { x_2: a, x_3: sum - a };
};
}
/** Internal helpers, exported for tests only. Not part of the public API. */
export const __TEST: { cmask: typeof cmask; cswap: typeof cswap } = /* @__PURE__ */ Object.freeze({
cmask,
cswap,
});
function validateOpts(curve: TArg<MontgomeryOpts>) {

@@ -118,2 +206,3 @@ // Validate constructor config eagerly, but do not call user-provided hooks here:

randomBytes: 'function',
scalarMultBase: 'function',
}

@@ -129,8 +218,33 @@ );

* @example
* Perform one X25519 key exchange through the generic Montgomery helper.
* Build an X25519 helper from curve parameters, then derive one public key.
*
* ```ts
* import { x25519 } from '@noble/curves/ed25519.js';
* const alice = x25519.keygen();
* const shared = x25519.getSharedSecret(alice.secretKey, alice.publicKey);
* import { montgomery } from '@noble/curves/abstract/montgomery.js';
* const P = 2n ** 255n - 19n;
* const mod = (num: bigint) => {
* const out = num % P;
* return out >= 0n ? out : out + P;
* };
* const pow = (num: bigint, power: bigint) => {
* let res = 1n;
* for (; power > 0n; power >>= 1n) {
* if (power & 1n) res = mod(res * num);
* num = mod(num * num);
* }
* return res;
* };
* const x25519 = montgomery({
* P,
* type: 'x25519',
* adjustScalarBytes(bytes: Uint8Array) {
* bytes[0] &= 248;
* bytes[31] &= 127;
* bytes[31] |= 64;
* return bytes;
* },
* powPminus2(x) {
* return pow(x, P - 2n);
* },
* });
* const publicKey = x25519.getPublicKey(new Uint8Array(32).fill(1));
* ```

@@ -141,2 +255,3 @@ */

const { P, type, adjustScalarBytes, powPminus2, randomBytes: rand } = CURVE;
const mulBaseHook = CURVE.scalarMultBase;
const is25519 = type === 'x25519';

@@ -147,2 +262,3 @@ if (!is25519 && type !== 'x448') throw new Error('invalid type');

const montgomeryBits = is25519 ? 255 : 448;
const swap = cswap(P);
const fieldLen = is25519 ? 32 : 56;

@@ -160,4 +276,4 @@ const Gu = is25519 ? BigInt(9) : BigInt(5);

const maxAdded = is25519
? BigInt(8) * _2n ** BigInt(251) - _1n
: BigInt(4) * _2n ** BigInt(445) - _1n;
? BigInt(8) * (_2n ** BigInt(251) - _1n)
: BigInt(4) * (_2n ** BigInt(445) - _1n);
const maxScalar = minScalar + maxAdded + _1n; // (inclusive)

@@ -183,7 +299,40 @@ const modP = (n: bigint) => mod(n, P);

}
/**
* u coordinates whose order divides the cofactor, on the curve and on its quadratic twist -
* the ladder sends every one of them to zero. Same blocklist libsodium and post-CVE-2017-0379
* Libgcrypt carry. decodeU() reduces mod P first, so the non-canonical encodings P and P + 1
* collapse onto 0 and 1, and `type` admits no curve beyond these two, so both lists are total.
*
* Complete by construction: x-only doubling sends u to (u^2 - 1)^2 / 4u(u^2 + a*u + 1). Order 4
* therefore needs (u^2 - 1)^2 === 0, i.e. u = +-1; order 2 needs u(u^2 + a*u + 1) === 0, and
* a^2 - 4 is a non-residue on both curves, leaving u = 0. curve448 stops there (cofactor 4);
* curve25519 (cofactor 8) adds the two order-8 roots below. Cross-checked by clearing the
* cofactor with those same doublings over 200k random u: no sixth value exists.
*/
const lowOrderU = new Set(
is25519
? [
_0n,
_1n,
P - _1n,
BigInt('325606250916557431795983626356110631294008115727848805560023387167927233504'),
BigInt('39382357235489614581723060781553021112529911719440698176882885853963445705823'),
]
: [_0n, _1n, P - _1n]
);
function scalarMult(scalar: TArg<Uint8Array>, u: TArg<Uint8Array>): TRet<Uint8Array> {
const pu = montgomeryLadder(decodeU(u), decodeScalar(scalar));
// Some public keys are useless, of low-order. Curve author doesn't think
// it needs to be validated, but we do it nonetheless.
// https://cr.yp.to/ecdh.html#validate
//
// Reject them BEFORE the ladder. RFC 7748 #6.1 also permits detecting them from the
// all-zero output, but that first runs all 255 rounds against the long-term secret,
// handing an unauthenticated attacker a free timing oracle. Low-order inputs also drive
// the ladder into a degenerate state (x_2 + z_2 === 0) whose extra zero-operand
// multiplications amplify any residual key-dependent timing.
const pointU = decodeU(u);
if (lowOrderU.has(pointU)) throw new Error('invalid private or public key received');
const pu = montgomeryLadder(pointU, decodeScalar(scalar));
// Unreachable for RFC 7748 clamped scalars, which are cofactor multiples smaller than the
// group order; kept because adjustScalarBytes is caller-supplied.
if (pu === _0n) throw new Error('invalid private or public key received');

@@ -193,4 +342,11 @@ return encodeU(pu);

// Computes public key from private. By doing scalar multiplication of base point.
// With a curve-provided fixed-base hook (Edwards tables), the ladder is skipped, but the
// contract — scalar validation, low-order rejection, encoding — stays identical.
function scalarMultBase(scalar: TArg<Uint8Array>): TRet<Uint8Array> {
return scalarMult(scalar, GuBytes);
if (mulBaseHook === undefined) return scalarMult(scalar, GuBytes);
const k = decodeScalar(scalar);
aInRange('scalar', k, minScalar, maxScalar);
const pu = modP(mulBaseHook(k));
if (pu === _0n) throw new Error('invalid private or public key received');
return encodeU(pu);
}

@@ -200,13 +356,2 @@ const getPublicKey = scalarMultBase;

// cswap from RFC7748 "example code"
function cswap(swap: bigint, x_2: bigint, x_3: bigint): { x_2: bigint; x_3: bigint } {
// dummy = mask(swap) AND (x_2 XOR x_3)
// Where mask(swap) is the all-1 or all-0 word of the same length as x_2
// and x_3, computed, e.g., as mask(swap) = 0 - swap.
const dummy = modP(swap * (x_2 - x_3));
x_2 = modP(x_2 - dummy); // x_2 = x_2 XOR dummy
x_3 = modP(x_3 + dummy); // x_3 = x_3 XOR dummy
return { x_2, x_3 };
}
/**

@@ -227,9 +372,11 @@ * Montgomery x-only multiplication ladder for the selected X25519/X448 curve.

let z_3 = _1n;
let swap = _0n;
// The RFC tracks `swap` across rounds to hold k_t XOR k_(t+1); the low bit of `kx >> t` is
// the same value, without the carried state. aInRange above pins bit (montgomeryBits - 1)
// of k set and everything above it clear, so `kx >> t` is never zero and its width is a
// function of t alone - never of a secret bit.
const kx = k ^ (k >> _1n);
for (let t = BigInt(montgomeryBits - 1); t >= _0n; t--) {
const k_t = (k >> t) & _1n;
swap ^= k_t;
({ x_2, x_3 } = cswap(swap, x_2, x_3));
({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3));
swap = k_t;
const mask = cmask(P, kx >> t);
({ x_2, x_3 } = swap(mask, x_2, x_3));
({ x_2: z_2, x_3: z_3 } = swap(mask, z_2, z_3));

@@ -252,4 +399,6 @@ const A = x_2 + z_2;

}
({ x_2, x_3 } = cswap(swap, x_2, x_3));
({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3));
// trailing cswap: the RFC's `swap` holds k_0 here, which is the low bit of k
const mask = cmask(P, k);
({ x_2, x_3 } = swap(mask, x_2, x_3));
({ x_2: z_2, x_3: z_3 } = swap(mask, z_2, z_3));
const z2 = powPminus2(z_2); // `Fp.pow(x, P - _2n)` is much slower equivalent

@@ -256,0 +405,0 @@ return modP(x_2 * z2); // Return x_2 * (z_2^(p - 2))

@@ -60,2 +60,3 @@ /**

concatBytes,
copyBytes,
numberToBytesBE,

@@ -67,3 +68,3 @@ randomBytes,

} from '../utils.ts';
import { pippenger, validatePointCons, type CurvePoint, type CurvePointCons } from './curve.ts';
import { mulAddUnsafe, validatePointCons, type CurvePoint, type CurvePointCons } from './curve.ts';
import { _DST_scalar, type H2CDSTOpts } from './hash-to-curve.ts';

@@ -363,3 +364,3 @@ import { getMinHashLength, mapHashToField } from './modular.ts';

blinded: TArg<PointBytes[]>,
rng: RNG
rng?: RNG
): TRet<OPRFBlindEvalBatch>;

@@ -457,2 +458,4 @@

const randomScalar = (rng: RNG = randomBytes) => {
if (typeof rng !== 'function')
throw new TypeError('"rng" expected function, got type=' + typeof rng);
// RFC 9497 §2.1 defines RandomScalar as nonzero; blind inversion and generated public keys

@@ -466,3 +469,6 @@ // both rely on keeping this helper in the `1..n-1` range.

const msm = (points: P[], scalars: bigint[]) => pippenger(Point, points, scalars);
// Every MSM input in this module is public (hash-derived transcript weights, wire-decoded
// points, proof scalars), so the vartime shared-doubling-chain walk is safe. It is also
// 1.6-2.5x faster than pippenger() for all realistic batch sizes (measured up to L=2048).
const msm = (points: P[], scalars: bigint[]) => mulAddUnsafe(Point, points, scalars);

@@ -557,4 +563,4 @@ const getCtx = (mode: number) =>

);
const t2 = Point.BASE.multiply(s).add(B.multiply(c)); // s*G + c*B
const t3 = M.multiply(s).add(Z.multiply(c)); // s*M + c*Z
const t2 = msm([Point.BASE, B], [s, c]); // s*G + c*B
const t3 = msm([M, Z], [s, c]); // s*M + c*Z
const expectedC = challengeTranscript(B, M, Z, t2, t3, ctx);

@@ -682,3 +688,10 @@ if (!Fn.eql(c, expectedC)) throw new Error('proof verification failed');

verifyProof(ctxVOPRF, pkS, blindedPoints, evalPoints, proof);
return items.map((i) => oprf.finalize(i.input, i.blind, i.evaluated)) as TRet<Bytes[]>;
// Same unblind+hash as oprf.finalize(), but reuses the evaluated points already decoded
// (and identity-checked) for verifyProof instead of deserializing each one again.
return items.map((i, j) => {
const input = inputBytes('input', i.input);
const blind = Fn.fromBytes(i.blind);
const unblinded = evalPoints[j].multiply(Fn.inv(blind)).toBytes();
return hashInput(input, unblinded);
}) as TRet<Bytes[]>;
},

@@ -700,3 +713,3 @@ finalize(

const poprf = (info: TArg<Bytes>) => {
info = inputBytes('info', info);
info = copyBytes(inputBytes('info', info));
const m = hashToScalarPrefixed(encode('Info', info), ctxPOPRF);

@@ -703,0 +716,0 @@ const T = Point.BASE.multiply(m);

@@ -10,4 +10,4 @@ /**

/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { asafenumber, bitGet, validateObject, type TArg, type TRet } from '../utils.ts';
import { FpInvertBatch, FpPow, type IField, validateField } from './modular.ts';
import { aarray, asafenumber, bitGet, validateObject, type TArg, type TRet } from '../utils.ts';
import { FpInvertBatch, FpPow, validateField, type IField } from './modular.ts';

@@ -54,2 +54,3 @@ // Grain LFSR (Linear-Feedback Shift Register): https://eprint.iacr.org/2009/109.pdf

function assertValidPosOpts(opts: TArg<PoseidonBasicOpts>) {
validateObject(opts as any, {}, {}, 'opts');
const { Fp, roundsFull } = opts;

@@ -147,2 +148,3 @@ validateField(Fp);

): PoseidonConstants {
assertValidPosOpts(opts);
const { Fp, t, roundsFull, roundsPartial } = opts;

@@ -171,3 +173,5 @@ // `skipMDS` counts how many candidate matrices to discard before taking one.

}
mds.push(FpInvertBatch(Fp, row));
// `row` is guaranteed non-zero (the loop throws on a zero entry above), so `passZero` only
// pins the `bigint[]` return type; it does not change any value here.
mds.push(FpInvertBatch(Fp, row, true));
}

@@ -223,8 +227,13 @@

// MDS is TxT matrix
if (!Array.isArray(mds) || mds.length !== t) throw new Error('Poseidon: invalid MDS matrix');
const _mds = mds.map((mdsRow) => {
if (!Array.isArray(mdsRow) || mdsRow.length !== t)
throw new Error('invalid MDS matrix row: ' + mdsRow);
return mdsRow.map((i) => {
if (typeof i !== 'bigint') throw new Error('invalid MDS matrix bigint: ' + i);
aarray(mds, 'opts.mds');
if (mds.length !== t) throw new Error('Poseidon: invalid MDS matrix');
const _mds = mds.map((mdsRow, row) => {
aarray(mdsRow, 'opts.mds[' + row + ']');
if (mdsRow.length !== t)
throw new Error('"opts.mds[' + row + ']" expected length ' + t + ', got ' + mdsRow.length);
return mdsRow.map((i, col) => {
if (typeof i !== 'bigint')
throw new Error(
'"opts.mds[' + row + '][' + col + ']" expected bigint, got type=' + typeof i
);
// Hardcoded Poseidon MDS matrices often use signed entries like `-1`;

@@ -347,8 +356,13 @@ // accept bigint representatives here and reduce them into the field.

const poseidonRound = (values: bigint[], isFull: boolean, idx: number) => {
values = values.map((i, j) => Fp.add(i, roundConstants[idx][j]));
if (isFull) values = values.map((i) => sboxFn(i));
else values[partialIdx] = sboxFn(values[partialIdx]);
// Matrix multiplication
values = mds.map((i) => i.reduce((acc, i, j) => Fp.add(acc, Fp.mulN(i, values[j])), Fp.ZERO));
const rc = roundConstants[idx];
if (isFull) values = values.map((i, j) => sboxFn(Fp.add(i, rc[j])));
else {
values = values.map((i, j) => Fp.add(i, rc[j]));
values[partialIdx] = sboxFn(values[partialIdx]);
}
// Matrix multiplication. Row entries and values are reduced (< p), so each product is < p²
// and a row sum is < t⋅p²: accumulate without mod, reduce once per row instead of per cell.
values = mds.map((row) =>
Fp.create(row.reduce((acc, m, j) => Fp.addN(acc, Fp.mulN(m, values[j])), Fp.ZERO))
);
return values;

@@ -414,2 +428,8 @@ };

constructor(Fp: IField<bigint>, rate: number, capacity: number, hash: PoseidonFn) {
validateField(Fp);
asafenumber(rate, 'rate');
asafenumber(capacity, 'capacity');
if (typeof hash !== 'function')
throw new TypeError('"hash" expected function, got type=' + typeof hash);
if (hash.roundConstants !== undefined) aarray(hash.roundConstants, 'hash.roundConstants');
const width = spongeShape(rate, capacity);

@@ -419,6 +439,7 @@ // The direct constructor accepts an arbitrary permutation hook, but callers still

// mismatches here instead of deferring them until the first `process()` call.
if (width !== hash.roundConstants[0]?.length)
if (width !== hash.roundConstants?.[0]?.length) {
throw new Error(
`invalid sponge width: expected ${hash.roundConstants[0]?.length}, got ${width}`
`invalid sponge width: expected ${hash.roundConstants?.[0]?.length}, got ${width}`
);
}
this.Fp = Fp;

@@ -437,2 +458,3 @@ this.hash = hash;

absorb(input: bigint[]): void {
if (!Array.isArray(input)) throw new Error('invalid input: expected array');
for (const i of input)

@@ -535,2 +557,3 @@ if (typeof i !== 'bigint' || !this.Fp.isValid(i)) throw new Error('invalid input: ' + i);

export function poseidonSponge(opts: TArg<PoseidonSpongeOpts>): TRet<() => PoseidonSponge> {
validateObject(opts as any, {}, {}, 'opts');
const { rate, capacity } = opts;

@@ -537,0 +560,0 @@ const t = spongeShape(rate, capacity);

@@ -25,2 +25,3 @@ /**

} from '../utils.ts';
import { validatePointCons } from './curve.ts';
import * as mod from './modular.ts';

@@ -124,6 +125,2 @@ import type { WeierstrassPoint, WeierstrassPointCons } from './weierstrass.ts';

fromBigTwelve: (t: BigintTwelve) => Fp12;
/** Multiply by a sparse `(o0, o1, 0, 0, o4, 0)` element. */
mul014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12;
/** Multiply by a sparse `(o0, 0, 0, o3, o4, 0)` element. */
mul034(num: Fp12, o0: Fp2, o3: Fp2, o4: Fp2): Fp12;
/** Multiply by one quadratic-extension element. */

@@ -150,9 +147,18 @@ mulByFp2(lhs: Fp12, rhs: Fp2): Fp12;

asafenumber(num, 'num');
asafenumber(degree, 'degree');
const divisorN = divisor === undefined ? degree : divisor;
asafenumber(divisorN, 'divisor');
const F = Fp as mod.IField<T>;
// Generic callers can hit empty / fractional row counts through `__TEST`; fail closed instead of
// silently returning `[]` or deriving extra Frobenius rows from a truncated loop bound.
// Generic callers reach this through `__TEST`; validate before bigint operators can throw raw
// native RangeError/TypeError diagnostics for malformed tower parameters.
if (typeof modulus !== 'bigint' || modulus <= _1n)
throw new Error('calcFrobeniusCoefficients: expected valid modulus, got ' + modulus);
if (degree <= 0)
throw new Error('calcFrobeniusCoefficients: expected positive degree, got ' + degree);
if (num <= 0)
throw new Error('calcFrobeniusCoefficients: expected positive row count, got ' + num);
const _divisor = BigInt(divisor === undefined ? degree : divisor);
const towerModulus: any = modulus ** BigInt(degree);
if (divisorN <= 0)
throw new Error('calcFrobeniusCoefficients: expected positive divisor, got ' + divisorN);
const _divisor = BigInt(divisorN);
const towerModulus = modulus ** BigInt(degree);
const res: T[][] = [];

@@ -217,2 +223,21 @@ // Derive tower-basis multipliers for the `p^k` Frobenius action. The

} {
mod.validateField(Fp);
mod.validateField(Fp2);
validateObject(
Fp2 as unknown as Record<string, any>,
{
Fp: 'object',
frobeniusMap: 'function',
fromBigTuple: 'function',
mulByB: 'function',
mulByNonresidue: 'function',
reim: 'function',
Fp4Square: 'function',
NONRESIDUE: 'object',
},
{}
);
if (!isObj(base) || Array.isArray(base))
throw new TypeError('"base" expected Fp2 element, got type=' + typeof base);
if (!Fp2.isValid(base as Fp2)) throw new RangeError('"base" expected valid Fp2 element');
// GLV endomorphism Ψ(P)

@@ -240,2 +265,7 @@ const PSI_X = Fp2.pow(base, (Fp.ORDER - _1n) / _3n); // u^((p-1)/3)

(c: WeierstrassPointCons<T>, P: WeierstrassPoint<T>) => {
if (typeof (c as unknown) !== 'function')
throw new TypeError('"c" expected point constructor, got type=' + typeof c);
validatePointCons(c);
if (!(P instanceof c))
throw new TypeError('"P" expected Point instance, got type=' + typeof P);
const affine = P.toAffine();

@@ -262,3 +292,4 @@ const p = fn(affine.x, affine.y);

* Optional custom quadratic square-root helper.
* Receives one quadratic-extension element and returns one square root.
* @param num - Quadratic-extension element.
* @returns One square root.
*/

@@ -294,3 +325,2 @@ Fp2sqrt?: (num: Fp2) => Fp2;

readonly Fp_div2: bigint;
readonly FROBENIUS_COEFFICIENTS: readonly Fp[];

@@ -322,6 +352,5 @@ constructor(

this.NONRESIDUE = this.create({ c0: FP2_NONRESIDUE![0], c1: FP2_NONRESIDUE![1] });
// const Fp2Nonresidue = this.create({ c0: FP2_NONRESIDUE![0], c1: FP2_NONRESIDUE![1] });
this.FROBENIUS_COEFFICIENTS = Object.freeze(
calcFrobeniusCoefficients(Fp, this.Fp_NONRESIDUE, Fp.ORDER, 2)[0]
);
// NOTE: no Fp2 FROBENIUS_COEFFICIENTS table: for the shipped `u² = -1` tower the coefficients
// are always [1, -1] (x²+1 irreducible forces p ≡ 3 mod 4), so frobeniusMap conjugates
// directly and the eager table computation was pure import-time waste.
this.mulByB = (num) => {

@@ -380,3 +409,3 @@ // This config hook is trusted to return a canonical Fp2 value already.

invertBatch(nums: Fp2[]): Fp2[] {
return mod.FpInvertBatch(this, nums);
return mod.FpInvertBatch(this, nums, true);
}

@@ -524,9 +553,18 @@ // Normalized

mulByNonresidue({ c0, c1 }: Fp2) {
return this.mul({ c0, c1 }, this.NONRESIDUE);
const { Fp, NONRESIDUE: nr } = this;
if (nr.c0 === Fp.ONE && nr.c1 === Fp.ONE) {
return Object.freeze({ c0: Fp.sub(c0, c1), c1: Fp.add(c0, c1) });
}
if (nr.c1 === Fp.ONE) {
return Object.freeze({
c0: Fp.sub(Fp.mul(c0, nr.c0), c1),
c1: Fp.add(c0, Fp.mul(c1, nr.c0)),
});
}
return this.mul({ c0, c1 }, nr);
}
frobeniusMap({ c0, c1 }: Fp2, power: number): Fp2 {
return Object.freeze({
c0,
c1: this.Fp.mul(c1, this.FROBENIUS_COEFFICIENTS[power % 2]),
});
frobeniusMap(num: Fp2, power: number): Fp2 {
const { c0, c1 } = num;
const { Fp } = this;
return Object.freeze({ c0, c1: power % 2 === 0 ? c1 : Fp.neg(c1) });
}

@@ -693,3 +731,3 @@ }

invertBatch(nums: Fp6[]): Fp6[] {
return mod.FpInvertBatch(this, nums);
return mod.FpInvertBatch(this, nums, true);
}

@@ -744,3 +782,5 @@

}
frobeniusMap({ c0, c1, c2 }: Fp6, power: number) {
frobeniusMap(num: Fp6, power: number) {
const { c0, c1, c2 } = num;
if (power % 6 === 0) return Object.freeze({ c0, c1, c2 });
const { Fp2 } = this;

@@ -900,3 +940,3 @@ return Object.freeze({

invertBatch(nums: Fp12[]): Fp12[] {
return mod.FpInvertBatch(this, nums);
return mod.FpInvertBatch(this, nums, true);
}

@@ -999,6 +1039,9 @@

frobeniusMap(lhs: Fp12, power: number) {
const p = power % 12;
if (p === 0) return Object.freeze({ c0: lhs.c0, c1: lhs.c1 });
if (p === 6) return this.conjugate(lhs);
const { Fp6 } = this;
const { Fp2 } = Fp6;
const { c0, c1, c2 } = Fp6.frobeniusMap(lhs.c1, power);
const coeff = this.FROBENIUS_COEFFICIENTS[power % 12];
const coeff = this.FROBENIUS_COEFFICIENTS[p];
return Object.freeze({

@@ -1024,30 +1067,2 @@ c0: Fp6.frobeniusMap(lhs.c0, power),

}
// Sparse multiplication
mul014({ c0, c1 }: Fp12, o0: Fp2, o1: Fp2, o4: Fp2) {
const { Fp6 } = this;
const { Fp2 } = Fp6;
let t0 = Fp6.mul01(c0, o0, o1);
let t1 = Fp6.mul1(c1, o4);
return Object.freeze({
c0: Fp6.add(Fp6.mulByNonresidue(t1), t0), // T1 * v + T0
// (c1 + c0) * [o0, o1+o4] - T0 - T1
c1: Fp6.sub(Fp6.sub(Fp6.mul01(Fp6.add(c1, c0), o0, Fp2.add(o1, o4)), t0), t1),
});
}
mul034({ c0, c1 }: Fp12, o0: Fp2, o3: Fp2, o4: Fp2) {
const { Fp6 } = this;
const { Fp2 } = Fp6;
const a = Object.freeze({
c0: Fp2.mul(c0.c0, o0),
c1: Fp2.mul(c0.c1, o0),
c2: Fp2.mul(c0.c2, o0),
});
const b = Fp6.mul01(c1, o3, o4);
const e = Fp6.mul01(Fp6.add(c0, c1), Fp2.add(o0, o3), o4);
return Object.freeze({
c0: Fp6.add(Fp6.mulByNonresidue(b), a),
c1: Fp6.sub(e, Fp6.add(a, b)),
});
}
// A cyclotomic group is a subgroup of Fp^n defined by

@@ -1085,4 +1100,5 @@ // GΦₙ(p) = {α ∈ Fpⁿ : α^Φₙ(p) = 1}

aInRange('cyclotomic exponent', n, _0n, _1n << BigInt(this.X_LEN));
let z = this.ONE;
for (let i = this.X_LEN - 1; i >= 0; i--) {
if (n === _0n) return this.ONE;
let z = num;
for (let i = bitLen(n) - 2; i >= 0; i--) {
z = this._cyclotomicSquare(z);

@@ -1105,2 +1121,3 @@ if (bitGet(n, i)) z = this.mul(z, num);

* ```ts
* import { tower12, type Fp2, type Fp12 } from '@noble/curves/abstract/tower.js';
* const fields = tower12({

@@ -1110,4 +1127,4 @@ * ORDER: 17n,

* FP2_NONRESIDUE: [1n, 1n],
* Fp2mulByB: (num) => num,
* Fp12finalExponentiate: (num) => num,
* Fp2mulByB: (num: Fp2) => num,
* Fp12finalExponentiate: (num: Fp12) => num,
* });

@@ -1114,0 +1131,0 @@ * const fp12 = fields.Fp12.ONE;

@@ -86,5 +86,3 @@ /**

bitLen,
bitMask,
bytesToHex,
bytesToNumberBE,
concatBytes,

@@ -99,7 +97,6 @@ copyBytes,

// Types
import { isogenyMap } from './abstract/hash-to-curve.ts';
import { isogenyMap, mapToCurveSimpleSWU } from './abstract/hash-to-curve.ts';
import type { BigintTuple, Fp, Fp12, Fp2, Fp6 } from './abstract/tower.ts';
import { psiFrobenius, tower12 } from './abstract/tower.ts';
import {
mapToCurveSimpleSWU,
weierstrass,

@@ -164,2 +161,87 @@ type AffinePoint,

}) as TRet<IField<bigint>>;
type Fp12Compressed = { g2: Fp2; g3: Fp2; g4: Fp2; g5: Fp2 };
// Karabina's G2345 compression for the cyclotomic subgroup. Noble stores Fp12 as
// (c0 + c1*w), so (g0, g1, g2, g3, g4, g5) map to (c0.c0, c1.c1, c1.c0, c0.c2, c0.c1, c1.c2).
function bls12FromCompressed(g0: Fp2, g1: Fp2, { g2, g3, g4, g5 }: Fp12Compressed): Fp12 {
return { c0: { c0: g0, c1: g4, c2: g3 }, c1: { c0: g2, c1: g1, c2: g5 } };
}
function bls12Compress({ c0, c1 }: Fp12): Fp12Compressed {
return { g2: c1.c0, g3: c0.c2, g4: c0.c1, g5: c1.c2 };
}
function bls12CyclotomicSquareCompressed({ g2, g3, g4, g5 }: Fp12Compressed): Fp12Compressed {
const { first: h23c0, second: h23c1 } = Fp2.Fp4Square(g4, g5);
const { first: h45c0, second: h45c1 } = Fp2.Fp4Square(g2, g3);
const d2 = Fp2.add(g2, g2);
const d3 = Fp2.add(g3, g3);
const d4 = Fp2.add(g4, g4);
const d5 = Fp2.add(g5, g5);
return {
g2: Fp2.add(Fp2.mul(Fp2.mulByNonresidue(h23c1), _3n), d2),
g3: Fp2.sub(Fp2.mul(h23c0, _3n), d3),
g4: Fp2.sub(Fp2.mul(h45c0, _3n), d4),
g5: Fp2.add(Fp2.mul(h45c1, _3n), d5),
};
}
function bls12RecoverG1Ratio({ g2, g3, g4, g5 }: Fp12Compressed): { num: Fp2; den: Fp2 } {
if (Fp2.is0(g2)) return { num: Fp2.mul(Fp2.mul(g4, g5), _2n), den: g3 };
return {
num: Fp2.add(
Fp2.sub(Fp2.mul(Fp2.sqr(g4), _3n), Fp2.mul(g3, _2n)),
Fp2.mulByNonresidue(Fp2.sqr(g5))
),
den: Fp2.mul(g2, _4n),
};
}
function bls12RecoverG0(g1: Fp2, { g2, g3, g4, g5 }: Fp12Compressed): Fp2 {
const g3g4 = Fp2.mul(g3, g4);
const t = Fp2.add(Fp2.sub(Fp2.mul(Fp2.sub(Fp2.sqr(g1), g3g4), _2n), g3g4), Fp2.mul(g2, g5));
return Fp2.add(Fp2.mulByNonresidue(t), Fp2.ONE);
}
function bls12CyclotomicExpCompressed(
num: Fp12,
squarings: readonly [number, number, number]
): { result: Fp12; last: Fp12 } {
const gs: Fp12Compressed[] = [];
let g = bls12Compress(num);
for (const count of squarings) {
for (let i = 0; i < count; i++) g = bls12CyclotomicSquareCompressed(g);
gs.push(g);
}
// Karabina decompression is undefined at g2 = g3 = 0. Every element decompressed here lies in
// the cyclotomic subgroup GΦ₁₂, where the only such element is the identity: unitarity
// (z⋅z^(p⁶) = 1) forces g4² = ξ⋅g5², so g4 = g5 = 0 because ξ is a non-square in Fp2, leaving
// z ∈ Fp4* ∩ GΦ₁₂ — trivial since gcd(p⁴−p²+1, p⁴−1) = gcd(3, p²−2) = 1 for p ≡ 1 mod 3.
// Handle the identity explicitly instead of relying on invertBatch's passZero mapping the zero
// denominator to 0 (which happens to reconstruct ONE, but only by coincidence of formulas).
const isOne = gs.map(({ g2, g3 }) => Fp2.is0(g2) && Fp2.is0(g3));
const ratios = gs.map(bls12RecoverG1Ratio);
const invDens = Fp2.invertBatch(ratios.map(({ den }) => den));
const elems = gs.map((compressed, i) => {
if (isOne[i]) return Fp12.ONE;
const g1 = Fp2.mul(ratios[i].num, invDens[i]);
return bls12FromCompressed(bls12RecoverG0(g1, compressed), g1, compressed);
});
return { result: Fp12.mul(Fp12.mul(elems[0], elems[1]), elems[2]), last: elems[2] };
}
function bls12CyclotomicExpX(num: Fp12): Fp12 {
// BLS_X = 2^63 + 2^62 + 2^60 + 2^57 + 2^48 + 2^16.
const { result, last } = bls12CyclotomicExpCompressed(num, [16, 32, 9]);
let r = result;
let s = last;
for (let i = 0; i < 3; i++) s = Fp12._cyclotomicSquare(s);
r = Fp12.mul(r, s);
for (let i = 0; i < 2; i++) s = Fp12._cyclotomicSquare(s);
r = Fp12.mul(r, s);
s = Fp12._cyclotomicSquare(s);
return Fp12.mul(r, s);
}
const { Fp, Fp2, Fp6, Fp12 } = tower12({

@@ -174,4 +256,4 @@ ORDER: bls12_381_CURVE_G1.p,

Fp2mulByB: ({ c0, c1 }: Fp2) => {
const t0 = Fp.mul(c0, _4n); // 4 * c0
const t1 = Fp.mul(c1, _4n); // 4 * c1
const t0 = Fp.mul(c0, _4n);
const t1 = Fp.mul(c1, _4n);
// (T0-T1) + (T0+T1)*i

@@ -181,3 +263,3 @@ return { c0: Fp.sub(t0, t1), c1: Fp.add(t0, t1) };

Fp12finalExponentiate: (num: Fp12) => {
const x = BLS_X;
const powMinusX = (num: Fp12) => Fp12.conjugate(bls12CyclotomicExpX(num));
// this^(q⁶) / this

@@ -187,8 +269,8 @@ const t0 = Fp12.div(Fp12.frobeniusMap(num, 6), num);

const t1 = Fp12.mul(Fp12.frobeniusMap(t0, 2), t0);
const t2 = Fp12.conjugate(Fp12._cyclotomicExp(t1, x));
const t2 = powMinusX(t1);
const t3 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicSquare(t1)), t2);
const t4 = Fp12.conjugate(Fp12._cyclotomicExp(t3, x));
const t5 = Fp12.conjugate(Fp12._cyclotomicExp(t4, x));
const t6 = Fp12.mul(Fp12.conjugate(Fp12._cyclotomicExp(t5, x)), Fp12._cyclotomicSquare(t2));
const t7 = Fp12.conjugate(Fp12._cyclotomicExp(t6, x));
const t4 = powMinusX(t3);
const t5 = powMinusX(t4);
const t6 = Fp12.mul(powMinusX(t5), Fp12._cyclotomicSquare(t2));
const t7 = powMinusX(t6);
const t2_t5_pow_q2 = Fp12.frobeniusMap(Fp12.mul(t2, t5), 2);

@@ -288,4 +370,4 @@ const t4_t1_pow_q3 = Fp12.frobeniusMap(Fp12.mul(t4, t1), 3);

return Fp2.create({
c0: Fp.create(bytesToNumberBE(bytes.subarray(L))),
c1: Fp.create(bytesToNumberBE(bytes.subarray(0, L))),
c0: decodeFp(bytes.subarray(L)),
c1: decodeFp(bytes.subarray(0, L)),
});

@@ -295,2 +377,5 @@ },

const BaseFp = Fp;
function decodeFp(bytes: TArg<Uint8Array>): Fp {
return Fp.fromBytes(bytes);
}
type Mask = { compressed: boolean; infinity: boolean; sort: boolean };

@@ -333,4 +418,4 @@ // Keep BLS12-381 point/signature codecs on one control-flow skeleton: the G1/G2

if (infinity) {
// Infinity canonicality has to be checked on raw bytes before decode()
// reduces coordinates modulo p and turns non-empty payloads into zero.
// Infinity has a dedicated encoding: after the flag bits are cleared, every
// remaining payload byte must be zero.
for (const b of value) {

@@ -350,4 +435,4 @@ if (b) throw new Error(`invalid ${name} point: non-canonical zero`);

}
// Noble keeps the permissive coordinate reduction path here, but an
// omitted infinity flag must not still decode to ZERO afterwards.
// The all-zero uncompressed payload must use the infinity flag instead of
// decoding as an ordinary affine point.
if (!compressed && F.is0(x) && F.is0(y))

@@ -373,3 +458,2 @@ throw new Error(`invalid ${name} point: uncompressed`);

// Copy, so we can remove mask data.
// It will be removed also later, when Fp.create will call modulo.
bytes = copyBytes(bytes);

@@ -402,3 +486,3 @@ const mask = bytes[0] & 0b1110_0000;

(x: Fp) => numberToBytesBE(x, Fp.BYTES),
(bytes: TArg<Uint8Array>) => Fp.create(bytesToNumberBE(bytes) & bitMask(Fp.BITS)),
decodeFp,
(y: Fp) => [y]

@@ -405,0 +489,0 @@ );

@@ -111,2 +111,32 @@ /**

let Fp12: ReturnType<typeof tower12>['Fp12'];
const bn254CyclotomicExpX = (num: Fp12): Fp12 => {
const cyclSqrN = (n: Fp12, count: number) => {
for (let i = 0; i < count; i++) n = Fp12._cyclotomicSquare(n);
return n;
};
// Addition chain for BN_X = 0x44e992b44a6909f1. This keeps the same cyclotomic-square
// count as binary exponentiation, but cuts Fp12 multiplications by about a third.
const x10 = Fp12._cyclotomicSquare(num);
const x100 = Fp12._cyclotomicSquare(x10);
const x1000 = Fp12._cyclotomicSquare(x100);
const x10000 = Fp12._cyclotomicSquare(x1000);
const x10001 = Fp12.mul(x10000, num);
const x10011 = Fp12.mul(x10001, x10);
const x10100 = Fp12.mul(x10011, num);
const x11001 = Fp12.mul(x1000, x10001);
const x100010 = Fp12._cyclotomicSquare(x10001);
const x100111 = Fp12.mul(x10011, x10100);
const x101001 = Fp12.mul(x10, x100111);
let r = cyclSqrN(x100010, 6);
r = Fp12.mul(Fp12.mul(r, x100), x11001);
r = Fp12.mul(cyclSqrN(r, 7), x11001);
r = cyclSqrN(r, 8);
r = Fp12.mul(Fp12.mul(r, x101001), x10);
r = Fp12.mul(cyclSqrN(r, 6), x10001);
r = Fp12.mul(cyclSqrN(r, 8), x101001);
r = Fp12.mul(cyclSqrN(r, 6), x101001);
r = Fp12.mul(cyclSqrN(r, 10), x100111);
r = Fp12.mul(Fp12.mul(cyclSqrN(r, 6), x101001), x1000);
return r;
};
const tower = /* @__PURE__ */ (() => {

@@ -121,3 +151,3 @@ const res = tower12({

Fp12finalExponentiate: (num: Fp12) => {
const powMinusX = (num: Fp12) => Fp12.conjugate(Fp12._cyclotomicExp(num, BN_X));
const powMinusX = (num: Fp12) => Fp12.conjugate(bn254CyclotomicExpX(num));
const r0 = Fp12.mul(Fp12.conjugate(num), Fp12.inv(num));

@@ -124,0 +154,0 @@ const r = Fp12.mul(Fp12.frobeniusMap(r0, 2), r0);

@@ -127,2 +127,19 @@ /**

const Fp = /* @__PURE__ */ (() => ed25519_Point.Fp)();
function toMontgomery(point: EdwardsPoint): TRet<Uint8Array> {
// Birational map from Ed25519 to Curve25519 / X25519:
// (u, v) = ((1 + y) / (1 - y), sqrt(-486664) * u / x)
// (x, y) = (sqrt(-486664) * u / v, (u - 1) / (u + 1))
const { y } = point;
return Fp.toBytes(Fp.div(_1n + y, _1n - y)) as TRet<Uint8Array>;
}
function toMontgomerySecret(secretKey: TArg<Uint8Array>): TRet<Uint8Array> {
const size = ed25519_Point.Fp.BYTES;
abytes(secretKey, size);
return adjustScalarBytes(sha512(secretKey.subarray(0, size))).subarray(
0,
size
) as TRet<Uint8Array>;
}
const Fn = /* @__PURE__ */ (() => ed25519_Point.Fn)();

@@ -151,3 +168,6 @@

sha512,
Object.assign({ adjustScalarBytes, zip215: true }, opts as EdDSAOpts)
Object.assign(
{ adjustScalarBytes, toMontgomery, toMontgomerySecret, zip215: true },
opts as EdDSAOpts
)
);

@@ -244,2 +264,3 @@ }

* const bob = x25519.keygen();
* const alicePublic = x25519.getPublicKey(alice.secretKey);
* const shared = x25519.getSharedSecret(alice.secretKey, bob.publicKey);

@@ -250,11 +271,25 @@ * ```

const P = ed25519_CURVE_p;
const powPminus2 = (x: bigint): bigint => {
// x^(p-2) aka x^(2^255-21)
const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x);
return mod(pow2(pow_p_5_8, _3n, P) * b2, P);
};
return montgomery({
P,
type: 'x25519',
powPminus2: (x: bigint): bigint => {
// x^(p-2) aka x^(2^255-21)
const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x);
return mod(pow2(pow_p_5_8, _3n, P) * b2, P);
powPminus2,
adjustScalarBytes,
// ~3x faster fixed-base: [k]B on the birationally-equivalent Edwards curve using cached
// base tables, mapped back via u = (1+y)/(1-y) = (Z+Y)/(Z-Y) with one Fermat inversion.
// Same construction as libsodium's crypto_scalarmult_curve25519_base.
scalarMultBase: (k: bigint): bigint => {
// Clamped k (≈2^254) exceeds n, but B has prime order n, so [k]B == [k mod n]B.
const kn = mod(k, ed25519_Point.Fn.ORDER);
// k ≡ 0 (mod n): [k]B is the point at infinity, whose u is 0 in the x-only ladder;
// returning 0 makes montgomery() reject it exactly like the ladder path.
if (kn === _0n) return _0n;
const p = ed25519_Point.BASE.multiply(kn);
// Z-Y == 0 only at the identity, which kn != 0 excludes.
return mod((p.Z + p.Y) * powPminus2(mod(p.Z - p.Y, P)), P);
},
adjustScalarBytes,
});

@@ -270,2 +305,3 @@ })();

const ELL2_C3 = /* @__PURE__ */ (() => Fp.sqrt(Fp.neg(Fp.ONE)))(); // 3. c3 = sqrt(-1)
const ELL2_J = /* @__PURE__ */ BigInt(486662);

@@ -280,5 +316,4 @@ /**

} {
const ELL2_C4 = (ed25519_CURVE_p - _5n) / _8n; // 4. c4 = (q - 5) / 8 # Integer arithmetic
const ELL2_J = BigInt(486662);
// 4. c4 = (q - 5) / 8: tv2^c4 below reuses the ed25519_pow_2_252_3 addition chain,
// whose pow_p_5_8 output is exactly x^((p-5)/8).
let tv1 = Fp.sqr(u); // 1. tv1 = u^2

@@ -300,3 +335,3 @@ tv1 = Fp.mul(tv1, _2n); // 2. tv1 = 2 * tv1

tv2 = Fp.mul(tv2, tv3); // 15. tv2 = tv2 * tv3 # gx1 * gxd^7
let y11 = Fp.pow(tv2, ELL2_C4); // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8)
let y11 = ed25519_pow_2_252_3(tv2).pow_p_5_8; // 16. y11 = tv2^c4 # (gx1 * gxd^7)^((p - 5) / 8)
y11 = Fp.mul(y11, tv3); // 17. y11 = y11 * tv3 # gx1*gxd^3*(gx1*gxd^7)^((p-5)/8)

@@ -417,20 +452,18 @@ let y12 = Fp.mul(y11, ELL2_C3); // 18. y12 = y11 * c3

const { d } = ed25519_CURVE;
const P = ed25519_CURVE_p;
const mod = (n: bigint) => Fp.create(n);
const r = mod(SQRT_M1 * r0 * r0); // 1
const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); // 2
const r = Fp.mul(Fp.mulN(SQRT_M1, r0), r0); // 1
const Ns = Fp.mul(Fp.addN(r, _1n), ONE_MINUS_D_SQ); // 2
let c = BigInt(-1); // 3
const D = mod((c - d * r) * mod(r + d)); // 4
const D = Fp.mul(Fp.subN(c, Fp.mulN(d, r)), Fp.add(r, d)); // 4
let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); // 5
let s_ = mod(s * r0); // 6
if (!isNegativeLE(s_, P)) s_ = mod(-s_);
let s_ = Fp.mul(s, r0); // 6
if (!Fp.isOdd!(s_)) s_ = Fp.neg(s_);
if (!Ns_D_is_sq) s = s_; // 7
if (!Ns_D_is_sq) c = r; // 8
const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); // 9
const s2 = s * s;
const W0 = mod((s + s) * D); // 10
const W1 = mod(Nt * SQRT_AD_MINUS_ONE); // 11
const W2 = mod(_1n - s2); // 12
const W3 = mod(_1n + s2); // 13
return new ed25519_Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2));
const Nt = Fp.sub(Fp.mulN(Fp.mulN(c, Fp.subN(r, _1n)), D_MINUS_ONE_SQ), D); // 9
const s2 = Fp.sqrN(s);
const W0 = Fp.mul(Fp.addN(s, s), D); // 10
const W1 = Fp.mul(Nt, SQRT_AD_MINUS_ONE); // 11
const W2 = Fp.sub(_1n, s2); // 12
const W3 = Fp.add(_1n, s2); // 13
return new ed25519_Point(Fp.mul(W0, W3), Fp.mul(W2, W1), Fp.mul(W1, W3), Fp.mul(W0, W2));
}

@@ -488,25 +521,22 @@

const { a, d } = ed25519_CURVE;
const P = ed25519_CURVE_p;
const mod = (n: bigint) => Fp.create(n);
const s = bytes255ToNumberLE(bytes);
// 1. Check that s_bytes is the canonical encoding of a field element, or else abort.
// 3. Check that s is non-negative, or else abort
if (!equalBytes(Fp.toBytes(s), bytes) || isNegativeLE(s, P))
if (!equalBytes(Fp.toBytes(s), bytes) || Fp.isOdd!(s))
throw new Error('invalid ristretto255 encoding 1');
const s2 = mod(s * s);
const u1 = mod(_1n + a * s2); // 4 (a is -1)
const u2 = mod(_1n - a * s2); // 5
const u1_2 = mod(u1 * u1);
const u2_2 = mod(u2 * u2);
const v = mod(a * d * u1_2 - u2_2); // 6
const { isValid, value: I } = invertSqrt(mod(v * u2_2)); // 7
const Dx = mod(I * u2); // 8
const Dy = mod(I * Dx * v); // 9
let x = mod((s + s) * Dx); // 10
if (isNegativeLE(x, P)) x = mod(-x); // 10
const y = mod(u1 * Dy); // 11
const t = mod(x * y); // 12
if (!isValid || isNegativeLE(t, P) || y === _0n)
throw new Error('invalid ristretto255 encoding 2');
return new _RistrettoPoint(new ed25519_Point(x, y, _1n, t));
const s2 = Fp.sqr(s);
const u1 = Fp.add(_1n, Fp.mulN(a, s2)); // 4 (a is -1)
const u2 = Fp.sub(_1n, Fp.mulN(a, s2)); // 5
const u1_2 = Fp.sqr(u1);
const u2_2 = Fp.sqr(u2);
const v = Fp.sub(Fp.mulN(Fp.mulN(a, d), u1_2), u2_2); // 6
const { isValid, value: I } = invertSqrt(Fp.mul(v, u2_2)); // 7
const Dx = Fp.mul(I, u2); // 8
const Dy = Fp.mul(Fp.mulN(I, Dx), v); // 9
let x = Fp.mul(Fp.addN(s, s), Dx); // 10
if (Fp.isOdd!(x)) x = Fp.neg(x); // 10
const y = Fp.mul(u1, Dy); // 11
const t = Fp.mul(x, y); // 12
if (!isValid || Fp.isOdd!(t) || Fp.is0(y)) throw new Error('invalid ristretto255 encoding 2');
return new _RistrettoPoint(new ed25519_Point(x, y, Fp.ONE, t));
}

@@ -529,25 +559,23 @@

let { X, Y, Z, T } = this.ep;
const P = ed25519_CURVE_p;
const mod = (n: bigint) => Fp.create(n);
const u1 = mod(mod(Z + Y) * mod(Z - Y)); // 1
const u2 = mod(X * Y); // 2
const u1 = Fp.mul(Fp.add(Z, Y), Fp.sub(Z, Y)); // 1
const u2 = Fp.mul(X, Y); // 2
// Square root always exists
const u2sq = mod(u2 * u2);
const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); // 3
const D1 = mod(invsqrt * u1); // 4
const D2 = mod(invsqrt * u2); // 5
const zInv = mod(D1 * D2 * T); // 6
const u2sq = Fp.sqr(u2);
const { value: invsqrt } = invertSqrt(Fp.mul(u1, u2sq)); // 3
const D1 = Fp.mul(invsqrt, u1); // 4
const D2 = Fp.mul(invsqrt, u2); // 5
const zInv = Fp.mul(Fp.mulN(D1, D2), T); // 6
let D: bigint; // 7
if (isNegativeLE(T * zInv, P)) {
let _x = mod(Y * SQRT_M1);
let _y = mod(X * SQRT_M1);
if (Fp.isOdd!(Fp.mul(T, zInv))) {
let _x = Fp.mul(Y, SQRT_M1);
let _y = Fp.mul(X, SQRT_M1);
X = _x;
Y = _y;
D = mod(D1 * INVSQRT_A_MINUS_D);
D = Fp.mul(D1, INVSQRT_A_MINUS_D);
} else {
D = D2; // 8
}
if (isNegativeLE(X * zInv, P)) Y = mod(-Y); // 9
let s = mod((Z - Y) * D); // 10 (check footer's note, no sqrt(-a))
if (isNegativeLE(s, P)) s = mod(-s);
if (Fp.isOdd!(Fp.mul(X, zInv))) Y = Fp.neg(Y); // 9
let s = Fp.mul(Fp.subN(Z, Y), D); // 10 (check footer's note, no sqrt(-a))
if (Fp.isOdd!(s)) s = Fp.neg(s);
return Fp.toBytes(s) as TRet<Uint8Array>; // 11

@@ -564,6 +592,5 @@ }

const { X: X2, Y: Y2 } = other.ep;
const mod = (n: bigint) => Fp.create(n);
// (x1 * y2 == y1 * x2) | (y1 * y2 == x1 * x2)
const one = mod(X1 * Y2) === mod(Y1 * X2);
const two = mod(Y1 * Y2) === mod(X1 * X2);
const one = Fp.eql(Fp.mul(X1, Y2), Fp.mul(Y1, X2));
const two = Fp.eql(Fp.mul(Y1, Y2), Fp.mul(X1, X2));
return one || two;

@@ -576,6 +603,2 @@ }

}
Object.freeze(_RistrettoPoint.BASE);
Object.freeze(_RistrettoPoint.ZERO);
Object.freeze(_RistrettoPoint.prototype);
Object.freeze(_RistrettoPoint);

@@ -585,3 +608,9 @@ /** Prime-order Ristretto255 group bundle. */

Point: typeof _RistrettoPoint;
} = /* @__PURE__ */ Object.freeze({ Point: _RistrettoPoint });
} = /* @__PURE__ */ (() => {
Object.freeze(_RistrettoPoint.BASE);
Object.freeze(_RistrettoPoint.ZERO);
Object.freeze(_RistrettoPoint.prototype);
Object.freeze(_RistrettoPoint);
return Object.freeze({ Point: _RistrettoPoint });
})();

@@ -600,5 +629,6 @@ /**

*/
export const ristretto255_hasher: H2CHasherBase<typeof _RistrettoPoint> = Object.freeze({
Point: _RistrettoPoint,
/**
export const ristretto255_hasher: H2CHasherBase<typeof _RistrettoPoint> =
/* @__PURE__ */ Object.freeze({
Point: _RistrettoPoint,
/**
* Spec: https://www.rfc-editor.org/rfc/rfc9380.html#name-hashing-to-ristretto255. Caveats:

@@ -617,36 +647,37 @@ * * There are no test vectors

*/
hashToCurve(msg: TArg<Uint8Array>, options?: TArg<H2CDSTOpts>): _RistrettoPoint {
// == 'hash_to_ristretto255'
// Preserve explicit empty/invalid DST overrides so expand_message_xmd() can reject them.
const DST = options?.DST === undefined ? 'ristretto255_XMD:SHA-512_R255MAP_RO_' : options.DST;
const xmd = expand_message_xmd(msg, DST, 64, sha512);
// NOTE: RFC 9380 incorrectly calls this function `ristretto255_map`.
// In RFC 9496, `map` was the per-point function inside the construction.
// That also led to confusion that `ristretto255_map` is `mapToCurve`.
// It is not: it is the older hash-to-curve construction.
return ristretto255_hasher.deriveToCurve!(xmd);
},
hashToScalar(msg: TArg<Uint8Array>, options: TArg<H2CDSTOpts> = { DST: _DST_scalar }) {
const xmd = expand_message_xmd(msg, options.DST, 64, sha512);
return Fn.create(bytesToNumberLE(xmd));
},
/**
* HashToCurve-like construction based on RFC 9496 (Element Derivation).
* Converts 64 uniform random bytes into a curve point.
*
* WARNING: This represents an older hash-to-curve construction from before
* RFC 9380 was finalized.
* It was later reused as a component in the newer
* `hash_to_ristretto255` function defined in RFC 9380.
*/
deriveToCurve(bytes: TArg<Uint8Array>): _RistrettoPoint {
// https://www.rfc-editor.org/rfc/rfc9496.html#name-element-derivation
abytes(bytes, 64);
const r1 = bytes255ToNumberLE(bytes.subarray(0, 32));
const R1 = calcElligatorRistrettoMap(r1);
const r2 = bytes255ToNumberLE(bytes.subarray(32, 64));
const R2 = calcElligatorRistrettoMap(r2);
return new _RistrettoPoint(R1.add(R2));
},
});
hashToCurve(msg: TArg<Uint8Array>, options?: TArg<H2CDSTOpts>): _RistrettoPoint {
// == 'hash_to_ristretto255'
// Preserve explicit empty/invalid DST overrides so expand_message_xmd() can reject them.
const DST = options?.DST === undefined ? 'ristretto255_XMD:SHA-512_R255MAP_RO_' : options.DST;
const xmd = expand_message_xmd(msg, DST, 64, sha512);
// NOTE: RFC 9380 incorrectly calls this function `ristretto255_map`.
// In RFC 9496, `map` was the per-point function inside the construction.
// That also led to confusion that `ristretto255_map` is `mapToCurve`.
// It is not: it is the older hash-to-curve construction.
return ristretto255_hasher.deriveToCurve!(xmd);
},
hashToScalar(msg: TArg<Uint8Array>, options?: TArg<H2CDSTOpts>) {
const DST = options?.DST === undefined ? _DST_scalar : options.DST;
const xmd = expand_message_xmd(msg, DST, 64, sha512);
return Fn.create(bytesToNumberLE(xmd));
},
/**
* HashToCurve-like construction based on RFC 9496 (Element Derivation).
* Converts 64 uniform random bytes into a curve point.
*
* WARNING: This represents an older hash-to-curve construction from before
* RFC 9380 was finalized.
* It was later reused as a component in the newer
* `hash_to_ristretto255` function defined in RFC 9380.
*/
deriveToCurve(bytes: TArg<Uint8Array>): _RistrettoPoint {
// https://www.rfc-editor.org/rfc/rfc9496.html#name-element-derivation
abytes(bytes, 64);
const r1 = bytes255ToNumberLE(bytes.subarray(0, 32));
const R1 = calcElligatorRistrettoMap(r1);
const r2 = bytes255ToNumberLE(bytes.subarray(32, 64));
const R2 = calcElligatorRistrettoMap(r2);
return new _RistrettoPoint(R1.add(R2));
},
});

@@ -653,0 +684,0 @@ /**

@@ -32,3 +32,3 @@ /**

} from './abstract/hash-to-curve.ts';
import { Field, FpInvertBatch, isNegativeLE, mod, pow2, type IField } from './abstract/modular.ts';
import { Field, FpInvertBatch, mod, pow2, type IField } from './abstract/modular.ts';
import { montgomery, type MontgomeryECDH } from './abstract/montgomery.ts';

@@ -97,3 +97,3 @@ import { createOPRF, type OPRF } from './abstract/oprf.ts';

// prettier-ignore
const _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3), _4n = /* @__PURE__ */ BigInt(4), _11n = /* @__PURE__ */ BigInt(11);
const _0n = /* @__PURE__ */ BigInt(0), _1n = /* @__PURE__ */ BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3), _4n = /* @__PURE__ */ BigInt(4), _11n = /* @__PURE__ */ BigInt(11);
// prettier-ignore

@@ -173,2 +173,21 @@ const _22n = /* @__PURE__ */ BigInt(22), _44n = /* @__PURE__ */ BigInt(44), _88n = /* @__PURE__ */ BigInt(88), _223n = /* @__PURE__ */ BigInt(223);

function toMontgomery(point: EdwardsPoint): TRet<Uint8Array> {
// RFC 7748 section 4.2 maps Ed448-Goldilocks to Curve448 via a 4-isogeny.
// The u-coordinate map is:
// u = y^2 / x^2
// In projective coordinates this is:
// u = Y^2 / X^2
const u = Fp.div(Fp.mul(point.Y, point.Y), Fp.mul(point.X, point.X));
return Fp448.toBytes(u) as TRet<Uint8Array>;
}
function toMontgomerySecret(secretKey: TArg<Uint8Array>): TRet<Uint8Array> {
const size = ed448_Point.Fp.BYTES;
abytes(secretKey, size);
return adjustScalarBytes(shake256_114(secretKey.subarray(0, size))).subarray(
0,
56
) as TRet<Uint8Array>;
}
// SHAKE256(dom4(phflag,context)||x, 114)

@@ -194,3 +213,6 @@ // RFC 8032 `dom4` prefix. Empty contexts are valid; the accepted length range

shake256_114,
Object.assign({ adjustScalarBytes, domain: dom4 }, opts as EdDSAOpts)
Object.assign(
{ adjustScalarBytes, domain: dom4, toMontgomery, toMontgomerySecret },
opts as EdDSAOpts
)
);

@@ -241,9 +263,11 @@ }

* @example
* Multiply the E448 base point.
* Reconstruct and validate the E448 base point from its projective coordinates.
*
* ```ts
* const point = E448.BASE.multiply(2n);
* import { E448 } from '@noble/curves/ed448.js';
* const point = new E448(E448.BASE.X, E448.BASE.Y, E448.BASE.Z, E448.BASE.T);
* point.assertValidity();
* ```
*/
export const E448: EdwardsPointCons = /* @__PURE__ */ edwards(E448_CURVE);
export const E448: EdwardsPointCons = /* @__PURE__ */ edwards(E448_CURVE, { Fp, Fn });

@@ -267,11 +291,26 @@ /**

const P = ed448_CURVE_p;
const powPminus2 = (x: bigint): bigint => {
const Pminus3div4 = ed448_pow_Pminus3div4(x);
const Pminus3 = pow2(Pminus3div4, _2n, P);
return mod(Pminus3 * x, P); // Pminus3 * x = Pminus2
};
return montgomery({
P,
type: 'x448',
powPminus2: (x: bigint): bigint => {
const Pminus3div4 = ed448_pow_Pminus3div4(x);
const Pminus3 = pow2(Pminus3div4, _2n, P);
return mod(Pminus3 * x, P); // Pminus3 * x = Pminus2
powPminus2,
adjustScalarBytes,
// ~3x faster fixed-base: [k]B on Ed448-Goldilocks using cached base tables, mapped back
// through the 4-isogeny to curve448: u = y²/x² = Y²/X² (the isogeny is a homomorphism and
// sends the Ed448 base point to u=5, so no scalar correction factor is needed).
scalarMultBase: (k: bigint): bigint => {
// Clamped k (≈2^447) exceeds n, but B has prime order n, so [k]B == [k mod n]B.
const kn = mod(k, ed448_Point.Fn.ORDER);
// k ≡ 0 (mod n): [k]B is the point at infinity, whose u is 0 in the x-only ladder;
// returning 0 makes montgomery() reject it exactly like the ladder path.
if (kn === _0n) return _0n;
const p = ed448_Point.BASE.multiply(kn);
// X == 0 only at the identity and the order-2 point, both excluded from the prime-order
// subgroup hit by kn in 1..n-1.
return mod(p.Y * p.Y * powPminus2(mod(p.X * p.X, P)), P);
},
adjustScalarBytes,
});

@@ -281,4 +320,4 @@ })();

// Hash To Curve Elligator2 Map
// 1. c1 = (q - 3) / 4 # Integer arithmetic
const ELL2_C1 = /* @__PURE__ */ (() => (ed448_CURVE_p - BigInt(3)) / BigInt(4))();
// 1. c1 = (q - 3) / 4 # Integer arithmetic — tv3^c1 below reuses the
// ed448_pow_Pminus3div4 addition chain, which computes exactly x^((p-3)/4).
const ELL2_J = /* @__PURE__ */ BigInt(156326);

@@ -303,3 +342,3 @@

tv3 = Fp.mul(tv3, tv2); // 14. tv3 = tv3 * tv2 # gx1 * gxd^3
let y1 = Fp.pow(tv3, ELL2_C1); // 15. y1 = tv3^c1 # (gx1 * gxd^3)^((p - 3) / 4)
let y1 = ed448_pow_Pminus3div4(tv3); // 15. y1 = tv3^c1 # (gx1 * gxd^3)^((p - 3) / 4)
y1 = Fp.mul(y1, tv2); // 16. y1 = y1 * tv2 # gx1 * gxd * (gx1 * gxd^3)^((p - 3) / 4)

@@ -431,5 +470,4 @@ // 17. x2n = -tv1 * x1n # x2 = x2n / xd = -1 * u^2 * x1n / xd

const sqrtRatioM1 = (u: bigint, v: bigint) => {
const P = ed448_CURVE_p;
const { isValid, value } = uvRatio(u, v);
return { isValid, value: isNegativeLE(value, P) ? Fp448.create(-value) : value };
return { isValid, value: Fp448.isOdd!(value) ? Fp448.neg(value) : value };
};

@@ -445,27 +483,37 @@ const invertSqrt = (number: bigint) => sqrtRatioM1(_1n, number);

function calcElligatorDecafMap(r0: bigint): EdwardsPoint {
const { d, p: P } = ed448_CURVE;
const mod = (n: bigint) => Fp448.create(n);
const { d } = ed448_CURVE;
const r = mod(-(r0 * r0)); // 1
const u0 = mod(d * (r - _1n)); // 2
const u1 = mod((u0 + _1n) * (u0 - r)); // 3
const r = Fp448.create(-Fp448.sqrN(r0)); // 1
const u0 = Fp448.mul(d, Fp448.subN(r, _1n)); // 2
const u1 = Fp448.mul(Fp448.addN(u0, _1n), Fp448.subN(u0, r)); // 3
const { isValid: was_square, value: v } = sqrtRatioM1(ONE_MINUS_TWO_D, mod((r + _1n) * u1)); // 4
const { isValid: was_square, value: v } = sqrtRatioM1(
ONE_MINUS_TWO_D,
Fp448.mul(Fp448.addN(r, _1n), u1)
); // 4
let v_prime = v; // 5
if (!was_square) v_prime = mod(r0 * v);
if (!was_square) v_prime = Fp448.mul(r0, v);
let sgn = _1n; // 6
if (!was_square) sgn = mod(-_1n);
if (!was_square) sgn = Fp448.neg(Fp448.ONE);
const s = mod(v_prime * (r + _1n)); // 7
const s = Fp448.mul(v_prime, Fp448.addN(r, _1n)); // 7
let s_abs = s;
if (isNegativeLE(s, P)) s_abs = mod(-s);
if (Fp448.isOdd!(s)) s_abs = Fp448.neg(s);
const s2 = s * s;
const W0 = mod(s_abs * _2n); // 8
const W1 = mod(s2 + _1n); // 9
const W2 = mod(s2 - _1n); // 10
const W3 = mod(v_prime * s * (r - _1n) * ONE_MINUS_TWO_D + sgn); // 11
return new ed448_Point(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2));
const s2 = Fp448.sqrN(s);
const W0 = Fp448.mul(s_abs, _2n); // 8
const W1 = Fp448.add(s2, _1n); // 9
const W2 = Fp448.sub(s2, _1n); // 10
const W3 = Fp448.add(
Fp448.mulN(Fp448.mulN(Fp448.mulN(v_prime, s), Fp448.subN(r, _1n)), ONE_MINUS_TWO_D),
sgn
); // 11
return new ed448_Point(
Fp448.mul(W0, W3),
Fp448.mul(W2, W1),
Fp448.mul(W1, W3),
Fp448.mul(W0, W2)
);
}

@@ -532,4 +580,3 @@

abytes(bytes, 56);
const { d, p: P } = ed448_CURVE;
const mod = (n: bigint) => Fp448.create(n);
const { d } = ed448_CURVE;
const s = Fp448.fromBytes(bytes);

@@ -539,21 +586,21 @@

// 2. Check that s is non-negative, or else abort
if (!equalBytes(Fn448.toBytes(s), bytes) || isNegativeLE(s, P))
if (!equalBytes(Fp448.toBytes(s), bytes) || Fp448.isOdd!(s))
throw new Error('invalid decaf448 encoding 1');
const s2 = mod(s * s); // 1
const u1 = mod(_1n + s2); // 2
const u1sq = mod(u1 * u1);
const u2 = mod(u1sq - _4n * d * s2); // 3
const s2 = Fp448.sqr(s); // 1
const u1 = Fp448.add(Fp448.ONE, s2); // 2
const u1sq = Fp448.sqr(u1);
const u2 = Fp448.sub(u1sq, Fp448.mulN(Fp448.mulN(_4n, d), s2)); // 3
const { isValid, value: invsqrt } = invertSqrt(mod(u2 * u1sq)); // 4
const { isValid, value: invsqrt } = invertSqrt(Fp448.mul(u2, u1sq)); // 4
let u3 = mod((s + s) * invsqrt * u1 * SQRT_MINUS_D); // 5
if (isNegativeLE(u3, P)) u3 = mod(-u3);
let u3 = Fp448.mul(Fp448.mulN(Fp448.mulN(Fp448.addN(s, s), invsqrt), u1), SQRT_MINUS_D); // 5
if (Fp448.isOdd!(u3)) u3 = Fp448.neg(u3);
const x = mod(u3 * invsqrt * u2 * INVSQRT_MINUS_D); // 6
const y = mod((_1n - s2) * invsqrt * u1); // 7
const t = mod(x * y); // 8
const x = Fp448.mul(Fp448.mulN(Fp448.mulN(u3, invsqrt), u2), INVSQRT_MINUS_D); // 6
const y = Fp448.mul(Fp448.mulN(Fp448.subN(_1n, s2), invsqrt), u1); // 7
const t = Fp448.mul(x, y); // 8
if (!isValid) throw new Error('invalid decaf448 encoding 2');
return new _DecafPoint(new ed448_Point(x, y, _1n, t));
return new _DecafPoint(new ed448_Point(x, y, Fp448.ONE, t));
}

@@ -576,13 +623,11 @@

const { X, Z, T } = this.ep;
const P = ed448_CURVE.p;
const mod = (n: bigint) => Fp448.create(n);
const u1 = mod(mod(X + T) * mod(X - T)); // 1
const x2 = mod(X * X);
const { value: invsqrt } = invertSqrt(mod(u1 * ONE_MINUS_D * x2)); // 2
let ratio = mod(invsqrt * u1 * SQRT_MINUS_D); // 3
if (isNegativeLE(ratio, P)) ratio = mod(-ratio);
const u2 = mod(INVSQRT_MINUS_D * ratio * Z - T); // 4
let s = mod(ONE_MINUS_D * invsqrt * X * u2); // 5
if (isNegativeLE(s, P)) s = mod(-s);
return Fn448.toBytes(s) as TRet<Uint8Array>;
const u1 = Fp448.mul(Fp448.add(X, T), Fp448.sub(X, T)); // 1
const x2 = Fp448.sqr(X);
const { value: invsqrt } = invertSqrt(Fp448.mul(Fp448.mulN(u1, ONE_MINUS_D), x2)); // 2
let ratio = Fp448.mul(Fp448.mulN(invsqrt, u1), SQRT_MINUS_D); // 3
if (Fp448.isOdd!(ratio)) ratio = Fp448.neg(ratio);
const u2 = Fp448.sub(Fp448.mulN(Fp448.mulN(INVSQRT_MINUS_D, ratio), Z), T); // 4
let s = Fp448.mul(Fp448.mulN(Fp448.mulN(ONE_MINUS_D, invsqrt), X), u2); // 5
if (Fp448.isOdd!(s)) s = Fp448.neg(s);
return Fp448.toBytes(s) as TRet<Uint8Array>;
}

@@ -599,3 +644,3 @@

// (x1 * y2 == y1 * x2)
return Fp448.create(X1 * Y2) === Fp448.create(Y1 * X2);
return Fp448.eql(Fp448.mul(X1, Y2), Fp448.mul(Y1, X2));
}

@@ -607,11 +652,12 @@

}
Object.freeze(_DecafPoint.BASE);
Object.freeze(_DecafPoint.ZERO);
Object.freeze(_DecafPoint.prototype);
Object.freeze(_DecafPoint);
/** Prime-order Decaf448 group bundle. */
export const decaf448: {
Point: typeof _DecafPoint;
} = /* @__PURE__ */ Object.freeze({ Point: _DecafPoint });
} = /* @__PURE__ */ (() => {
Object.freeze(_DecafPoint.BASE);
Object.freeze(_DecafPoint.ZERO);
Object.freeze(_DecafPoint.prototype);
Object.freeze(_DecafPoint);
return Object.freeze({ Point: _DecafPoint });
})();

@@ -630,3 +676,3 @@ /**

*/
export const decaf448_hasher: H2CHasherBase<typeof _DecafPoint> = Object.freeze({
export const decaf448_hasher: H2CHasherBase<typeof _DecafPoint> = /* @__PURE__ */ Object.freeze({
Point: _DecafPoint,

@@ -643,5 +689,6 @@ hashToCurve(msg: TArg<Uint8Array>, options?: TArg<H2CDSTOpts>): _DecafPoint {

*/
hashToScalar(msg: TArg<Uint8Array>, options: TArg<H2CDSTOpts> = { DST: _DST_scalar }): bigint {
hashToScalar(msg: TArg<Uint8Array>, options?: TArg<H2CDSTOpts>): bigint {
const DST = options?.DST === undefined ? _DST_scalar : options.DST;
// Can't use `Fn448.fromBytes()`. 64-byte input => 56-byte field element
const xof = expand_message_xof(msg, options.DST, 64, 256, shake256);
const xof = expand_message_xof(msg, DST, 64, 256, shake256);
return Fn448.create(bytesToNumberLE(xof));

@@ -698,3 +745,3 @@ },

* Instead, the torsion subgroup here is cyclic of order 4, generated by
* `(1, 0)`, and the array below lists that subgroup set (Klein four-group).
* `(1, 0)`, and the array below lists that subgroup set.
* @example

@@ -701,0 +748,0 @@ * Decode one known torsion point for debugging.

@@ -121,4 +121,5 @@ /**

let p = jubjub.Point.fromBytes(h.digest());
// NOTE: cannot replace with isSmallOrder, returns Point*8
p = p.multiply(jubjub_CURVE.h);
// NOTE: cannot replace with isSmallOrder, we need the Point*8 result itself.
// clearCofactor (three doublings for h=8) is fine here: inputs are public.
p = p.clearCofactor();
if (p.equals(jubjub.Point.ZERO)) throw new Error('Point has small order');

@@ -155,11 +156,11 @@ return p;

const tag = concatBytes(m, Uint8Array.of(0));
const hashes = [];
// Return the first tag byte whose hash decodes to a non-small-order point; later candidates
// were never used, so there is no reason to compute them.
for (let i = 0; i < 256; i++) {
tag[tag.length - 1] = i;
try {
hashes.push(jubjub_groupHash(tag, personalization));
return jubjub_groupHash(tag, personalization);
} catch (e) {}
}
if (!hashes.length) throw new Error('findGroupHash tag overflow');
return hashes[0];
throw new Error('findGroupHash tag overflow');
}

@@ -166,0 +167,0 @@

/**
* Internal module for NIST P256, P384, P521 curves.
* Do not use for now.
* NIST P256, P384, P521 curves.
* https://www.secg.org/sec2-v2.pdf, https://neuromancer.sk/std/nist/P-256
* @module

@@ -9,7 +9,6 @@ */

import { createFROST, type FROST } from './abstract/frost.ts';
import { createHasher, type H2CHasher } from './abstract/hash-to-curve.ts';
import { createHasher, mapToCurveSimpleSWU, type H2CHasher } from './abstract/hash-to-curve.ts';
import { createOPRF, type OPRF } from './abstract/oprf.ts';
import {
ecdsa,
mapToCurveSimpleSWU,
weierstrass,

@@ -106,5 +105,7 @@ type ECDSA,

* const { secretKey, publicKey } = p256.keygen();
* // const publicKey = p256.getPublicKey(secretKey);
* const recovered = p256.getPublicKey(secretKey);
* const peer = p256.keygen();
* const shared = p256.getSharedSecret(secretKey, peer.publicKey);
* const msg = new TextEncoder().encode('hello noble');
* const sig = p256.sign(msg, secretKey);
* const sig = p256.sign(msg, secretKey, { lowS: true, prehash: true });
* const isValid = p256.verify(sig, msg, publicKey);

@@ -130,3 +131,3 @@ * // const sigKeccak = p256.sign(keccak256(msg), secretKey, { prehash: false });

B: p256_CURVE.b,
Z: p256_Point.Fp.create(BigInt('-10')),
Z: p256_Point.Fp.neg(BigInt(10)),
}),

@@ -185,3 +186,2 @@ {

// NIST P384
const p384_Point = /* @__PURE__ */ weierstrass(p384_CURVE);

@@ -216,3 +216,3 @@ /**

B: p384_CURVE.b,
Z: p384_Point.Fp.create(BigInt('-12')),
Z: p384_Point.Fp.neg(BigInt(12)),
}),

@@ -268,2 +268,4 @@ {

// default exact-66-byte scalar field path.
// A dedicated MersenneField primitive would allow speed-ups here: +40% getPublicKey, +23% sign,
// +53% verify, +53% getSharedSecret.
const p521_Point = /* @__PURE__ */ weierstrass(p521_CURVE);

@@ -300,3 +302,3 @@ /**

B: p521_CURVE.b,
Z: p521_Point.Fp.create(BigInt('-4')),
Z: p521_Point.Fp.neg(BigInt(4)),
}),

@@ -303,0 +305,0 @@ {

@@ -19,3 +19,8 @@ /**

} from './abstract/frost.ts';
import { createHasher, type H2CHasher, isogenyMap } from './abstract/hash-to-curve.ts';
import {
createHasher,
type H2CHasher,
isogenyMap,
mapToCurveSimpleSWU,
} from './abstract/hash-to-curve.ts';
import { Field, mapHashToField, pow2 } from './abstract/modular.ts';

@@ -26,3 +31,2 @@ import {

type EndomorphismOpts,
mapToCurveSimpleSWU,
type WeierstrassPoint as PointType,

@@ -94,3 +98,3 @@ weierstrass,

const Fpk1 = Field(secp256k1_CURVE.p, { sqrt: sqrtMod });
const Fpk1 = /* @__PURE__ */ Field(secp256k1_CURVE.p, { sqrt: sqrtMod });
const Pointk1 = /* @__PURE__ */ weierstrass(secp256k1_CURVE, {

@@ -125,3 +129,3 @@ Fp: Fpk1,

/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */
const TAGGED_HASH_PREFIXES: { [tag: string]: Uint8Array } = {};
const TAGGED_HASH_PREFIXES: { [tag: string]: Uint8Array } = Object.create(null);
// BIP-340 phrases tags as UTF-8, but all current standardized names here are 7-bit ASCII.

@@ -141,3 +145,5 @@ function taggedHash(tag: string, ...messages: TArg<Uint8Array[]>): TRet<Uint8Array> {

point.toBytes(true).slice(1) as TRet<Uint8Array>;
const hasEven = (y: bigint) => y % _2n === _0n;
const affineXToBytes = ({ x }: { x: bigint }): TRet<Uint8Array> =>
Fpk1.toBytes(x) as TRet<Uint8Array>;
const hasEven = (y: bigint) => !Fpk1.isOdd(y);

@@ -147,6 +153,7 @@ // Calculate point, scalar and bytes

const { Fn, BASE } = Pointk1;
const d_ = Fn.fromBytes(priv);
const d_ = Fn.fromBytes(abytes(priv, 32, 'secretKey'));
const p = BASE.multiply(d_); // P = d'⋅G; 0 < d' < n check is done inside
const scalar = hasEven(p.y) ? d_ : Fn.neg(d_);
return { scalar, bytes: pointToBytes(p) };
const affine = p.toAffine();
const scalar = hasEven(affine.y) ? d_ : Fn.neg(d_);
return { scalar, bytes: affineXToBytes(affine) };
}

@@ -160,4 +167,4 @@ /**

if (!Fp.isValidNot0(x)) throw new Error('invalid x: Fail if x ≥ p');
const xx = Fp.create(x * x);
const c = Fp.create(xx * x + BigInt(7)); // Let c = x³ + 7 mod p.
const xx = Fp.sqr(x);
const c = Fp.add(Fp.mulN(xx, x), BigInt(7)); // Let c = x³ + 7 mod p.
let y = Fp.sqrt(c); // Let y = c^(p+1)/4 mod p. Same as sqrt().

@@ -207,6 +214,7 @@ // Return the unique point P such that x(P) = x and

// BIP-340: "Let k' = int(rand) mod n. Fail if k' = 0. Let R = k'⋅G."
if (k_ === 0n) throw new Error('sign failed: k is zero');
if (k_ === _0n) throw new Error('sign failed: k is zero');
const p = BASE.multiply(k_); // Rejects zero; only the raw nonce hash needs reduction.
const k = hasEven(p.y) ? k_ : Fn.neg(k_);
const rx = pointToBytes(p);
const affine = p.toAffine();
const k = hasEven(affine.y) ? k_ : Fn.neg(k_);
const rx = affineXToBytes(affine);
const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n.

@@ -236,3 +244,4 @@ const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n).

const P = lift_x(num(pub)); // P = lift_x(int(pk)); fail if that fails
const r = num(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p.
const rBytes = sig.subarray(0, 32);
const r = num(rBytes); // Let r = int(sig[0:32]); fail if r ≥ p.
if (!Fp.isValidNot0(r)) return false;

@@ -246,8 +255,8 @@ const s = num(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n.

// int(challenge(bytes(r) || bytes(P) || m)) % n
const e = challenge(Fn.toBytes(r), pointToBytes(P), m);
const e = challenge(rBytes, pointToBytes(P), m);
// R = s⋅G - e⋅P, where -eP == (n-e)P
const R = BASE.multiplyUnsafe(s).add(P.multiplyUnsafe(Fn.neg(e)));
const R = BASE.mulAddUnsafe(s, P, Fn.neg(e)); // s⋅G + (-e)⋅P, joint Strauss–Shamir
const { x, y } = R.toAffine();
// Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r.
if (R.is0() || !hasEven(y) || x !== r) return false;
if (R.is0() || !hasEven(y) || !Fp.eql(x, r)) return false;
return true;

@@ -259,3 +268,7 @@ } catch (error) {

export const __TEST: { lift_x: typeof lift_x } = /* @__PURE__ */ Object.freeze({ lift_x });
export const __TEST: {
lift_x: typeof lift_x;
frostTweakPublic: typeof frostTweakPublic;
frostTweakSecret: typeof frostTweakSecret;
} = /* @__PURE__ */ Object.freeze({ lift_x, frostTweakPublic, frostTweakSecret });

@@ -328,3 +341,3 @@ /** Schnorr-specific secp256k1 API from BIP340. */

seed = seed === undefined ? randomBytes(seedLength) : seed;
return mapHashToField(seed, secp256k1_CURVE.n);
return mapHashToField(abytes(seed, seedLength, 'seed'), secp256k1_CURVE.n);
};

@@ -483,4 +496,7 @@ return Object.freeze({

}
function frostNoncesToEvenY(PK: PointType<bigint>, nonces: TArg<Nonces>): TRet<Nonces> {
if (hasEven(PK.y)) return nonces as TRet<Nonces>;
function frostNoncesToEvenY(
groupCommitment: PointType<bigint>,
nonces: TArg<Nonces>
): TRet<Nonces> {
if (hasEven(groupCommitment.y)) return nonces as TRet<Nonces>;
const Fn = Pointk1.Fn;

@@ -515,2 +531,5 @@ return {

const t = tweak(Pointk1.fromBytes(PKPackage.commitments[0]), merkleRoot);
// Disabled TapTweak (t=0): return the even-Y-normalized package as-is. multiply() rejects
// zero scalars, and adding [0]G would be a no-op anyway.
if (t === _0n) return PKPackage;
const tp = Pointk1.BASE.multiply(t);

@@ -517,0 +536,0 @@ const commitments = PKPackage.commitments.map((c, i) =>

@@ -120,3 +120,28 @@ /**

: never;
/**
* Validates that a value is an array, optionally validating each element.
* @param item - Value to validate.
* @param title - Label included in thrown errors.
* @param inner - Optional per-element validator, called with the element and its label.
* @returns The validated array.
* @example
* Validate an array of points before batch processing.
*
* ```ts
* aarray([1n, 2n], 'scalars');
* ```
*/
export function aarray<T>(
item: unknown,
title: string,
inner: (elm: T, title: string) => void = () => {}
): T[] {
if (!Array.isArray(item))
throw new TypeError(`"${title}" expected array, got type=${typeof item}`);
for (let i = 0; i < item.length; i++) inner(item[i], `${title}[${i}]`);
return item;
}
/**
* Validates that a value is a byte array.

@@ -140,2 +165,3 @@ * @param value - Value to validate.

* @param title - Optional field name.
* @returns The validated number.
* @example

@@ -150,2 +176,62 @@ * Validate a numeric length before allocating buffers.

/**
* Asserts something is a string.
* @param value - Value to validate.
* @param title - Label included in thrown errors.
* @returns The validated string.
* @throws On wrong argument types. {@link TypeError}
* @example
* Validate a label string.
*
* ```ts
* astring('example', 'label');
* ```
*/
export function astring(value: unknown, title: string = ''): string {
if (typeof value !== 'string') {
const prefix = title && `"${title}" `;
throw new TypeError(prefix + 'expected string, got type=' + typeof value);
}
return value;
}
/**
* Asserts something is a plain object-ish value, not null or array.
* @param value - Value to validate.
* @param title - Label included in thrown errors.
* @returns The validated object.
* @throws On wrong argument types. {@link TypeError}
* @example
* Validate an options object before checking fields.
*
* ```ts
* aobject({ flag: true });
* ```
*/
export function aobject<T extends Record<string, any>>(value: T, title: string = 'object'): T {
if (value === null || typeof value !== 'object' || Array.isArray(value))
throw new TypeError(
title === 'object'
? 'expected valid options object'
: `"${title}" expected object, got type=${typeof value}`
);
return value;
}
/**
* Asserts something is a function.
* @param value - Value to validate.
* @param title - Label included in thrown errors.
* @returns The validated function.
* @throws On wrong argument types. {@link TypeError}
* @example
* Validate a required method before calling it.
*
* ```ts
* afunction(() => true, 'predicate');
* ```
*/
export function afunction<T extends (...args: any[]) => any>(value: T, title: string): T {
if (typeof value !== 'function')
throw new TypeError(`"${title}" is invalid: expected function, got ${typeof value}`);
return value;
}
/**
* Encodes bytes as lowercase hex.

@@ -241,2 +327,6 @@ * @param bytes - Bytes to encode.

export type HmacFn = (key: TArg<Uint8Array>, message: TArg<Uint8Array>) => TRet<Uint8Array>;
// Shared error-message prefix builder. Only called on throw paths, so assert
// success paths never pay for the string concatenation.
const atitle = (title: string): string => (title ? `"${title}" ` : '');
/**

@@ -256,6 +346,4 @@ * Validates that a flag is boolean.

export function abool(value: boolean, title: string = ''): boolean {
if (typeof value !== 'boolean') {
const prefix = title && `"${title}" `;
throw new TypeError(prefix + 'expected boolean, got type=' + typeof value);
}
if (typeof value !== 'boolean')
throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value);
return value;

@@ -383,2 +471,3 @@ }

* @throws On wrong argument ranges or values. {@link RangeError}
* @throws If a documented runtime validation or state check fails. {@link Error}
* @example

@@ -393,8 +482,9 @@ * Serialize a scalar into a 32-byte field element.

anumber_(len);
if (len === 0) throw new RangeError('zero length');
if (len === 0) throw new Error('zero output length is invalid');
n = abignumber(n);
const expectedLen = len * 2;
const hex = n.toString(16);
// Detect overflow before hex parsing so oversized values don't leak the shared odd-hex error.
if (hex.length > len * 2) throw new RangeError('number too large');
return hexToBytes_(hex.padStart(len * 2, '0')) as TRet<Uint8Array>;
if (hex.length > expectedLen) throw new RangeError('number is too large');
return hexToBytes_(hex.padStart(expectedLen, '0')) as TRet<Uint8Array>;
}

@@ -407,2 +497,3 @@ /**

* @throws On wrong argument ranges or values. {@link RangeError}
* @throws If a documented runtime validation or state check fails. {@link Error}
* @example

@@ -502,4 +593,16 @@ * Serialize a scalar for little-endian protocols.

// Historical name: this accepts non-negative bigints, including zero.
const isPosBig = (n: bigint) => typeof n === 'bigint' && _0n <= n;
/**
* Checks whether n is non-negative bigint. Historical name.
* @param n - candidate value
* @returns `true` when the value is bigint and 0 or larger
* @example
* Check a candidate scalar before range validation.
*
* ```ts
* isPosBig(2n);
* ```
*/
export function isPosBig(n: bigint): boolean {
return typeof n === 'bigint' && _0n <= n;
}

@@ -569,5 +672,4 @@ /**

if (n < _0n) throw new Error('expected non-negative bigint, got ' + n);
let len;
for (len = 0; n > _0n; n >>= _1n, len += 1);
return len;
// Native radix conversion beats a shift loop at every size, and the loop is quadratic in bits.
return n === _0n ? 0 : n.toString(2).length;
}

@@ -592,2 +694,4 @@

export function bitGet(n: bigint, pos: number): bigint {
if (typeof n !== 'bigint') throw new TypeError('"n" expected bigint, got type=' + typeof n);
asafenumber(pos, 'pos');
return (n >> BigInt(pos)) & _1n;

@@ -611,2 +715,5 @@ }

export function bitSet(n: bigint, pos: number, value: boolean): bigint {
if (typeof n !== 'bigint') throw new TypeError('"n" expected bigint, got type=' + typeof n);
asafenumber(pos, 'pos');
abool(value, 'value');
const mask = _1n << BigInt(pos);

@@ -630,3 +737,6 @@ // Clearing needs AND-not here; OR with zero leaves an already-set bit untouched.

*/
export const bitMask = (n: number): bigint => (_1n << BigInt(n)) - _1n;
export const bitMask = (n: number): bigint => {
asafenumber(n, 'n');
return (_1n << BigInt(n)) - _1n;
};

@@ -652,3 +762,4 @@ // DRBG

* import { sha256 } from '@noble/hashes/sha2.js';
* const drbg = createHmacDrbg(32, 32, (key, msg) => hmac(sha256, key, msg));
* const hmacFn = (key: Uint8Array, msg: Uint8Array) => hmac(sha256, key, msg);
* const drbg = createHmacDrbg(32, 32, hmacFn);
* const seed = new Uint8Array(32);

@@ -723,5 +834,8 @@ * drbg(seed, (bytes) => bytes);

* richer option bags or runtime objects.
* This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct
* one-line guards such as `aobject()`, `afunction()`, `abool()`, or `asafenumber()` instead.
* @param object - Object to validate.
* @param fields - Required field types.
* @param optFields - Optional field types.
* @param title - Object label included in thrown errors.
* @throws On wrong argument types. {@link TypeError}

@@ -738,19 +852,27 @@ * @example

fields: Record<string, string> = {},
optFields: Record<string, string> = {}
optFields: Record<string, string> = {},
title = 'object'
): void {
if (Object.prototype.toString.call(object) !== '[object Object]')
throw new TypeError('expected valid options object');
aobject(object, title);
aobject(fields, 'fields');
aobject(optFields, 'optFields');
type Item = keyof typeof object;
function checkField(fieldName: Item, expectedType: string, isOpt: boolean) {
// Config/data fields must be explicit own properties, but runtime objects such as Field
// instances intentionally satisfy required method slots via their shared prototype.
if (!isOpt && expectedType !== 'function' && !Object.hasOwn(object, fieldName))
throw new TypeError(`param "${fieldName}" is invalid: expected own property`);
const label =
title === 'object' ? `param "${String(fieldName)}"` : `"${title}.${String(fieldName)}"`;
// Config fields must be explicit own properties. Optional inherited values are rejected too
// because callers keep reading the same options object after validation.
const val = object[fieldName];
// Runtime objects such as Field instances intentionally satisfy required method slots
// via their shared prototype.
if (
!Object.hasOwn(object, fieldName) &&
(isOpt ? val !== undefined : expectedType !== 'function')
) {
throw new TypeError(`${label} is invalid: expected own property`);
}
if (isOpt && val === undefined) return;
const current = typeof val;
if (current !== expectedType || val === null)
throw new TypeError(
`param "${fieldName}" is invalid: expected ${expectedType}, got ${current}`
);
throw new TypeError(`${label} is invalid: expected ${expectedType}, got ${current}`);
}

@@ -757,0 +879,0 @@ const iter = (f: typeof fields, isOpt: boolean) =>

@@ -44,3 +44,3 @@ /**

/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import type { TArg, TRet } from './utils.ts';
import { abytes, validateObject, type TArg, type TRet } from './utils.ts';

@@ -166,3 +166,3 @@ /** Raw type */

// This is the best one can do. JWK can't be used: it contains public key component inside.
const k = key as Uint8Array;
const k = abytes(key as Uint8Array, keyLen, 'secretKey');
const head = hexToBytesLocal(pkcs8header);

@@ -217,2 +217,3 @@ const all = new Uint8Array(head.length + k.length);

): Promise<TRet<Key>> {
validateObject(opts, {}, { formatSec: 'string', formatPub: 'string' }, 'opts');
const fsec = opts.formatSec ?? dfsec;

@@ -286,2 +287,3 @@ const fpub = opts.formatPub ?? dfpub;

): Promise<TRet<Uint8Array>> {
validateObject(opts, {}, { formatSec: 'string', formatPub: 'string' }, 'opts');
const key = await keys.priv.import(secretKey, opts.formatSec ?? dfsec);

@@ -297,2 +299,3 @@ const sig = await getSubtle().sign(algo, key, msgHash);

): Promise<boolean> {
validateObject(opts, {}, { formatSec: 'string', formatPub: 'string' }, 'opts');
const key = await keys.pub.import(publicKey, opts.formatPub ?? dfpub);

@@ -317,2 +320,3 @@ return await getSubtle().verify(algo, key, signature, msgHash);

): Promise<TRet<Uint8Array>> {
validateObject(opts, {}, { formatSec: 'string', formatPub: 'string' }, 'opts');
// if (_isCompressed !== true) throw new Error('WebCrypto only supports compressed keys');

@@ -319,0 +323,0 @@ const secKey = await keys.priv.import(

@@ -48,2 +48,16 @@ /**

/**
* Validates that a value is an array, optionally validating each element.
* @param item - Value to validate.
* @param title - Label included in thrown errors.
* @param inner - Optional per-element validator, called with the element and its label.
* @returns The validated array.
* @example
* Validate an array of points before batch processing.
*
* ```ts
* aarray([1n, 2n], 'scalars');
* ```
*/
export declare function aarray<T>(item: unknown, title: string, inner?: (elm: T, title: string) => void): T[];
/**
* Validates that a value is a byte array.

@@ -66,2 +80,3 @@ * @param value - Value to validate.

* @param title - Optional field name.
* @returns The validated number.
* @example

@@ -76,2 +91,44 @@ * Validate a numeric length before allocating buffers.

/**
* Asserts something is a string.
* @param value - Value to validate.
* @param title - Label included in thrown errors.
* @returns The validated string.
* @throws On wrong argument types. {@link TypeError}
* @example
* Validate a label string.
*
* ```ts
* astring('example', 'label');
* ```
*/
export declare function astring(value: unknown, title?: string): string;
/**
* Asserts something is a plain object-ish value, not null or array.
* @param value - Value to validate.
* @param title - Label included in thrown errors.
* @returns The validated object.
* @throws On wrong argument types. {@link TypeError}
* @example
* Validate an options object before checking fields.
*
* ```ts
* aobject({ flag: true });
* ```
*/
export declare function aobject<T extends Record<string, any>>(value: T, title?: string): T;
/**
* Asserts something is a function.
* @param value - Value to validate.
* @param title - Label included in thrown errors.
* @returns The validated function.
* @throws On wrong argument types. {@link TypeError}
* @example
* Validate a required method before calling it.
*
* ```ts
* afunction(() => true, 'predicate');
* ```
*/
export declare function afunction<T extends (...args: any[]) => any>(value: T, title: string): T;
/**
* Encodes bytes as lowercase hex.

@@ -267,2 +324,3 @@ * @param bytes - Bytes to encode.

* @throws On wrong argument ranges or values. {@link RangeError}
* @throws If a documented runtime validation or state check fails. {@link Error}
* @example

@@ -282,2 +340,3 @@ * Serialize a scalar into a 32-byte field element.

* @throws On wrong argument ranges or values. {@link RangeError}
* @throws If a documented runtime validation or state check fails. {@link Error}
* @example

@@ -346,2 +405,14 @@ * Serialize a scalar for little-endian protocols.

/**
* Checks whether n is non-negative bigint. Historical name.
* @param n - candidate value
* @returns `true` when the value is bigint and 0 or larger
* @example
* Check a candidate scalar before range validation.
*
* ```ts
* isPosBig(2n);
* ```
*/
export declare function isPosBig(n: bigint): boolean;
/**
* Checks whether a bigint lies inside a half-open range.

@@ -455,3 +526,4 @@ * @param n - Candidate value.

* import { sha256 } from '@noble/hashes/sha2.js';
* const drbg = createHmacDrbg(32, 32, (key, msg) => hmac(sha256, key, msg));
* const hmacFn = (key: Uint8Array, msg: Uint8Array) => hmac(sha256, key, msg);
* const drbg = createHmacDrbg(32, 32, hmacFn);
* const seed = new Uint8Array(32);

@@ -466,5 +538,8 @@ * drbg(seed, (bytes) => bytes);

* richer option bags or runtime objects.
* This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct
* one-line guards such as `aobject()`, `afunction()`, `abool()`, or `asafenumber()` instead.
* @param object - Object to validate.
* @param fields - Required field types.
* @param optFields - Optional field types.
* @param title - Object label included in thrown errors.
* @throws On wrong argument types. {@link TypeError}

@@ -478,3 +553,3 @@ * @example

*/
export declare function validateObject(object: Record<string, any>, fields?: Record<string, string>, optFields?: Record<string, string>): void;
export declare function validateObject(object: Record<string, any>, fields?: Record<string, string>, optFields?: Record<string, string>, title?: string): void;
/**

@@ -545,2 +620,1 @@ * Throws not implemented error.

export {};
//# sourceMappingURL=utils.d.ts.map
+137
-25

@@ -8,2 +8,22 @@ /**

/**
* Validates that a value is an array, optionally validating each element.
* @param item - Value to validate.
* @param title - Label included in thrown errors.
* @param inner - Optional per-element validator, called with the element and its label.
* @returns The validated array.
* @example
* Validate an array of points before batch processing.
*
* ```ts
* aarray([1n, 2n], 'scalars');
* ```
*/
export function aarray(item, title, inner = () => { }) {
if (!Array.isArray(item))
throw new TypeError(`"${title}" expected array, got type=${typeof item}`);
for (let i = 0; i < item.length; i++)
inner(item[i], `${title}[${i}]`);
return item;
}
/**
* Validates that a value is a byte array.

@@ -26,2 +46,3 @@ * @param value - Value to validate.

* @param title - Optional field name.
* @returns The validated number.
* @example

@@ -36,2 +57,60 @@ * Validate a numeric length before allocating buffers.

/**
* Asserts something is a string.
* @param value - Value to validate.
* @param title - Label included in thrown errors.
* @returns The validated string.
* @throws On wrong argument types. {@link TypeError}
* @example
* Validate a label string.
*
* ```ts
* astring('example', 'label');
* ```
*/
export function astring(value, title = '') {
if (typeof value !== 'string') {
const prefix = title && `"${title}" `;
throw new TypeError(prefix + 'expected string, got type=' + typeof value);
}
return value;
}
/**
* Asserts something is a plain object-ish value, not null or array.
* @param value - Value to validate.
* @param title - Label included in thrown errors.
* @returns The validated object.
* @throws On wrong argument types. {@link TypeError}
* @example
* Validate an options object before checking fields.
*
* ```ts
* aobject({ flag: true });
* ```
*/
export function aobject(value, title = 'object') {
if (value === null || typeof value !== 'object' || Array.isArray(value))
throw new TypeError(title === 'object'
? 'expected valid options object'
: `"${title}" expected object, got type=${typeof value}`);
return value;
}
/**
* Asserts something is a function.
* @param value - Value to validate.
* @param title - Label included in thrown errors.
* @returns The validated function.
* @throws On wrong argument types. {@link TypeError}
* @example
* Validate a required method before calling it.
*
* ```ts
* afunction(() => true, 'predicate');
* ```
*/
export function afunction(value, title) {
if (typeof value !== 'function')
throw new TypeError(`"${title}" is invalid: expected function, got ${typeof value}`);
return value;
}
/**
* Encodes bytes as lowercase hex.

@@ -98,2 +177,5 @@ * @param bytes - Bytes to encode.

const _1n = /* @__PURE__ */ BigInt(1);
// Shared error-message prefix builder. Only called on throw paths, so assert
// success paths never pay for the string concatenation.
const atitle = (title) => (title ? `"${title}" ` : '');
/**

@@ -113,6 +195,4 @@ * Validates that a flag is boolean.

export function abool(value, title = '') {
if (typeof value !== 'boolean') {
const prefix = title && `"${title}" `;
throw new TypeError(prefix + 'expected boolean, got type=' + typeof value);
}
if (typeof value !== 'boolean')
throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value);
return value;

@@ -238,2 +318,3 @@ }

* @throws On wrong argument ranges or values. {@link RangeError}
* @throws If a documented runtime validation or state check fails. {@link Error}
* @example

@@ -249,9 +330,10 @@ * Serialize a scalar into a 32-byte field element.

if (len === 0)
throw new RangeError('zero length');
throw new Error('zero output length is invalid');
n = abignumber(n);
const expectedLen = len * 2;
const hex = n.toString(16);
// Detect overflow before hex parsing so oversized values don't leak the shared odd-hex error.
if (hex.length > len * 2)
throw new RangeError('number too large');
return hexToBytes_(hex.padStart(len * 2, '0'));
if (hex.length > expectedLen)
throw new RangeError('number is too large');
return hexToBytes_(hex.padStart(expectedLen, '0'));
}

@@ -264,2 +346,3 @@ /**

* @throws On wrong argument ranges or values. {@link RangeError}
* @throws If a documented runtime validation or state check fails. {@link Error}
* @example

@@ -356,5 +439,17 @@ * Serialize a scalar for little-endian protocols.

}
// Historical name: this accepts non-negative bigints, including zero.
const isPosBig = (n) => typeof n === 'bigint' && _0n <= n;
/**
* Checks whether n is non-negative bigint. Historical name.
* @param n - candidate value
* @returns `true` when the value is bigint and 0 or larger
* @example
* Check a candidate scalar before range validation.
*
* ```ts
* isPosBig(2n);
* ```
*/
export function isPosBig(n) {
return typeof n === 'bigint' && _0n <= n;
}
/**
* Checks whether a bigint lies inside a half-open range.

@@ -420,6 +515,4 @@ * @param n - Candidate value.

throw new Error('expected non-negative bigint, got ' + n);
let len;
for (len = 0; n > _0n; n >>= _1n, len += 1)
;
return len;
// Native radix conversion beats a shift loop at every size, and the loop is quadratic in bits.
return n === _0n ? 0 : n.toString(2).length;
}

@@ -443,2 +536,5 @@ /**

export function bitGet(n, pos) {
if (typeof n !== 'bigint')
throw new TypeError('"n" expected bigint, got type=' + typeof n);
asafenumber(pos, 'pos');
return (n >> BigInt(pos)) & _1n;

@@ -461,2 +557,6 @@ }

export function bitSet(n, pos, value) {
if (typeof n !== 'bigint')
throw new TypeError('"n" expected bigint, got type=' + typeof n);
asafenumber(pos, 'pos');
abool(value, 'value');
const mask = _1n << BigInt(pos);

@@ -479,3 +579,6 @@ // Clearing needs AND-not here; OR with zero leaves an already-set bit untouched.

*/
export const bitMask = (n) => (_1n << BigInt(n)) - _1n;
export const bitMask = (n) => {
asafenumber(n, 'n');
return (_1n << BigInt(n)) - _1n;
};
/**

@@ -497,3 +600,4 @@ * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.

* import { sha256 } from '@noble/hashes/sha2.js';
* const drbg = createHmacDrbg(32, 32, (key, msg) => hmac(sha256, key, msg));
* const hmacFn = (key: Uint8Array, msg: Uint8Array) => hmac(sha256, key, msg);
* const drbg = createHmacDrbg(32, 32, hmacFn);
* const seed = new Uint8Array(32);

@@ -566,5 +670,8 @@ * drbg(seed, (bytes) => bytes);

* richer option bags or runtime objects.
* This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct
* one-line guards such as `aobject()`, `afunction()`, `abool()`, or `asafenumber()` instead.
* @param object - Object to validate.
* @param fields - Required field types.
* @param optFields - Optional field types.
* @param title - Object label included in thrown errors.
* @throws On wrong argument types. {@link TypeError}

@@ -578,11 +685,17 @@ * @example

*/
export function validateObject(object, fields = {}, optFields = {}) {
if (Object.prototype.toString.call(object) !== '[object Object]')
throw new TypeError('expected valid options object');
export function validateObject(object, fields = {}, optFields = {}, title = 'object') {
aobject(object, title);
aobject(fields, 'fields');
aobject(optFields, 'optFields');
function checkField(fieldName, expectedType, isOpt) {
// Config/data fields must be explicit own properties, but runtime objects such as Field
// instances intentionally satisfy required method slots via their shared prototype.
if (!isOpt && expectedType !== 'function' && !Object.hasOwn(object, fieldName))
throw new TypeError(`param "${fieldName}" is invalid: expected own property`);
const label = title === 'object' ? `param "${String(fieldName)}"` : `"${title}.${String(fieldName)}"`;
// Config fields must be explicit own properties. Optional inherited values are rejected too
// because callers keep reading the same options object after validation.
const val = object[fieldName];
// Runtime objects such as Field instances intentionally satisfy required method slots
// via their shared prototype.
if (!Object.hasOwn(object, fieldName) &&
(isOpt ? val !== undefined : expectedType !== 'function')) {
throw new TypeError(`${label} is invalid: expected own property`);
}
if (isOpt && val === undefined)

@@ -592,3 +705,3 @@ return;

if (current !== expectedType || val === null)
throw new TypeError(`param "${fieldName}" is invalid: expected ${expectedType}, got ${current}`);
throw new TypeError(`${label} is invalid: expected ${expectedType}, got ${current}`);
}

@@ -615,2 +728,1 @@ const iter = (f, isOpt) => Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt));

};
//# sourceMappingURL=utils.js.map

@@ -44,3 +44,3 @@ /**

/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import type { TArg, TRet } from './utils.ts';
import { type TArg, type TRet } from './utils.ts';
/** Raw type */

@@ -242,2 +242,1 @@ declare const TYPE_RAW = "raw";

export {};
//# sourceMappingURL=webcrypto.d.ts.map

@@ -0,1 +1,45 @@

/**
* Friendly wrapper over elliptic curves from built-in WebCrypto. Experimental: API may change.
# WebCrypto issues
## No way to get public keys
- Export of raw secret key is prohibited by spec:
- https://w3c.github.io/webcrypto/#ecdsa-operations-export-key
-> "If format is "raw":" -> "If the [[type]] internal slot of key is not "public",
then throw an InvalidAccessError."
- Import of raw secret keys is prohibited by spec:
- https://w3c.github.io/webcrypto/#ecdsa-operations-import-key
-> "If format is "raw":" -> "If usages contains a value which is not "verify"
then throw a SyntaxError."
- SPKI (Simple public-key infrastructure) is public-key-only
- PKCS8 is secret-key-only
- No way to get public key from secret key, but we convert to JWK and then
create it manually, since a JWK secret key includes both private and public
parts.
- Noble supports generating keys for both sign, verify & getSharedSecret,
but JWK key includes usage, which forces us to patch it (non-JWK is ok)
- We have import/export for 'raw', but it doesn't work in Firefox / Safari
## Point encoding
- Raw export of public points returns uncompressed points,
but this is implementation specific and not much we can do there.
- `getSharedSecret` differs for p256, p384, p521:
Noble returns 33-byte output (y-parity + x coordinate),
while in WebCrypto returns 32-byte output (x coordinate).
This is intentional: noble keeps the full encoded shared point, and x-only
callers can slice it down themselves.
- `getSharedSecret` identical for X25519, X448
## Availability
Node.js additionally supports ed448.
There seems no reasonable way to check for availability, other than actually calling methods.
* @module
*/
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { abytes, validateObject } from "./utils.js";
/** Raw type */

@@ -71,3 +115,3 @@ const TYPE_RAW = 'raw';

// This is the best one can do. JWK can't be used: it contains public key component inside.
const k = key;
const k = abytes(key, keyLen, 'secretKey');
const head = hexToBytesLocal(pkcs8header);

@@ -116,2 +160,3 @@ const all = new Uint8Array(head.length + k.length);

async function getPublicKey(secretKey, opts = {}) {
validateObject(opts, {}, { formatSec: 'string', formatPub: 'string' }, 'opts');
const fsec = opts.formatSec ?? dfsec;

@@ -174,2 +219,3 @@ const fpub = opts.formatPub ?? dfpub;

async sign(msgHash, secretKey, opts = {}) {
validateObject(opts, {}, { formatSec: 'string', formatPub: 'string' }, 'opts');
const key = await keys.priv.import(secretKey, opts.formatSec ?? dfsec);

@@ -180,2 +226,3 @@ const sig = await getSubtle().sign(algo, key, msgHash);

async verify(signature, msgHash, publicKey, opts = {}) {
validateObject(opts, {}, { formatSec: 'string', formatPub: 'string' }, 'opts');
const key = await keys.pub.import(publicKey, opts.formatPub ?? dfpub);

@@ -191,2 +238,3 @@ return await getSubtle().verify(algo, key, signature, msgHash);

async getSharedSecret(secretKeyA, publicKeyB, opts = {}) {
validateObject(opts, {}, { formatSec: 'string', formatPub: 'string' }, 'opts');
// if (_isCompressed !== true) throw new Error('WebCrypto only supports compressed keys');

@@ -368,2 +416,1 @@ const secKey = await keys.priv.import(secretKeyA, opts.formatSec === undefined ? dfsec : opts.formatSec);

export const x448 = /* @__PURE__ */ wrapMontgomery('X448', 56, '3046020100300506032b656f043a0438');
//# sourceMappingURL=webcrypto.js.map
{"version":3,"file":"bls.d.ts","sourceRoot":"","sources":["../src/abstract/bls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;IAeI;AACJ,sEAAsE;AACtE,OAAO,EAAuC,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAoC,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEpF,KAAK,EAAE,GAAG,MAAM,CAAC;AAKjB;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,UAAU,CAAC;AAEzD;;;;GAIG;AACH,MAAM,M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C,CAAC,CAAC,CAAC,CAAC,gBAAgB;YAC1C,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,SAAS,gBAAgB,CACvB,SAA2B,EAC3B,OAAyB,EACzB,OAA+B,EAAE;QAEjC,0EAA0E;QAC1E,6DAA6D;QAC7D,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAC1D,OAAO,GAAG,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/C,OAAO,SAAS,CAAC,SAAS,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IACzF,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,MAAM;QACN,YAAY;QACZ,eAAe;QACf,KAAK;QACL,OAAO;QACP,KAAK;QACL,IAAI;QACJ,MAAM;QACN,gBAAgB;QAChB,SAAS;QACT,IAAI,EAAE,KAAK;KACZ,CAAkB,CAAC;AACtB,CAAC"}
{"version":3,"file":"bls12-381.d.ts","sourceRoot":"","sources":["src/bls12-381.ts"],"names":[],"mappings":"AAgFA,OAAO,EAAO,KAAK,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAS,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAYL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AA2DpB;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAEpB,CAAC;AA+Y3B;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,EAAE,0BAOvB,CAAC"}
{"version":3,"file":"bls12-381.js","sourceRoot":"","sources":["src/bls12-381.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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AAC;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,aAAa,GAAe,eAAe,CAAC,CAAC,GAAG,EAAE,CAC7D,UAAU,CAAC;IACT,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,CAAC,GAAqB,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAC7D,WAAW,EAAE,eAAe,CAAC,WAAW;IACxC,YAAY,EAAE,eAAe,CAAC,YAAY;CAC3C,CAAC,CAAC,EAAE,CAAC;AAER;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAsB,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC;IACrF,oHAAoH;IACpH,oHAAoH;IACpH,oHAAoH;IACpH,oHAAoH;CACrH,CAAC,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":""}
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC"}
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["src/misc.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,KAAK,EAEV,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAsB,KAAK,KAAK,EAAwB,MAAM,2BAA2B,CAAC;AACjG,OAAO,EAAgB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAgBrD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,EAAE,KAAsE,CAAC;AAoB5F;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU,EAAE,KACsB,CAAC;AAQhD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CA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