): WeierstrassPoint;
- /**
- * Verify one signature against one public key and hashed message.
- * @param signature - Signature point or encoded signature.
- * @param message - Hashed message point.
- * @param publicKey - Public-key point or encoded key.
- * @returns Whether the signature is valid.
- */
- verify(signature: WeierstrassPoint | BLSInput, message: WeierstrassPoint, publicKey: WeierstrassPoint | BLSInput): boolean;
- /**
- * Verify one aggregated signature against many `(message, publicKey)` pairs.
- * @param signature - Aggregated signature.
- * @param items - Message/public-key pairs.
- * @returns Whether the aggregated signature is valid. Same-message aggregate verification still
- * requires proof of possession or another rogue-key defense from the caller.
- */
- verifyBatch: (signature: WeierstrassPoint | BLSInput, items: {
- message: WeierstrassPoint;
- publicKey: WeierstrassPoint
| BLSInput;
- }[]) => boolean;
- /**
- * Add many public keys into one aggregate point.
- * @param publicKeys - Public keys to aggregate.
- * @returns Aggregated public-key point. This is raw point addition and does not add proof of
- * possession or rogue-key protection on its own.
- */
- aggregatePublicKeys(publicKeys: (WeierstrassPoint
| BLSInput)[]): WeierstrassPoint
;
- /**
- * Add many signatures into one aggregate point.
- * @param signatures - Signatures to aggregate.
- * @returns Aggregated signature point. This is raw point addition and does not change the proof
- * of possession requirements of the aggregate-verification scheme.
- */
- aggregateSignatures(signatures: (WeierstrassPoint | BLSInput)[]): WeierstrassPoint;
- /**
- * Hash an arbitrary message onto the signature subgroup.
- * @param message - Message bytes.
- * @param DST - Optional domain separation tag.
- * @returns Curve point on the signature subgroup.
- */
- hash(message: TArg, DST?: TArg): WeierstrassPoint;
- /** Signature codec for this mode. */
- Signature: BlsLongSignatureCoder;
-}
-type BlsSignatureCoders = Partial<{
- LongSignature: BlsLongSignatureCoder;
- ShortSignature: BlsShortSignatureCoder;
-}>;
-/**
- * @param fields - Tower field implementations.
- * @param G1_Point - G1 point constructor.
- * @param G2_Point - G2 point constructor.
- * @param params - Pairing parameters. See {@link BlsPairingParams}.
- * @returns Pairing-only BLS helpers. The returned pairing surface rejects infinity inputs, while
- * empty `pairingBatch(...)` calls return the multiplicative identity in GT. This keeps the
- * low-level pairing API fail-closed for BLS-style callers, where identity points usually signal
- * broken hash / wiring instead of an intentionally neutral pairing term. This also eagerly
- * precomputes the G1 base-point table as a performance side effect.
- * @throws If the pairing parameters or underlying curve helpers are inconsistent. {@link Error}
- * @example
- * ```ts
- * import { blsBasic } from '@noble/curves/abstract/bls.js';
- * 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);
- * ```
- */
-export declare function blsBasic(fields: TArg, G1_Point: WeierstrassPointCons, G2_Point: WeierstrassPointCons, params: TArg): BlsCurvePair;
-/**
- * @param fields - Tower field implementations.
- * @param G1_Point - G1 point constructor.
- * @param G2_Point - G2 point constructor.
- * @param params - Pairing parameters. See {@link BlsPairingParams}.
- * @param hasherParams - Hash-to-curve configuration. See {@link BlsHasherParams}.
- * @param signatureCoders - Signature codecs.
- * @returns BLS helpers with signers. The inherited pairing surface still rejects infinity inputs,
- * and empty `pairingBatch(...)` calls still return the multiplicative identity in GT. Aggregate
- * verification still requires proof of possession or another rogue-key defense from the caller.
- * @throws If the pairing, hashing, or signature helpers are configured inconsistently. {@link Error}
- * @example
- * ```ts
- * import { bls } from '@noble/curves/abstract/bls.js';
- * 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);
- * ```
- */
-export declare function bls(fields: TArg, G1_Point: WeierstrassPointCons, G2_Point: WeierstrassPointCons, params: TArg, hasherParams: TArg, signatureCoders: BlsSignatureCoders): BlsCurvePairWithSignatures;
-export {};
-//# sourceMappingURL=bls.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@noble/curves/abstract/bls.d.ts.map b/node_modules/@noble/curves/abstract/bls.d.ts.map
deleted file mode 100644
index 55d82eb..0000000
--- a/node_modules/@noble/curves/abstract/bls.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"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,MAAM,sBAAsB,CAAC,EAAE,IAAI;IACvC;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACzD;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC;IAC3C;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;IACvD;;;;OAIG;IACH,KAAK,CAAC,KAAK,EAAE,gBAAgB,CAAC,EAAE,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CAAC,GAAG,CAAC,CAAC;IAC1C,cAAc,EAAE,sBAAsB,CAAC,EAAE,CAAC,CAAC;CAC5C,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EACvB,QAAQ,EAAE,oBAAoB,CAAC,EAAE,CAAC,EAClC,QAAQ,EAAE,oBAAoB,CAAC,GAAG,CAAC,EACnC,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,GAC7B,YAAY,CAuCd;AAiCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,GAAG,CACjB,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EACvB,QAAQ,EAAE,oBAAoB,CAAC,EAAE,CAAC,EAClC,QAAQ,EAAE,oBAAoB,CAAC,GAAG,CAAC,EACnC,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,EAC9B,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,EACnC,eAAe,EAAE,kBAAkB,GAClC,0BAA0B,CA0B5B"}
\ No newline at end of file
diff --git a/node_modules/@noble/curves/abstract/bls.js b/node_modules/@noble/curves/abstract/bls.js
deleted file mode 100644
index 56e83db..0000000
--- a/node_modules/@noble/curves/abstract/bls.js
+++ /dev/null
@@ -1,432 +0,0 @@
-/**
- * BLS != BLS.
- * The file implements BLS (Boneh-Lynn-Shacham) signatures.
- * Used in both BLS (Barreto-Lynn-Scott) and BN (Barreto-Naehrig)
- * families of pairing-friendly curves.
- * Consists of two curves: G1 and G2:
- * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4.
- * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1
- * - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in
- * Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not.
- * Pairing is used to aggregate and verify signatures.
- * There are two modes of operation:
- * - Long signatures: X-byte keys + 2X-byte sigs (G1 keys + G2 sigs).
- * - Short signatures: 2X-byte keys + X-byte sigs (G2 keys + G1 sigs).
- * @module
- **/
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-import { abytes, notImplemented, randomBytes } from "../utils.js";
-import {} from "./curve.js";
-import { createHasher, } from "./hash-to-curve.js";
-import { getMinHashLength, mapHashToField } from "./modular.js";
-import {} from "./weierstrass.js";
-// prettier-ignore
-const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3);
-// Signed non-adjacent decomposition of the spec-defined Miller-loop parameter.
-// BN254 benefits most because `6x+2` has multiple adjacent `11` runs, but BLS12-381's
-// stored `|x|` still starts with `11`, so the Miller loop must also handle one `-1` digit there.
-function NAfDecomposition(a) {
- const res = [];
- // a>1 because of marker bit
- for (; a > _1n; a >>= _1n) {
- if ((a & _1n) === _0n)
- res.unshift(0);
- else if ((a & _3n) === _3n) {
- res.unshift(-1);
- a += _1n;
- }
- else
- res.unshift(1);
- }
- return res;
-}
-function aNonEmpty(arr) {
- // Aggregate helpers use this to reject empty variable-length inputs consistently.
- // Without the guard, each caller would fall through into a different empty-input / identity
- // case and hide missing inputs behind outputs that still look structurally valid.
- if (!Array.isArray(arr) || arr.length === 0)
- throw new Error('expected non-empty array');
-}
-// This should be enough for bn254, no need to export full stuff?
-function createBlsPairing(fields, G1, G2, params) {
- const { Fr, Fp2, Fp12 } = fields;
- const { twistType, ateLoopSize, xNegative, postPrecompute } = params;
- // 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));
- }
- else if (twistType === 'divisive') {
- // NOTE: it should be [c0, c1, c2], but we use different order here to reduce complexity of
- // precompute calculations.
- lineFunction = (c0, c1, c2, f, Px, Py) => Fp12.mul034(f, Fp2.mul(c2, Py), Fp2.mul(c1, Px), c0);
- }
- else
- throw new Error('bls: unknown twist type');
- const Fp2div2 = Fp2.div(Fp2.ONE, Fp2.mul(Fp2.ONE, _2n));
- function pointDouble(ell, Rx, Ry, Rz) {
- const t0 = Fp2.sqr(Ry); // Ry²
- const t1 = Fp2.sqr(Rz); // Rz²
- const t2 = Fp2.mulByB(Fp2.mul(t1, _3n)); // 3 * T1 * B
- const t3 = Fp2.mul(t2, _3n); // 3 * T2
- const t4 = Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(Ry, Rz)), t1), t0); // (Ry + Rz)² - T1 - T0
- const c0 = Fp2.sub(t2, t0); // T2 - T0 (i)
- const c1 = Fp2.mul(Fp2.sqr(Rx), _3n); // 3 * Rx²
- const c2 = Fp2.neg(t4); // -T4 (-h)
- ell.push([c0, c1, c2]);
- Rx = Fp2.mul(Fp2.mul(Fp2.mul(Fp2.sub(t0, t3), Rx), Ry), Fp2div2); // ((T0 - T3) * Rx * Ry) / 2
- // ((T0 + T3) / 2)² - 3 * T2²
- Ry = Fp2.sub(Fp2.sqr(Fp2.mul(Fp2.add(t0, t3), Fp2div2)), Fp2.mul(Fp2.sqr(t2), _3n));
- Rz = Fp2.mul(t0, t4); // T0 * T4
- return { Rx, Ry, Rz };
- }
- function pointAdd(ell, Rx, Ry, Rz, Qx, Qy) {
- // Addition
- const t0 = Fp2.sub(Ry, Fp2.mul(Qy, Rz)); // Ry - Qy * Rz
- const t1 = Fp2.sub(Rx, Fp2.mul(Qx, Rz)); // Rx - Qx * Rz
- const c0 = Fp2.sub(Fp2.mul(t0, Qx), Fp2.mul(t1, Qy)); // T0 * Qx - T1 * Qy == Ry * Qx - Rx * Qy
- const c1 = Fp2.neg(t0); // -T0 == Qy * Rz - Ry
- const c2 = t1; // == Rx - Qx * Rz
- ell.push([c0, c1, c2]);
- const t2 = Fp2.sqr(t1); // T1²
- const t3 = Fp2.mul(t2, t1); // T2 * T1
- const t4 = Fp2.mul(t2, Rx); // T2 * Rx
- // T3 - 2 * T4 + T0² * Rz
- const t5 = Fp2.add(Fp2.sub(t3, Fp2.mul(t4, _2n)), Fp2.mul(Fp2.sqr(t0), Rz));
- Rx = Fp2.mul(t1, t5); // T1 * T5
- Ry = Fp2.sub(Fp2.mul(Fp2.sub(t4, t5), t0), Fp2.mul(t3, Ry)); // (T4 - T5) * T0 - T3 * Ry
- Rz = Fp2.mul(Rz, t3); // Rz * T3
- return { Rx, Ry, Rz };
- }
- // Pre-compute coefficients for sparse multiplication
- // Point addition and point double calculations is reused for coefficients
- // pointAdd happens only if bit set, so wNAF is reasonable. Unfortunately we cannot combine
- // add + double in windowed precomputes here, otherwise it would be single op (since X is static)
- const ATE_NAF = NAfDecomposition(ateLoopSize);
- const calcPairingPrecomputes = (point) => {
- const p = point;
- const { x, y } = p.toAffine();
- // prettier-ignore
- const Qx = x, Qy = y, negQy = Fp2.neg(y);
- // prettier-ignore
- let Rx = Qx, Ry = Qy, Rz = Fp2.ONE;
- const ell = [];
- for (const bit of ATE_NAF) {
- const cur = [];
- ({ Rx, Ry, Rz } = pointDouble(cur, Rx, Ry, Rz));
- if (bit)
- ({ Rx, Ry, Rz } = pointAdd(cur, Rx, Ry, Rz, Qx, bit === -1 ? negQy : Qy));
- ell.push(cur);
- }
- if (postPrecompute) {
- const last = ell[ell.length - 1];
- postPrecompute(Rx, Ry, Rz, Qx, Qy, pointAdd.bind(null, last));
- }
- return ell;
- };
- function millerLoopBatch(pairs, withFinalExponent = false) {
- let f12 = Fp12.ONE;
- if (pairs.length) {
- const ellLen = pairs[0][0].length;
- for (let i = 0; i < ellLen; i++) {
- f12 = Fp12.sqr(f12); // This allows us to do sqr only one time for all pairings
- // NOTE: we apply multiple pairings in parallel here
- for (const [ell, Px, Py] of pairs) {
- for (const [c0, c1, c2] of ell[i])
- f12 = lineFunction(c0, c1, c2, f12, Px, Py);
- }
- }
- }
- if (xNegative)
- f12 = Fp12.conjugate(f12);
- return withFinalExponent ? Fp12.finalExponentiate(f12) : f12;
- }
- // Calculates product of multiple pairings
- // This up to x2 faster than just `map(({g1, g2})=>pairing({g1,g2}))`
- function pairingBatch(pairs, withFinalExponent = true) {
- const res = [];
- for (const { g1, g2 } of pairs) {
- // Mathematically, a zero pairing term contributes GT.ONE. We still reject it here because
- // this API mainly backs BLS verification, where ZERO inputs usually mean broken hash /
- // wiring. Silently skipping them would turn those failures into a neutral pairing product.
- // Callers that want the algebraic neutral-element behavior can filter ZERO terms first.
- if (g1.is0() || g2.is0())
- throw new Error('pairing is not available for ZERO point');
- // This uses toAffine inside
- g1.assertValidity();
- g2.assertValidity();
- const Qa = g1.toAffine();
- res.push([calcPairingPrecomputes(g2), Qa.x, Qa.y]);
- }
- return millerLoopBatch(res, withFinalExponent);
- }
- // Calculates bilinear pairing
- function pairing(Q, P, withFinalExponent = true) {
- return pairingBatch([{ g1: Q, g2: P }], withFinalExponent);
- }
- const lengths = {
- seed: getMinHashLength(Fr.ORDER),
- };
- const rand = params.randomBytes === undefined ? randomBytes : params.randomBytes;
- // Seeded calls deterministically reduce exactly `lengths.seed` bytes into `1..Fr.ORDER-1`;
- // omitting `seed` just fills that input buffer from the configured RNG first.
- const randomSecretKey = (seed) => {
- seed = seed === undefined ? rand(lengths.seed) : seed;
- abytes(seed, lengths.seed, 'seed');
- return mapHashToField(seed, Fr.ORDER);
- };
- Object.freeze(lengths);
- return {
- lengths,
- Fr,
- Fp12, // NOTE: we re-export Fp12 here because pairing results are Fp12!
- millerLoopBatch,
- pairing,
- pairingBatch,
- calcPairingPrecomputes,
- randomSecretKey,
- };
-}
-function createBlsSig(blsPairing, PubPoint, SigPoint, isSigG1, hashToSigCurve, SignatureCoder) {
- const { Fr, Fp12, pairingBatch, randomSecretKey, lengths } = blsPairing;
- if (!SignatureCoder) {
- SignatureCoder = {
- fromBytes: notImplemented,
- fromHex: notImplemented,
- toBytes: notImplemented,
- toHex: notImplemented,
- };
- }
- function normPub(point) {
- return point instanceof PubPoint ? point : PubPoint.fromBytes(point);
- }
- function normSig(point) {
- return point instanceof SigPoint ? point : SigPoint.fromBytes(point);
- }
- // Sign/verify here take points already hashed onto the signature subgroup.
- // Raw bytes and points from the other subgroup must fail this constructor-brand
- // check before later validity checks run.
- function amsg(m) {
- if (!(m instanceof SigPoint))
- throw new Error(`expected valid message hashed to ${!isSigG1 ? 'G2' : 'G1'} curve`);
- return m;
- }
- // What matters here is what point pairing API accepts as G1 or G2, not actual size or names
- const pair = !isSigG1
- ? (a, b) => ({ g1: a, g2: b })
- : (a, b) => ({ g1: b, g2: a });
- return Object.freeze({
- lengths: Object.freeze({ ...lengths, secretKey: Fr.BYTES }),
- keygen(seed) {
- const secretKey = randomSecretKey(seed);
- const publicKey = this.getPublicKey(secretKey);
- return { secretKey, publicKey };
- },
- // P = pk x G
- getPublicKey(secretKey) {
- let sec;
- try {
- sec = PubPoint.Fn.fromBytes(secretKey);
- }
- catch (error) {
- // @ts-ignore
- throw new Error('invalid private key: ' + typeof secretKey, { cause: error });
- }
- return PubPoint.BASE.multiply(sec);
- },
- // S = pk x H(m)
- sign(message, secretKey, unusedArg) {
- if (unusedArg != null)
- throw new Error('sign() expects 2 arguments');
- const sec = PubPoint.Fn.fromBytes(secretKey);
- amsg(message).assertValidity();
- return message.multiply(sec);
- },
- // Checks if pairing of public key & hash is equal to pairing of generator & signature.
- // e(P, H(m)) == e(G, S)
- // e(S, G) == e(H(m), P)
- verify(signature, message, publicKey, unusedArg) {
- if (unusedArg != null)
- throw new Error('verify() expects 3 arguments');
- signature = normSig(signature);
- publicKey = normPub(publicKey);
- const P = publicKey.negate();
- const G = PubPoint.BASE;
- const Hm = amsg(message);
- const S = signature;
- // This code was changed in 1.9.x:
- // Before it was G.negate() in G2, now it's always pubKey.negate
- // e(P, -Q)===e(-P, Q)==e(P, Q)^-1. Negate can be done anywhere (as long it is done once per pair).
- // We just moving sign, but since pairing is multiplicative, we doing X * X^-1 = 1
- try {
- const exp = pairingBatch([pair(P, Hm), pair(G, S)]);
- return Fp12.eql(exp, Fp12.ONE);
- }
- catch {
- return false;
- }
- },
- // https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407
- // e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si))
- // TODO: maybe `{message: G2Hex, publicKey: G1Hex}[]` instead?
- verifyBatch(signature, items) {
- aNonEmpty(items);
- const sig = normSig(signature);
- const nMessages = items.map((i) => i.message);
- const nPublicKeys = items.map((i) => normPub(i.publicKey));
- // NOTE: this works only for exact same object
- const messagePubKeyMap = new Map();
- for (let i = 0; i < nPublicKeys.length; i++) {
- const pub = nPublicKeys[i];
- const msg = nMessages[i];
- let keys = messagePubKeyMap.get(msg);
- if (keys === undefined) {
- keys = [];
- messagePubKeyMap.set(msg, keys);
- }
- keys.push(pub);
- }
- const paired = [];
- const G = PubPoint.BASE;
- try {
- for (const [msg, keys] of messagePubKeyMap) {
- const groupPublicKey = keys.reduce((acc, msg) => acc.add(msg));
- paired.push(pair(groupPublicKey, msg));
- }
- paired.push(pair(G.negate(), sig));
- return Fp12.eql(pairingBatch(paired), Fp12.ONE);
- }
- catch {
- return false;
- }
- },
- // Adds a bunch of public key points together.
- // pk1 + pk2 + pk3 = pkA
- aggregatePublicKeys(publicKeys) {
- aNonEmpty(publicKeys);
- publicKeys = publicKeys.map((pub) => normPub(pub));
- const agg = publicKeys.reduce((sum, p) => sum.add(p), PubPoint.ZERO);
- agg.assertValidity();
- return agg;
- },
- // Adds a bunch of signature points together.
- // pk1 + pk2 + pk3 = pkA
- aggregateSignatures(signatures) {
- aNonEmpty(signatures);
- signatures = signatures.map((sig) => normSig(sig));
- const agg = signatures.reduce((sum, s) => sum.add(s), SigPoint.ZERO);
- agg.assertValidity();
- return agg;
- },
- hash(messageBytes, DST) {
- abytes(messageBytes);
- const opts = DST ? { DST } : undefined;
- return hashToSigCurve(messageBytes, opts);
- },
- Signature: Object.freeze({ ...SignatureCoder }),
- }) /*satisfies Signer */;
-}
-// NOTE: separate function instead of function override, so we don't depend on hasher in bn254.
-/**
- * @param fields - Tower field implementations.
- * @param G1_Point - G1 point constructor.
- * @param G2_Point - G2 point constructor.
- * @param params - Pairing parameters. See {@link BlsPairingParams}.
- * @returns Pairing-only BLS helpers. The returned pairing surface rejects infinity inputs, while
- * empty `pairingBatch(...)` calls return the multiplicative identity in GT. This keeps the
- * low-level pairing API fail-closed for BLS-style callers, where identity points usually signal
- * broken hash / wiring instead of an intentionally neutral pairing term. This also eagerly
- * precomputes the G1 base-point table as a performance side effect.
- * @throws If the pairing parameters or underlying curve helpers are inconsistent. {@link Error}
- * @example
- * ```ts
- * import { blsBasic } from '@noble/curves/abstract/bls.js';
- * 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);
- * ```
- */
-export function blsBasic(fields, G1_Point, G2_Point, params) {
- // Fields are specific for curve, so for now we'll need to pass them with opts
- const { Fp, Fr, Fp2, Fp6, Fp12 } = fields;
- // Point on G1 curve: (x, y)
- // const G1_Point = weierstrass(CURVE.G1, { Fn: Fr });
- const G1 = { Point: G1_Point };
- // Point on G2 curve (complex numbers): (x₁, x₂+i), (y₁, y₂+i)
- const G2 = { Point: G2_Point };
- const pairingRes = createBlsPairing(fields, G1_Point, G2_Point, params);
- const { millerLoopBatch, pairing, pairingBatch, calcPairingPrecomputes, randomSecretKey, lengths, } = pairingRes;
- G1.Point.BASE.precompute(4);
- Object.freeze(G1);
- Object.freeze(G2);
- return Object.freeze({
- lengths: Object.freeze(lengths),
- millerLoopBatch,
- pairing,
- pairingBatch,
- G1,
- G2,
- fields: Object.freeze({ Fr, Fp, Fp2, Fp6, Fp12 }),
- params: Object.freeze({
- ateLoopSize: params.ateLoopSize,
- twistType: params.twistType,
- }),
- utils: Object.freeze({
- randomSecretKey,
- calcPairingPrecomputes,
- }),
- });
-}
-// We can export this too, but seems there is not much reasons for now? If user wants hasher, they can just create hasher.
-function blsHashers(fields, G1_Point, G2_Point, params, hasherParams) {
- const base = blsBasic(fields, G1_Point, G2_Point, params);
- // Missing map hooks intentionally fail closed via notImplemented on first hash use.
- const G1Hasher = createHasher(G1_Point, hasherParams.mapToG1 === undefined ? notImplemented : hasherParams.mapToG1, {
- ...hasherParams.hasherOpts,
- ...hasherParams.hasherOptsG1,
- });
- const G2Hasher = createHasher(G2_Point, hasherParams.mapToG2 === undefined ? notImplemented : hasherParams.mapToG2, {
- ...hasherParams.hasherOpts,
- ...hasherParams.hasherOptsG2,
- });
- return Object.freeze({ ...base, G1: G1Hasher, G2: G2Hasher });
-}
-// G1_Point: ProjConstructor, G2_Point: ProjConstructor,
-// Rename to blsSignatures?
-/**
- * @param fields - Tower field implementations.
- * @param G1_Point - G1 point constructor.
- * @param G2_Point - G2 point constructor.
- * @param params - Pairing parameters. See {@link BlsPairingParams}.
- * @param hasherParams - Hash-to-curve configuration. See {@link BlsHasherParams}.
- * @param signatureCoders - Signature codecs.
- * @returns BLS helpers with signers. The inherited pairing surface still rejects infinity inputs,
- * and empty `pairingBatch(...)` calls still return the multiplicative identity in GT. Aggregate
- * verification still requires proof of possession or another rogue-key defense from the caller.
- * @throws If the pairing, hashing, or signature helpers are configured inconsistently. {@link Error}
- * @example
- * ```ts
- * import { bls } from '@noble/curves/abstract/bls.js';
- * 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);
- * ```
- */
-export function bls(fields, G1_Point, G2_Point, params, hasherParams, signatureCoders) {
- const base = blsHashers(fields, G1_Point, G2_Point, params, hasherParams);
- const pairingRes = {
- ...base,
- Fr: base.fields.Fr,
- Fp12: base.fields.Fp12,
- calcPairingPrecomputes: base.utils.calcPairingPrecomputes,
- randomSecretKey: base.utils.randomSecretKey,
- };
- const longSignatures = createBlsSig(pairingRes, G1_Point, G2_Point, false, base.G2.hashToCurve, signatureCoders?.LongSignature);
- const shortSignatures = createBlsSig(pairingRes, G2_Point, G1_Point, true, base.G1.hashToCurve, signatureCoders?.ShortSignature);
- return Object.freeze({ ...base, longSignatures, shortSignatures });
-}
-//# sourceMappingURL=bls.js.map
\ No newline at end of file
diff --git a/node_modules/@noble/curves/abstract/bls.js.map b/node_modules/@noble/curves/abstract/bls.js.map
deleted file mode 100644
index 91b4fd8..0000000
--- a/node_modules/@noble/curves/abstract/bls.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"bls.js","sourceRoot":"","sources":["../src/abstract/bls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;IAeI;AACJ,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAwB,MAAM,aAAa,CAAC;AACxF,OAAO,EAAqB,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,YAAY,GAKb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAe,MAAM,cAAc,CAAC;AAE7E,OAAO,EAAoD,MAAM,kBAAkB,CAAC;AAIpF,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAwWzE,+EAA+E;AAC/E,sFAAsF;AACtF,iGAAiG;AACjG,SAAS,gBAAgB,CAAC,CAAS;IACjC,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,4BAA4B;IAC5B,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,GAAG;YAAE,GAAG,CAAC,OAAO,CAAC,CA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;AAChE,CAAC;AAED,qEAAqE;AACrE,2BAA2B;AAC3B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,GAAG,CACjB,MAAuB,EACvB,QAAkC,EAClC,QAAmC,EACnC,MAA8B,EAC9B,YAAmC,EACnC,eAAmC;IAEnC,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAC1E,MAAM,UAAU,GAAe;QAC7B,GAAG,IAAI;QACP,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;QAClB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;QACtB,sBAAsB,EAAE,IAAI,CAAC,KAAK,CAAC,sBAAsB;QACzD,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe;KAC5C,CAAC;IACF,MAAM,cAAc,GAAG,YAAY,CACjC,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,IAAI,CAAC,EAAE,CAAC,WAAW,EACnB,eAAe,EAAE,aAAa,CAC/B,CAAC;IACF,MAAM,eAAe,GAAG,YAAY,CAClC,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,IAAI,CAAC,EAAE,CAAC,WAAW,EACnB,eAAe,EAAE,cAAc,CAChC,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC,CAAC;AACrE,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@noble/curves/abstract/curve.d.ts b/node_modules/@noble/curves/abstract/curve.d.ts
deleted file mode 100644
index 8e98ccc..0000000
--- a/node_modules/@noble/curves/abstract/curve.d.ts
+++ /dev/null
@@ -1,442 +0,0 @@
-/**
- * Methods for elliptic curve multiplication by scalars.
- * Contains wNAF, pippenger.
- * @module
- */
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-import { type Signer, type TArg, type TRet } from '../utils.ts';
-import { type IField } from './modular.ts';
-/** Affine point coordinates without projective fields. */
-export type AffinePoint = {
- /** Affine x coordinate. */
- x: T;
- /** Affine y coordinate. */
- y: T;
-} & {
- Z?: never;
-};
-/** Base interface for all elliptic-curve point instances. */
-export interface CurvePoint> {
- /** Affine x coordinate. Different from projective / extended X coordinate. */
- x: F;
- /** Affine y coordinate. Different from projective / extended Y coordinate. */
- y: F;
- /** Projective Z coordinate when the point keeps projective state. */
- Z?: F;
- /**
- * Double the point.
- * @returns Doubled point.
- */
- double(): P;
- /**
- * Negate the point.
- * @returns Negated point.
- */
- negate(): P;
- /**
- * Add another point from the same curve.
- * @param other - Point to add.
- * @returns Sum point.
- */
- add(other: P): P;
- /**
- * Subtract another point from the same curve.
- * @param other - Point to subtract.
- * @returns Difference point.
- */
- subtract(other: P): P;
- /**
- * Compare two points for equality.
- * @param other - Point to compare.
- * @returns Whether the points are equal.
- */
- equals(other: P): boolean;
- /**
- * Multiply the point by a scalar in constant time.
- * Implementations keep the subgroup-scalar contract strict and may reject
- * `0` instead of returning the identity point.
- * @param scalar - Scalar multiplier.
- * @returns Product point.
- */
- multiply(scalar: bigint): P;
- /** Assert that the point satisfies the curve equation and subgroup checks. */
- assertValidity(): void;
- /**
- * Map the point into the prime-order subgroup when the curve requires it.
- * @returns Prime-order point.
- */
- clearCofactor(): P;
- /**
- * Check whether the point is the point at infinity.
- * @returns Whether the point is zero.
- */
- is0(): boolean;
- /**
- * Check whether the point belongs to the prime-order subgroup.
- * @returns Whether the point is torsion-free.
- */
- isTorsionFree(): boolean;
- /**
- * Check whether the point lies in a small torsion subgroup.
- * @returns Whether the point has small order.
- */
- isSmallOrder(): boolean;
- /**
- * Multiply the point by a scalar without constant-time guarantees.
- * Public-scalar callers that need `0` should use this method instead of
- * relying on `multiply(...)` to return the identity point.
- * @param scalar - Scalar multiplier.
- * @returns Product point.
- */
- multiplyUnsafe(scalar: bigint): P;
- /**
- * Massively speeds up `p.multiply(n)` by using precompute tables (caching). See {@link wNAF}.
- * Cache state lives in internal WeakMaps keyed by point identity, not on the point object.
- * Repeating `precompute(...)` for the same point identity replaces the remembered window size
- * and forces table regeneration for that point.
- * @param windowSize - Precompute window size.
- * @param isLazy - calculate cache now. Default (true) ensures it's deferred to first `multiply()`
- * @returns Same point instance with precompute tables attached.
- */
- precompute(windowSize?: number, isLazy?: boolean): P;
- /**
- * Converts point to 2D xy affine coordinates.
- * @param invertedZ - Optional inverted Z coordinate for batch normalization.
- * @returns Affine x/y coordinates.
- */
- toAffine(invertedZ?: F): AffinePoint;
- /**
- * Encode the point into the curve's canonical byte form.
- * @returns Encoded point bytes.
- */
- toBytes(): Uint8Array;
- /**
- * Encode the point into the curve's canonical hex form.
- * @returns Encoded point hex.
- */
- toHex(): string;
-}
-/** Base interface for elliptic-curve point constructors. */
-export interface CurvePointCons> {
- /**
- * Runtime brand check for points created by this constructor.
- * @param item - Value to test.
- * @returns Whether the value is a point from this constructor.
- */
- [Symbol.hasInstance]: (item: unknown) => boolean;
- /** Canonical subgroup generator. */
- BASE: P;
- /** Point at infinity. */
- ZERO: P;
- /** Field for basic curve math */
- Fp: IField>;
- /** Scalar field, for scalars in multiply and others */
- Fn: IField;
- /**
- * Create one point from affine coordinates.
- * Does NOT validate curve, subgroup, or wrapper invariants.
- * Use `.assertValidity()` on adversarial inputs.
- * @param p - Affine point coordinates.
- * @returns Point instance.
- */
- fromAffine(p: AffinePoint>): P;
- /**
- * Decode a point from the canonical byte encoding.
- * @param bytes - Encoded point bytes.
- * Implementations MUST treat `bytes` as read-only.
- * @returns Point instance.
- */
- fromBytes(bytes: Uint8Array): P;
- /**
- * Decode a point from the canonical hex encoding.
- * @param hex - Encoded point hex.
- * @returns Point instance.
- */
- fromHex(hex: string): P;
-}
-/** Returns the affine field type for a point instance (`P_F == P.F`). */
-export type P_F
> = P extends CurvePoint ? F : never;
-/** Returns the affine field type for a point constructor (`PC_F == PC.P.F`). */
-export type PC_F>> = PC['Fp']['ZERO'];
-/** Returns the point instance type for a point constructor (`PC_P == PC.P`). */
-export type PC_P>> = PC['ZERO'];
-/** Wide point-constructor type used when the concrete curve is not important. */
-export type PC_ANY = CurvePointCons>>>>>>>>>>;
-/**
- * Validates the static surface of a point constructor.
- * This is only a cheap sanity check for the constructor hooks and fields consumed by generic
- * factories; it does not certify `BASE`/`ZERO` semantics or prove the curve implementation itself.
- * @param Point - Runtime point constructor.
- * @throws On missing constructor hooks or malformed field metadata. {@link TypeError}
- * @example
- * Check that one point constructor exposes the static hooks generic helpers need.
- *
- * ```ts
- * import { ed25519 } from '@noble/curves/ed25519.js';
- * import { validatePointCons } from '@noble/curves/abstract/curve.js';
- * validatePointCons(ed25519.Point);
- * ```
- */
-export declare function validatePointCons>(Point: CurvePointCons
): void;
-/** Byte lengths used by one curve implementation. */
-export interface CurveLengths {
- /** Secret-key length in bytes. */
- secretKey?: number;
- /** Compressed public-key length in bytes. */
- publicKey?: number;
- /** Uncompressed public-key length in bytes. */
- publicKeyUncompressed?: number;
- /** Whether public-key encodings include a format prefix byte. */
- publicKeyHasPrefix?: boolean;
- /** Signature length in bytes. */
- signature?: number;
- /** Seed length in bytes when the curve exposes deterministic keygen from seed. */
- seed?: number;
-}
-/** Reorders or otherwise remaps a batch while preserving its element type. */
-export type Mapper = (i: T[]) => T[];
-/**
- * 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;
-}>(condition: boolean, item: T): T;
-/**
- * Takes a bunch of Projective Points but executes only one
- * inversion on all of them. Inversion is very slow operation,
- * so this improves performance massively.
- * Optimization: converts a list of projective points to a list of identical points with Z=1.
- * Input points are left unchanged; the normalized points are returned as fresh instances.
- * @param c - Point constructor.
- * @param points - Projective points.
- * @returns Fresh projective points reconstructed from normalized affine coordinates.
- * @example
- * Batch-normalize projective points with a single shared inversion.
- *
- * ```ts
- * import { normalizeZ } from '@noble/curves/abstract/curve.js';
- * import { p256 } from '@noble/curves/nist.js';
- * const points = normalizeZ(p256.Point, [p256.Point.BASE, p256.Point.BASE.double()]);
- * ```
- */
-export declare function normalizeZ, PC extends CurvePointCons
>(c: PC, points: P[]): P[];
-/**
- * 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.
- *
- * 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.
- * @param Point - Point constructor.
- * @param bits - Scalar bit length.
- * @example
- * Elliptic curve multiplication of Point by scalar.
- *
- * ```ts
- * import { wNAF } from '@noble/curves/abstract/curve.js';
- * import { p256 } from '@noble/curves/nist.js';
- * const ladder = new wNAF(p256.Point, p256.Point.Fn.BITS);
- * ```
- */
-export declare class wNAF {
- private readonly BASE;
- private readonly ZERO;
- private readonly Fn;
- readonly bits: number;
- constructor(Point: PC, bits: number);
- _unsafeLadder(elm: PC_P, n: bigint, p?: PC_P): PC_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.
- * @param point - Point instance
- * @param W - window size
- * @returns precomputed point tables flattened to a single array
- */
- private precomputeWindow;
- /**
- * 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
- * @returns real and fake (for const-time) points
- */
- private wNAF;
- /**
- * 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;
- private getPrecomputes;
- cached(point: PC_P, scalar: bigint, transform?: Mapper>): {
- p: PC_P;
- f: PC_P;
- };
- unsafe(point: PC_P, scalar: bigint, transform?: Mapper>, prev?: PC_P): PC_P;
- createCache(P: PC_P, W: number): void;
- hasCache(elm: PC_P): 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.
- * @example
- * Endomorphism-specific multiplication for Koblitz curves.
- *
- * ```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);
- * ```
- */
-export declare function mulEndoUnsafe, PC extends CurvePointCons
>(Point: PC, point: P, k1: bigint, k2: bigint): {
- p1: P;
- p2: P;
-};
-/**
- * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
- * 30x faster vs naive addition on L=4096, 10x faster than precomputes.
- * 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.
- * @param c - Curve Point constructor
- * @param points - array of L curve points
- * @param scalars - array of L scalars (aka secret keys / bigints)
- * @returns MSM result point. Empty input is accepted and returns the identity.
- * @throws If the point set, scalar set, or MSM sizing is invalid. {@link Error}
- * @example
- * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
- *
- * ```ts
- * import { pippenger } from '@noble/curves/abstract/curve.js';
- * import { p256 } from '@noble/curves/nist.js';
- * const point = pippenger(p256.Point, [p256.Point.BASE, p256.Point.BASE.double()], [2n, 3n]);
- * ```
- */
-export declare function pippenger
, PC extends CurvePointCons
>(c: PC, points: P[], scalars: bigint[]): P;
-/**
- * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
- * @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.
- * @throws If the point set or precompute window is invalid. {@link Error}
- * @example
- * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
- *
- * ```ts
- * import { precomputeMSMUnsafe } from '@noble/curves/abstract/curve.js';
- * import { p256 } from '@noble/curves/nist.js';
- * const msm = precomputeMSMUnsafe(p256.Point, [p256.Point.BASE], 4);
- * const point = msm([3n]);
- * ```
- */
-export declare function precomputeMSMUnsafe
, PC extends CurvePointCons
>(c: PC, points: P[], windowSize: number): (scalars: bigint[]) => P;
-/** Minimal curve parameters needed to construct a Weierstrass or Edwards curve. */
-export type ValidCurveParams = {
- /** Base-field modulus. */
- p: bigint;
- /** Prime subgroup order. */
- n: bigint;
- /** Cofactor. */
- h: bigint;
- /** Curve parameter `a`. */
- a: T;
- /** Weierstrass curve parameter `b`. */
- b?: T;
- /** Edwards curve parameter `d`. */
- d?: T;
- /** Generator x coordinate. */
- Gx: T;
- /** Generator y coordinate. */
- Gy: T;
-};
-/** Pair of fields used by curve constructors. */
-export type FpFn = {
- /** Base field used for curve coordinates. */
- Fp: IField;
- /** Scalar field used for secret scalars and subgroup arithmetic. */
- Fn: IField;
-};
-/**
- * Validates basic CURVE shape and field membership, then creates fields.
- * This does not prove that the generator is on-curve, that subgroup/order data are consistent, or
- * that the curve equation itself is otherwise sane.
- * @param type - Curve family.
- * @param CURVE - Curve parameters.
- * @param curveOpts - Optional field overrides:
- * - `Fp` (optional): Optional base-field override.
- * - `Fn` (optional): Optional scalar-field override.
- * @param FpFnLE - Whether field encoding is little-endian.
- * @returns Frozen curve parameters and fields.
- * @throws If the curve parameters or field overrides are invalid. {@link Error}
- * @example
- * Build curve fields from raw constants before constructing a curve instance.
- *
- * ```ts
- * const curve = createCurveFields('weierstrass', {
- * p: 17n,
- * n: 19n,
- * h: 1n,
- * a: 2n,
- * b: 2n,
- * Gx: 5n,
- * Gy: 1n,
- * });
- * ```
- */
-export declare function createCurveFields(type: 'weierstrass' | 'edwards', CURVE: ValidCurveParams, curveOpts?: TArg>>, FpFnLE?: boolean): TRet & {
- CURVE: ValidCurveParams;
-}>;
-type KeygenFn = (seed?: Uint8Array, isCompressed?: boolean) => {
- secretKey: Uint8Array;
- publicKey: Uint8Array;
-};
-/**
- * @param randomSecretKey - Secret-key generator.
- * @param getPublicKey - Public-key derivation helper.
- * @returns Keypair generator.
- * @example
- * Build a `keygen()` helper from existing secret-key and public-key primitives.
- *
- * ```ts
- * import { createKeygen } from '@noble/curves/abstract/curve.js';
- * import { p256 } from '@noble/curves/nist.js';
- * const keygen = createKeygen(p256.utils.randomSecretKey, p256.getPublicKey);
- * const pair = keygen();
- * ```
- */
-export declare function createKeygen(randomSecretKey: Function, getPublicKey: TArg): TRet;
-export {};
-//# sourceMappingURL=curve.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@noble/curves/abstract/curve.d.ts.map b/node_modules/@noble/curves/abstract/curve.d.ts.map
deleted file mode 100644
index 78f2910..0000000
--- a/node_modules/@noble/curves/abstract/curve.d.ts.map
+++ /dev/null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,IAAI,CAAC,EAAE,UAAU,EACjB,YAAY,CAAC,EAAE,OAAO,KACnB;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,UAAU,CAAA;CAAE,CAAC;AACtD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,eAAe,EAAE,QAAQ,EACzB,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,GACzC,IAAI,CAAC,QAAQ,CAAC,CAKhB"}
\ No newline at end of file
diff --git a/node_modules/@noble/curves/abstract/curve.js b/node_modules/@noble/curves/abstract/curve.js
deleted file mode 100644
index 6808517..0000000
--- a/node_modules/@noble/curves/abstract/curve.js
+++ /dev/null
@@ -1,611 +0,0 @@
-/**
- * Methods for elliptic curve multiplication by scalars.
- * Contains wNAF, pippenger.
- * @module
- */
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-import { bitLen, bitMask, validateObject } from "../utils.js";
-import { Field, FpInvertBatch, validateField } from "./modular.js";
-const _0n = /* @__PURE__ */ BigInt(0);
-const _1n = /* @__PURE__ */ BigInt(1);
-/**
- * Validates the static surface of a point constructor.
- * This is only a cheap sanity check for the constructor hooks and fields consumed by generic
- * factories; it does not certify `BASE`/`ZERO` semantics or prove the curve implementation itself.
- * @param Point - Runtime point constructor.
- * @throws On missing constructor hooks or malformed field metadata. {@link TypeError}
- * @example
- * Check that one point constructor exposes the static hooks generic helpers need.
- *
- * ```ts
- * import { ed25519 } from '@noble/curves/ed25519.js';
- * import { validatePointCons } from '@noble/curves/abstract/curve.js';
- * validatePointCons(ed25519.Point);
- * ```
- */
-export function validatePointCons(Point) {
- const pc = Point;
- 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',
- });
- validateField(pc.Fp);
- 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
- * inversion on all of them. Inversion is very slow operation,
- * so this improves performance massively.
- * Optimization: converts a list of projective points to a list of identical points with Z=1.
- * Input points are left unchanged; the normalized points are returned as fresh instances.
- * @param c - Point constructor.
- * @param points - Projective points.
- * @returns Fresh projective points reconstructed from normalized affine coordinates.
- * @example
- * Batch-normalize projective points with a single shared inversion.
- *
- * ```ts
- * import { normalizeZ } from '@noble/curves/abstract/curve.js';
- * import { p256 } from '@noble/curves/nist.js';
- * const points = normalizeZ(p256.Point, [p256.Point.BASE, p256.Point.BASE.double()]);
- * ```
- */
-export function normalizeZ(c, points) {
- 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 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 };
-}
-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)
- }
- 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 };
-}
-function validateMSMPoints(points, c) {
- if (!Array.isArray(points))
- throw new Error('array expected');
- points.forEach((p, i) => {
- if (!(p instanceof c))
- throw new Error('invalid point at index ' + i);
- });
-}
-function validateMSMScalars(scalars, field) {
- 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);
- });
-}
-// 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.
- 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.
- if (n !== _0n)
- throw new Error('invalid wNAF');
-}
-/**
- * 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.
- *
- * 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.
- * @param Point - Point constructor.
- * @param bits - Scalar bit length.
- * @example
- * Elliptic curve multiplication of Point by scalar.
- *
- * ```ts
- * import { wNAF } from '@noble/curves/abstract/curve.js';
- * import { p256 } from '@noble/curves/nist.js';
- * const ladder = new wNAF(p256.Point, p256.Point.Fn.BITS);
- * ```
- */
-export class wNAF {
- BASE;
- ZERO;
- Fn;
- bits;
- // Parametrized with a given Point class (not individual point)
- constructor(Point, bits) {
- this.BASE = Point.BASE;
- this.ZERO = Point.ZERO;
- this.Fn = Point.Fn;
- this.bits = 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.
- * @param point - Point instance
- * @param W - window size
- * @returns precomputed point tables flattened to a single array
- */
- 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);
- }
- p = base.double();
- }
- return points;
- }
- /**
- * 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
- * @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
- 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]));
- }
- }
- 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);
- 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);
- }
- }
- return comp;
- }
- cached(point, scalar, transform) {
- const W = getW(point);
- return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar);
- }
- unsafe(point, scalar, transform, prev) {
- 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);
- }
- // 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) {
- validateW(W, this.bits);
- pointWindowSizes.set(P, W);
- pointPrecomputes.delete(P);
- }
- hasCache(elm) {
- return getW(elm) !== 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.
- * @example
- * Endomorphism-specific multiplication for Koblitz curves.
- *
- * ```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);
- * ```
- */
-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 };
-}
-/**
- * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
- * 30x faster vs naive addition on L=4096, 10x faster than precomputes.
- * 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.
- * @param c - Curve Point constructor
- * @param points - array of L curve points
- * @param scalars - array of L scalars (aka secret keys / bigints)
- * @returns MSM result point. Empty input is accepted and returns the identity.
- * @throws If the point set, scalar set, or MSM sizing is invalid. {@link Error}
- * @example
- * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
- *
- * ```ts
- * import { pippenger } from '@noble/curves/abstract/curve.js';
- * import { p256 } from '@noble/curves/nist.js';
- * const point = pippenger(p256.Point, [p256.Point.BASE, p256.Point.BASE.double()], [2n, 3n]);
- * ```
- */
-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
- const fieldN = c.Fn;
- validateMSMPoints(points, c);
- validateMSMScalars(scalars, fieldN);
- const plength = points.length;
- const slength = scalars.length;
- 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;
- const wbits = bitLen(BigInt(plength));
- let windowSize = 1; // bits
- if (wbits > 12)
- windowSize = wbits - 3;
- else if (wbits > 4)
- windowSize = wbits - 2;
- else if (wbits > 0)
- windowSize = 2;
- const MASK = bitMask(windowSize);
- const buckets = new Array(Number(MASK) + 1).fill(zero); // +1 for zero array
- const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize;
- let sum = zero;
- for (let i = lastBits; i >= 0; i -= windowSize) {
- buckets.fill(zero);
- for (let j = 0; j < slength; j++) {
- const scalar = scalars[j];
- const wbits = Number((scalar >> BigInt(i)) & MASK);
- buckets[wbits] = buckets[wbits].add(points[j]);
- }
- let resI = zero; // not using this will do small speed-up, but will lose ct
- // Skip first bucket, because it is zero
- for (let j = buckets.length - 1, sumI = zero; j > 0; j--) {
- sumI = sumI.add(buckets[j]);
- resI = resI.add(sumI);
- }
- sum = sum.add(resI);
- if (i !== 0)
- for (let j = 0; j < windowSize; j++)
- sum = sum.double();
- }
- return sum;
-}
-/**
- * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
- * @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.
- * @throws If the point set or precompute window is invalid. {@link Error}
- * @example
- * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).
- *
- * ```ts
- * import { precomputeMSMUnsafe } from '@noble/curves/abstract/curve.js';
- * import { p256 } from '@noble/curves/nist.js';
- * const msm = precomputeMSMUnsafe(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)
- */
- const fieldN = c.Fn;
- validateW(windowSize, fieldN.BITS);
- 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;
- });
- 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;
- };
-}
-function createField(order, field, isLE) {
- if (field) {
- // Reuse supplied field overrides as-is; `isLE` only affects freshly constructed fallback
- // fields, and validateField() below only checks the arithmetic subset, not full byte/cmov
- // behavior.
- if (field.ORDER !== order)
- throw new Error('Field.ORDER must match order: Fp == p, Fn == n');
- validateField(field);
- return field;
- }
- else {
- return Field(order, { isLE });
- }
-}
-/**
- * Validates basic CURVE shape and field membership, then creates fields.
- * This does not prove that the generator is on-curve, that subgroup/order data are consistent, or
- * that the curve equation itself is otherwise sane.
- * @param type - Curve family.
- * @param CURVE - Curve parameters.
- * @param curveOpts - Optional field overrides:
- * - `Fp` (optional): Optional base-field override.
- * - `Fn` (optional): Optional scalar-field override.
- * @param FpFnLE - Whether field encoding is little-endian.
- * @returns Frozen curve parameters and fields.
- * @throws If the curve parameters or field overrides are invalid. {@link Error}
- * @example
- * Build curve fields from raw constants before constructing a curve instance.
- *
- * ```ts
- * const curve = createCurveFields('weierstrass', {
- * p: 17n,
- * n: 19n,
- * h: 1n,
- * a: 2n,
- * b: 2n,
- * Gx: 5n,
- * Gy: 1n,
- * });
- * ```
- */
-export function createCurveFields(type, CURVE, curveOpts = {}, FpFnLE) {
- if (FpFnLE === undefined)
- FpFnLE = type === 'edwards';
- if (!CURVE || typeof CURVE !== 'object')
- throw new Error(`expected valid ${type} CURVE object`);
- for (const p of ['p', 'n', 'h']) {
- const val = CURVE[p];
- if (!(typeof val === 'bigint' && val > _0n))
- throw new Error(`CURVE.${p} must be positive bigint`);
- }
- const Fp = createField(CURVE.p, curveOpts.Fp, FpFnLE);
- const Fn = createField(CURVE.n, curveOpts.Fn, FpFnLE);
- const _b = type === 'weierstrass' ? 'b' : 'd';
- const params = ['Gx', 'Gy', 'a', _b];
- for (const p of params) {
- // @ts-ignore
- if (!Fp.isValid(CURVE[p]))
- throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`);
- }
- CURVE = Object.freeze(Object.assign({}, CURVE));
- return { CURVE, Fp, Fn };
-}
-/**
- * @param randomSecretKey - Secret-key generator.
- * @param getPublicKey - Public-key derivation helper.
- * @returns Keypair generator.
- * @example
- * Build a `keygen()` helper from existing secret-key and public-key primitives.
- *
- * ```ts
- * import { createKeygen } from '@noble/curves/abstract/curve.js';
- * import { p256 } from '@noble/curves/nist.js';
- * const keygen = createKeygen(p256.utils.randomSecretKey, p256.getPublicKey);
- * const pair = keygen();
- * ```
- */
-export function createKeygen(randomSecretKey, getPublicKey) {
- return function keygen(seed) {
- const secretKey = randomSecretKey(seed);
- return { secretKey, publicKey: getPublicKey(secretKey) };
- };
-}
-//# sourceMappingURL=curve.js.map
\ No newline at end of file
diff --git a/node_modules/@noble/curves/abstract/curve.js.map b/node_modules/@noble/curves/abstract/curve.js.map
deleted file mode 100644
index a60e315..0000000
--- a/node_modules/@noble/curves/abstract/curve.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"curve.js","sourceRoot":"","sources":["../src/abstract/curve.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,sEAAsE;AACtE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAqC,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,EAAe,MAAM,cAAc,CAAC;AAEhF,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AA8MtC;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAA+B,KAAwB;IACtF,MAAM,EAAE,GAAG,KAAuC,CAAC;IACnD,IAAI,OAAQ,EAAc,KAAK,UAAU;QAAE,MAAM,IAAI,SAAS,CAAC,6BAA6B,CAAC,CAAC;IAC9F,iGAAiG;IACjG,cAAc,CACZ;QACE,EAAE,EAAE,EAAE,CAAC,EAAE;QACT,EAAE,EAAE,EAAE,CAAC,EAAE;QACT,UAAU,EAAE,EAAE,CAAC,UAAU;QACzB,SAAS,EAAE,EAAE,CAAC,SAAS;QACvB,OAAO,EAAE,EAAE,CAAC,OAAO;KACpB,EACD;QACE,EAAE,EAAE,QAAQ;QACZ,EAAE,EAAE,QAAQ;QACZ,UAAU,EAAE,UAAU;QACtB,SAAS,EAAE,UAAU;QACrB,OAAO,EAAE,UAAU;KACp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AAqB,CAAC;QAC5D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,SAAS,CAAqB,EAAE,CAAC;IAC/E,CAAC,CAAC;AACJ,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@noble/curves/abstract/edwards.d.ts b/node_modules/@noble/curves/abstract/edwards.d.ts
deleted file mode 100644
index ccfe3d4..0000000
--- a/node_modules/@noble/curves/abstract/edwards.d.ts
+++ /dev/null
@@ -1,320 +0,0 @@
-/**
- * Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y².
- * For design rationale of types / exports, see weierstrass module documentation.
- * Untwisted Edwards curves exist, but they aren't used in real-world protocols.
- * @module
- */
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-import { type FHash, type TArg, type TRet } from '../utils.ts';
-import { type AffinePoint, type CurveLengths, type CurvePoint, type CurvePointCons } from './curve.ts';
-import { type IField } from './modular.ts';
-/** Extended Edwards point with X/Y/Z/T coordinates. */
-export interface EdwardsPoint extends CurvePoint {
- /** extended X coordinate. Different from affine x. */
- readonly X: bigint;
- /** extended Y coordinate. Different from affine y. */
- readonly Y: bigint;
- /** extended Z coordinate */
- readonly Z: bigint;
- /** extended T coordinate */
- readonly T: bigint;
-}
-/** Constructor and decoding helpers for extended Edwards points. */
-export interface EdwardsPointCons extends CurvePointCons {
- /** Create a point from extended X/Y/Z/T coordinates without validation. */
- new (X: bigint, Y: bigint, Z: bigint, T: bigint): EdwardsPoint;
- /**
- * Return the curve parameters used by this point constructor.
- * @returns Curve parameters.
- */
- CURVE(): EdwardsOpts;
- /**
- * Decode a point from bytes, optionally using ZIP-215 rules.
- * @param bytes - Encoded point bytes.
- * @param zip215 - Whether to accept ZIP-215 encodings.
- * @returns Decoded Edwards point.
- */
- fromBytes(bytes: Uint8Array, zip215?: boolean): EdwardsPoint;
- /**
- * Decode a point from hex, optionally using ZIP-215 rules.
- * @param hex - Encoded point hex.
- * @param zip215 - Whether to accept ZIP-215 encodings.
- * @returns Decoded Edwards point.
- */
- fromHex(hex: string, zip215?: boolean): EdwardsPoint;
-}
-/**
- * Twisted Edwards curve options.
- *
- * * a: formula param
- * * d: formula param
- * * p: prime characteristic (order) of finite field, in which arithmetics is done
- * * n: order of prime subgroup a.k.a total amount of valid curve points
- * * h: cofactor. h*n is group order; n is subgroup order
- * * Gx: x coordinate of generator point a.k.a. base point
- * * Gy: y coordinate of generator point
- */
-export type EdwardsOpts = Readonly<{
- /** Base-field modulus. */
- p: bigint;
- /** Prime subgroup order. */
- n: bigint;
- /** Curve cofactor. */
- h: bigint;
- /** Edwards curve parameter `a`. */
- a: bigint;
- /** Edwards curve parameter `d`. */
- d: bigint;
- /** Generator x coordinate. */
- Gx: bigint;
- /** Generator y coordinate. */
- Gy: bigint;
-}>;
-/**
- * Extra curve options for Twisted Edwards.
- *
- * * Fp: redefined Field over curve.p
- * * Fn: redefined Field over curve.n
- * * uvRatio: helper function for decompression, calculating √(u/v)
- */
-export type EdwardsExtraOpts = Partial<{
- /** Optional base-field override. */
- Fp: IField;
- /** Optional scalar-field override. */
- Fn: IField;
- /** Whether field encodings are little-endian. */
- FpFnLE: boolean;
- /** Square-root ratio helper used during point decompression. */
- uvRatio: (u: bigint, v: bigint) => {
- isValid: boolean;
- value: bigint;
- };
-}>;
-/**
- * EdDSA (Edwards Digital Signature algorithm) options.
- *
- * * hash: hash function used to hash secret keys and messages
- * * adjustScalarBytes: clears bits to get valid field element
- * * domain: Used for hashing
- * * mapToCurve: for hash-to-curve standard
- * * prehash: RFC 8032 pre-hashing of messages to sign() / verify()
- * * randomBytes: function generating random bytes, used for randomSecretKey
- */
-export type EdDSAOpts = Partial<{
- /** Clamp or otherwise normalize secret-scalar bytes before reducing mod `n`. */
- adjustScalarBytes: (bytes: TArg) => TRet;
- /** Domain-separation helper for contexts and prehash mode. */
- domain: (data: TArg, ctx: TArg, phflag: boolean) => TRet;
- /** Optional hash-to-curve mapper for protocols like Ristretto hash-to-group. */
- mapToCurve: (scalar: bigint[]) => AffinePoint;
- /** Optional prehash function used before signing or verifying messages. */
- prehash: FHash;
- /** Default verification decoding policy. ZIP-215 is more permissive than RFC 8032 / NIST. */
- zip215: boolean;
- /** RNG override used by helper constructors. */
- randomBytes: (bytesLength?: number) => TRet;
-}>;
-/**
- * EdDSA (Edwards Digital Signature algorithm) helper namespace.
- * Allows creating and verifying signatures, and deriving public keys.
- */
-export interface EdDSA {
- /**
- * Generate a secret/public key pair.
- * @param seed - Optional seed material.
- * @returns Secret/public key pair.
- */
- keygen: (seed?: TArg) => {
- secretKey: TRet;
- publicKey: TRet;
- };
- /**
- * Derive the public key from a secret key.
- * @param secretKey - Secret key bytes.
- * @returns Encoded public key.
- */
- getPublicKey: (secretKey: TArg) => TRet;
- /**
- * Sign a message with an EdDSA secret key.
- * @param message - Message bytes.
- * @param secretKey - Secret key bytes.
- * @param options - Optional signature tweaks:
- * - `context` (optional): Domain-separation context for Ed25519ctx/Ed448.
- * @returns Encoded signature bytes.
- */
- sign: (message: TArg, secretKey: TArg, options?: TArg<{
- context?: Uint8Array;
- }>) => TRet;
- /**
- * Verify a signature against a message and public key.
- * @param sig - Encoded signature bytes.
- * @param message - Message bytes.
- * @param publicKey - Encoded public key.
- * @param options - Optional verification tweaks:
- * - `context` (optional): Domain-separation context for Ed25519ctx/Ed448.
- * - `zip215` (optional): Whether to accept ZIP-215 encodings.
- * @returns Whether the signature is valid.
- */
- verify: (sig: TArg, message: TArg, publicKey: TArg, options?: TArg<{
- context?: Uint8Array;
- zip215?: boolean;
- }>) => boolean;
- /** Point constructor used by this signature scheme. */
- Point: EdwardsPointCons;
- /** Helper utilities for key validation and Montgomery conversion. */
- utils: {
- /**
- * Generate a valid random secret key.
- * Optional seed bytes are only length-checked and returned unchanged.
- */
- randomSecretKey: (seed?: TArg) => TRet;
- /** Check whether a secret key has the expected encoding. */
- isValidSecretKey: (secretKey: TArg) => boolean;
- /** Check whether a public key decodes to a valid point. */
- isValidPublicKey: (publicKey: TArg, zip215?: boolean) => boolean;
- /**
- * Converts ed public key to x public key.
- *
- * There is NO `fromMontgomery`:
- * - There are 2 valid ed25519 points for every x25519, with flipped coordinate
- * - Sometimes there are 0 valid ed25519 points, because x25519 *additionally*
- * accepts inputs on the quadratic twist, which can't be moved to ed25519
- *
- * @example
- * Converts ed public key to x public key.
- *
- * ```js
- * const someonesPub_ed = ed25519.getPublicKey(ed25519.utils.randomSecretKey());
- * const someonesPub = ed25519.utils.toMontgomery(someonesPub);
- * const aPriv = x25519.utils.randomSecretKey();
- * const shared = x25519.getSharedSecret(aPriv, someonesPub)
- * ```
- */
- toMontgomery: (publicKey: TArg) => TRet;
- /**
- * Converts ed secret key to x secret key.
- * @example
- * Converts ed secret key to x secret key.
- *
- * ```js
- * const someonesPub = x25519.getPublicKey(x25519.utils.randomSecretKey());
- * const aPriv_ed = ed25519.utils.randomSecretKey();
- * const aPriv = ed25519.utils.toMontgomerySecret(aPriv_ed);
- * const shared = x25519.getSharedSecret(aPriv, someonesPub)
- * ```
- */
- toMontgomerySecret: (secretKey: TArg) => TRet;
- /** Return the expanded private key components used by RFC8032 signing. */
- getExtendedPublicKey: (key: TArg) => {
- head: TRet;
- prefix: TRet;
- scalar: bigint;
- point: EdwardsPoint;
- pointBytes: TRet;
- };
- };
- /** Byte lengths for keys and signatures exposed by this scheme. */
- lengths: CurveLengths;
-}
-/**
- * @param params - Curve parameters. See {@link EdwardsOpts}.
- * @param extraOpts - Optional helpers and overrides. See {@link EdwardsExtraOpts}.
- * @returns Edwards point constructor. Generator validation here only checks
- * that `(Gx, Gy)` satisfies the affine Edwards equation.
- * RFC 8032 base-point constraints like `B != (0,1)` and `[L]B = 0`
- * are left to the caller's chosen parameters, since eager subgroup
- * validation here adds about 10-15ms to heavyweight imports like ed448.
- * The returned constructor also eagerly marks `Point.BASE` for W=8
- * precompute caching. Some code paths still assume
- * `Fp.BYTES === Fn.BYTES`, so mismatched byte lengths are not fully audited here.
- * @throws If the curve parameters or Edwards overrides are invalid. {@link Error}
- * @example
- * ```ts
- * import { edwards } from '@noble/curves/abstract/edwards.js';
- * import { jubjub } from '@noble/curves/misc.js';
- * // Build a point constructor from explicit curve parameters, then use its base point.
- * const Point = edwards(jubjub.Point.CURVE());
- * Point.BASE.toHex();
- * ```
- */
-export declare function edwards(params: TArg, extraOpts?: TArg): EdwardsPointCons;
-/**
- * Base class for prime-order points like Ristretto255 and Decaf448.
- * These points eliminate cofactor issues by representing equivalence classes
- * of Edwards curve points. Multiple Edwards representatives can describe the
- * same abstract wrapper element, so wrapper validity is not the same thing as
- * the hidden representative being torsion-free.
- * @param ep - Backing Edwards point.
- * @example
- * Base class for prime-order points like Ristretto255 and Decaf448.
- *
- * ```ts
- * import { ristretto255 } from '@noble/curves/ed25519.js';
- * const point = ristretto255.Point.BASE.multiply(2n);
- * ```
- */
-export declare abstract class PrimeEdwardsPoint> implements CurvePoint {
- static BASE: PrimeEdwardsPoint;
- static ZERO: PrimeEdwardsPoint;
- static Fp: IField;
- static Fn: IField;
- protected readonly ep: EdwardsPoint;
- /**
- * Wrap one internal Edwards representative directly.
- * This is not a canonical encoding boundary: alternate Edwards
- * representatives may still describe the same abstract wrapper element.
- */
- constructor(ep: EdwardsPoint);
- abstract toBytes(): Uint8Array;
- abstract equals(other: T): boolean;
- static fromBytes(_bytes: Uint8Array): any;
- static fromHex(_hex: string): any;
- get x(): bigint;
- get y(): bigint;
- clearCofactor(): T;
- assertValidity(): void;
- /**
- * Return affine coordinates of the current internal Edwards representative.
- * This is a convenience helper, not a canonical Ristretto/Decaf encoding.
- * Equal abstract elements may expose different `x` / `y`; use
- * `toBytes()` / `fromBytes()` for canonical roundtrips.
- */
- toAffine(invertedZ?: bigint): AffinePoint;
- toHex(): string;
- toString(): string;
- isTorsionFree(): boolean;
- isSmallOrder(): boolean;
- add(other: T): T;
- subtract(other: T): T;
- multiply(scalar: bigint): T;
- multiplyUnsafe(scalar: bigint): T;
- double(): T;
- negate(): T;
- precompute(windowSize?: number, isLazy?: boolean): T;
- abstract is0(): boolean;
- protected abstract assertSame(other: T): void;
- protected abstract init(ep: EdwardsPoint): T;
-}
-/**
- * Initializes EdDSA signatures over given Edwards curve.
- * @param Point - Edwards point constructor.
- * @param cHash - Hash function.
- * @param eddsaOpts - Optional signature helpers. See {@link EdDSAOpts}.
- * @returns EdDSA helper namespace.
- * @throws If the hash function, options, or derived point operations are invalid. {@link Error}
- * @example
- * Initializes EdDSA signatures over given Edwards curve.
- *
- * ```ts
- * import { eddsa } from '@noble/curves/abstract/edwards.js';
- * import { jubjub } from '@noble/curves/misc.js';
- * import { sha512 } from '@noble/hashes/sha2.js';
- * const sigs = eddsa(jubjub.Point, sha512);
- * const { secretKey, publicKey } = sigs.keygen();
- * const msg = new TextEncoder().encode('hello noble');
- * const sig = sigs.sign(msg, secretKey);
- * const isValid = sigs.verify(sig, msg, publicKey);
- * ```
- */
-export declare function eddsa(Point: EdwardsPointCons, cHash: TArg, eddsaOpts?: TArg): EdDSA;
-//# sourceMappingURL=edwards.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@noble/curves/abstract/edwards.d.ts.map b/node_modules/@noble/curves/abstract/edwards.d.ts.map
deleted file mode 100644
index 6393e1f..0000000
--- a/node_modules/@noble/curves/abstract/edwards.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"edwards.d.ts","sourceRoot":"","sources":["../src/abstract/edwards.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sEAAsE;AACtE,OAAO,EAcL,KAAK,KAAK,EAEV,KAAK,IAAI,EACT,KAAK,IAAI,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAM3C,uDAAuD;AACvD,MAAM,WAAW,YAAa,SAAQ,UAAU,CAAC,MAAM,EAAE,YAAY,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I,EAAE,MAAM,GAAG,GAAG;IAIjC,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,IAAI,MAAM,CAEd;IAGD,aAAa,IAAI,CAAC;IAMlB,cAAc,IAAI,IAAI;IAOtB;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAIjD,KAAK,IAAI,MAAM;IAIf,QAAQ,IAAI,MAAM;IAIlB,aAAa,IAAI,OAAO;IAMxB,YAAY,IAAI,OAAO;IAIvB,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC;IAKhB,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC;IAKrB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC;IAI3B,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC;IAIjC,MAAM,IAAI,CAAC;IAIX,MAAM,IAAI,CAAC;IAIX,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,CAAC;IAQpD,QAAQ,CAAC,GAAG,IAAI,OAAO;IACvB,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAC7C,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,GAAG,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,KAAK,CACnB,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,EAClB,SAAS,GAAE,IAAI,CAAC,SAAS,CAAM,GAC9B,KAAK,CAuOP"}
\ No newline at end of file
diff --git a/node_modules/@noble/curves/abstract/edwards.js b/node_modules/@noble/curves/abstract/edwards.js
deleted file mode 100644
index ee5cefc..0000000
--- a/node_modules/@noble/curves/abstract/edwards.js
+++ /dev/null
@@ -1,693 +0,0 @@
-/**
- * Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y².
- * For design rationale of types / exports, see weierstrass module documentation.
- * Untwisted Edwards curves exist, but they aren't used in real-world protocols.
- * @module
- */
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-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";
-// 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);
-// Affine Edwards-equation check only; this does not prove subgroup membership, canonical
-// encoding, prime-order base-point requirements, or identity exclusion.
-function isEdValidXY(Fp, CURVE, x, y) {
- const x2 = Fp.sqr(x);
- const y2 = Fp.sqr(y);
- const left = Fp.add(Fp.mul(CURVE.a, x2), y2);
- const right = Fp.add(Fp.ONE, Fp.mul(CURVE.d, Fp.mul(x2, y2)));
- return Fp.eql(left, right);
-}
-/**
- * @param params - Curve parameters. See {@link EdwardsOpts}.
- * @param extraOpts - Optional helpers and overrides. See {@link EdwardsExtraOpts}.
- * @returns Edwards point constructor. Generator validation here only checks
- * that `(Gx, Gy)` satisfies the affine Edwards equation.
- * RFC 8032 base-point constraints like `B != (0,1)` and `[L]B = 0`
- * are left to the caller's chosen parameters, since eager subgroup
- * validation here adds about 10-15ms to heavyweight imports like ed448.
- * The returned constructor also eagerly marks `Point.BASE` for W=8
- * precompute caching. Some code paths still assume
- * `Fp.BYTES === Fn.BYTES`, so mismatched byte lengths are not fully audited here.
- * @throws If the curve parameters or Edwards overrides are invalid. {@link Error}
- * @example
- * ```ts
- * import { edwards } from '@noble/curves/abstract/edwards.js';
- * import { jubjub } from '@noble/curves/misc.js';
- * // Build a point constructor from explicit curve parameters, then use its base point.
- * const Point = edwards(jubjub.Point.CURVE());
- * Point.BASE.toHex();
- * ```
- */
-export function edwards(params, extraOpts = {}) {
- const opts = extraOpts;
- const validated = createCurveFields('edwards', params, opts, opts.FpFnLE);
- const { Fp, Fn } = validated;
- let CURVE = validated.CURVE;
- 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
- // sqrt(u/v)
- const uvRatio = opts.uvRatio === undefined
- ? (u, v) => {
- try {
- return { isValid: true, value: Fp.sqrt(Fp.div(u, v)) };
- }
- catch (e) {
- return { isValid: false, value: _0n };
- }
- }
- : opts.uvRatio;
- // Validate whether the passed curve params are valid.
- // equation ax² + y² = 1 + dx²y² should work for generator point.
- if (!isEdValidXY(Fp, CURVE, CURVE.Gx, CURVE.Gy))
- throw new Error('bad curve params: generator point');
- /**
- * Asserts coordinate is valid: 0 <= n < MASK.
- * Coordinates >= Fp.ORDER are allowed for zip215.
- */
- function acoord(title, n, banZero = false) {
- const min = banZero ? _1n : _0n;
- aInRange('coordinate ' + title, n, min, MASK);
- return n;
- }
- function aedpoint(other) {
- if (!(other instanceof Point))
- throw new Error('EdwardsPoint expected');
- }
- // Extended Point works in extended coordinates: (X, Y, Z, T) ∋ (x=X/Z, y=Y/Z, T=xy).
- // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates
- 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 Fp = Fp;
- // scalar field
- static Fn = Fn;
- X;
- Y;
- Z;
- T;
- constructor(X, Y, Z, T) {
- this.X = acoord('x', X);
- this.Y = acoord('y', Y);
- this.Z = acoord('z', Z, true);
- this.T = acoord('t', T);
- Object.freeze(this);
- }
- static CURVE() {
- return CURVE;
- }
- /**
- * Create one extended Edwards point from affine coordinates.
- * Does NOT validate that the point is on-curve or torsion-free.
- * Use `.assertValidity()` on adversarial inputs.
- */
- static fromAffine(p) {
- if (p instanceof Point)
- throw new Error('extended point not allowed');
- const { x, y } = p || {};
- acoord('x', x);
- acoord('y', y);
- return new Point(x, y, _1n, modP(x * y));
- }
- // Uses algo from RFC8032 5.1.3.
- static fromBytes(bytes, zip215 = false) {
- const len = Fp.BYTES;
- const { a, d } = CURVE;
- bytes = copyBytes(abytes(bytes, len, 'point'));
- abool(zip215, 'zip215');
- const normed = copyBytes(bytes); // copy again, we'll manipulate it
- const lastByte = bytes[len - 1]; // select last byte
- normed[len - 1] = lastByte & ~0x80; // clear last bit
- const y = bytesToNumberLE(normed);
- // zip215=true is good for consensus-critical apps. =false follows RFC8032 / NIST186-5.
- // RFC8032 prohibits >= p, but ZIP215 doesn't
- // zip215=true: 0 <= y < MASK (2^256 for ed25519)
- // zip215=false: 0 <= y < P (2^255-19 for ed25519)
- const max = zip215 ? MASK : Fp.ORDER;
- aInRange('point.y', y, _0n, max);
- // Ed25519: x² = (y²-1)/(dy²+1) mod p. Ed448: x² = (y²-1)/(dy²-1) mod p. Generic case:
- // 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.
- 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 isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit
- if (!zip215 && x === _0n && 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
- return Point.fromAffine({ x, y });
- }
- static fromHex(hex, zip215 = false) {
- return Point.fromBytes(hexToBytes(hex), zip215);
- }
- get x() {
- return this.toAffine().x;
- }
- get y() {
- return this.toAffine().y;
- }
- precompute(windowSize = 8, isLazy = true) {
- wnaf.createCache(this, windowSize);
- if (!isLazy)
- this.multiply(_2n); // random number
- return this;
- }
- // Useful in fromAffine() - not for fromBytes(), which always created valid points.
- assertValidity() {
- const p = this;
- const { a, d } = CURVE;
- // Keep generic Edwards validation fail-closed on the neutral point.
- // Even though ZERO is algebraically valid and can roundtrip through encodings, higher-level
- // callers often reach it only through broken hash/scalar plumbing; rejecting it here avoids
- // silently treating that degenerate state as an ordinary public point.
- if (p.is0())
- throw new Error('bad point: ZERO'); // TODO: optimize, with vars below?
- // Equation in affine coordinates: ax² + y² = 1 + dx²y²
- // Equation in projective coordinates (X/Z, Y/Z, Z): (aX² + Y²)Z² = Z⁴ + dX²Y²
- 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)');
- // 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)');
- }
- // Compare one point to another.
- equals(other) {
- aedpoint(other);
- const { X: X1, Y: Y1, Z: Z1 } = this;
- 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;
- }
- is0() {
- return this.equals(Point.ZERO);
- }
- negate() {
- // 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));
- }
- // Fast algo for doubling Extended Point.
- // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd
- // Cost: 4M + 4S + 1*a + 6add + 1*2.
- 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
- return new Point(X3, Y3, Z3, T3);
- }
- // Fast algo for adding 2 Extended Points.
- // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd
- // Cost: 9M + 1*a + 1*d + 7add.
- add(other) {
- aedpoint(other);
- const { a, 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
- return new Point(X3, Y3, Z3, T3);
- }
- subtract(other) {
- // Validate before calling `negate()` so wrong inputs fail with the point guard
- // instead of leaking a foreign `negate()` error.
- aedpoint(other);
- return this.add(other.negate());
- }
- // Constant-time multiplication.
- multiply(scalar) {
- // 1 <= scalar < L
- // Keep the subgroup-scalar contract strict instead of reducing 0 / n to ZERO.
- // In keygen/signing-style callers, those values usually mean broken hash/scalar plumbing,
- // and failing closed is safer than silently producing the identity point.
- if (!Fn.isValidNot0(scalar))
- 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];
- }
- // Non-constant-time multiplication. Uses double-and-add algorithm.
- // It's faster, but should only be used when you don't care about
- // an exposed private key e.g. sig verification.
- // Keeps the same subgroup-scalar contract: 0 is allowed for public-scalar callers, but
- // n and larger values are rejected instead of being reduced mod n to the identity point.
- multiplyUnsafe(scalar) {
- // 0 <= scalar < L
- if (!Fn.isValid(scalar))
- throw new RangeError('invalid scalar: expected 0 <= sc < curve.n');
- if (scalar === _0n)
- return Point.ZERO;
- if (this.is0() || scalar === _1n)
- return this;
- return wnaf.unsafe(this, scalar, (p) => normalizeZ(Point, p));
- }
- // Checks if point is of small order.
- // If you add something to small order point, you will have "dirty"
- // point with torsion component.
- // Clears cofactor and checks if the result is 0.
- isSmallOrder() {
- return this.clearCofactor().is0();
- }
- // Multiplies point by curve order and checks if the result is 0.
- // Returns `false` is the point is dirty.
- isTorsionFree() {
- return wnaf.unsafe(this, CURVE.n).is0();
- }
- // Converts Extended point to default (x, y) coordinates.
- // Can accept precomputed Z^-1 - for example, from invertBatch.
- toAffine(invertedZ) {
- const p = this;
- let iz = invertedZ;
- 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);
- const zz = Fp.mul(Z, iz);
- if (is0)
- return { x: _0n, y: _1n };
- if (zz !== _1n)
- throw new Error('invZ was invalid');
- return { x, y };
- }
- clearCofactor() {
- if (cofactor === _1n)
- return this;
- return this.multiplyUnsafe(cofactor);
- }
- toBytes() {
- const { x, y } = this.toAffine();
- // Fp.toBytes() allows non-canonical encoding of y (>= p).
- const bytes = Fp.toBytes(y);
- // Each y has 2 valid points: (x, y), (x,-y).
- // 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;
- return bytes;
- }
- toHex() {
- return bytesToHex(this.toBytes());
- }
- toString() {
- return ``;
- }
- }
- const wnaf = new wNAF(Point, Fn.BITS);
- // Keep constructor work cheap: subgroup/generator validation belongs to the caller's curve
- // parameters, and doing the extra checks here adds about 10-15ms to heavy module imports.
- // Callers that construct custom curves are responsible for supplying the correct base point.
- // try {
- // Point.BASE.assertValidity();
- // if (!Point.BASE.isTorsionFree()) throw new Error('bad point: not in prime-order subgroup');
- // } catch {
- // throw new Error('bad curve params: generator point');
- // }
- // 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.
- Object.freeze(Point.prototype);
- Object.freeze(Point);
- return Point;
-}
-/**
- * Base class for prime-order points like Ristretto255 and Decaf448.
- * These points eliminate cofactor issues by representing equivalence classes
- * of Edwards curve points. Multiple Edwards representatives can describe the
- * same abstract wrapper element, so wrapper validity is not the same thing as
- * the hidden representative being torsion-free.
- * @param ep - Backing Edwards point.
- * @example
- * Base class for prime-order points like Ristretto255 and Decaf448.
- *
- * ```ts
- * import { ristretto255 } from '@noble/curves/ed25519.js';
- * const point = ristretto255.Point.BASE.multiply(2n);
- * ```
- */
-export class PrimeEdwardsPoint {
- static BASE;
- static ZERO;
- static Fp;
- static Fn;
- ep;
- /**
- * Wrap one internal Edwards representative directly.
- * This is not a canonical encoding boundary: alternate Edwards
- * representatives may still describe the same abstract wrapper element.
- */
- constructor(ep) {
- this.ep = ep;
- }
- // Static methods that must be implemented by subclasses
- static fromBytes(_bytes) {
- notImplemented();
- }
- static fromHex(_hex) {
- notImplemented();
- }
- get x() {
- return this.toAffine().x;
- }
- get y() {
- return this.toAffine().y;
- }
- // Common implementations
- clearCofactor() {
- // no-op for the abstract prime-order wrapper group; this is about the
- // wrapper element, not the hidden Edwards representative.
- return this;
- }
- assertValidity() {
- // Keep wrapper validity at the abstract-group boundary. Canonical decode
- // may choose Edwards representatives that differ by small torsion, so
- // checking `this.ep.isTorsionFree()` here would reject valid wrapper points.
- this.ep.assertValidity();
- }
- /**
- * Return affine coordinates of the current internal Edwards representative.
- * This is a convenience helper, not a canonical Ristretto/Decaf encoding.
- * Equal abstract elements may expose different `x` / `y`; use
- * `toBytes()` / `fromBytes()` for canonical roundtrips.
- */
- toAffine(invertedZ) {
- return this.ep.toAffine(invertedZ);
- }
- toHex() {
- return bytesToHex(this.toBytes());
- }
- toString() {
- return this.toHex();
- }
- isTorsionFree() {
- // Abstract Ristretto/Decaf elements are already prime-order even when the
- // hidden Edwards representative is not torsion-free.
- return true;
- }
- isSmallOrder() {
- return false;
- }
- add(other) {
- this.assertSame(other);
- return this.init(this.ep.add(other.ep));
- }
- subtract(other) {
- this.assertSame(other);
- return this.init(this.ep.subtract(other.ep));
- }
- multiply(scalar) {
- return this.init(this.ep.multiply(scalar));
- }
- multiplyUnsafe(scalar) {
- return this.init(this.ep.multiplyUnsafe(scalar));
- }
- double() {
- return this.init(this.ep.double());
- }
- negate() {
- return this.init(this.ep.negate());
- }
- precompute(windowSize, isLazy) {
- this.ep.precompute(windowSize, isLazy);
- // Keep the wrapper identity stable like the backing Edwards API instead of
- // allocating a fresh wrapper around the same cached point.
- return this;
- }
-}
-/**
- * Initializes EdDSA signatures over given Edwards curve.
- * @param Point - Edwards point constructor.
- * @param cHash - Hash function.
- * @param eddsaOpts - Optional signature helpers. See {@link EdDSAOpts}.
- * @returns EdDSA helper namespace.
- * @throws If the hash function, options, or derived point operations are invalid. {@link Error}
- * @example
- * Initializes EdDSA signatures over given Edwards curve.
- *
- * ```ts
- * import { eddsa } from '@noble/curves/abstract/edwards.js';
- * import { jubjub } from '@noble/curves/misc.js';
- * import { sha512 } from '@noble/hashes/sha2.js';
- * const sigs = eddsa(jubjub.Point, sha512);
- * const { secretKey, publicKey } = sigs.keygen();
- * const msg = new TextEncoder().encode('hello noble');
- * const sig = sigs.sign(msg, secretKey);
- * const isValid = sigs.verify(sig, msg, publicKey);
- * ```
- */
-export function eddsa(Point, cHash, eddsaOpts = {}) {
- if (typeof cHash !== 'function')
- throw new Error('"hash" function param is required');
- const hash = cHash;
- const opts = eddsaOpts;
- validateObject(opts, {}, {
- adjustScalarBytes: 'function',
- randomBytes: 'function',
- domain: 'function',
- prehash: 'function',
- zip215: 'boolean',
- mapToCurve: 'function',
- });
- const { prehash } = opts;
- const { BASE, Fp, Fn } = Point;
- const outputLen = hash.outputLen;
- const expectedLen = 2 * Fp.BYTES;
- // When hash metadata is available, reject incompatible EdDSA wrappers at construction time
- // instead of deferring the mismatch until the first keygen/sign call.
- if (outputLen !== undefined) {
- asafenumber(outputLen, 'hash.outputLen');
- if (outputLen !== expectedLen)
- throw new Error(`hash.outputLen must be ${expectedLen}, got ${outputLen}`);
- }
- const randomBytes = opts.randomBytes === undefined ? wcRandomBytes : opts.randomBytes;
- const adjustScalarBytes = opts.adjustScalarBytes === undefined
- ? (bytes) => bytes
- : opts.adjustScalarBytes;
- const domain = opts.domain === undefined
- ? (data, ctx, phflag) => {
- abool(phflag, 'phflag');
- if (ctx.length || phflag)
- throw new Error('Contexts/pre-hash are not supported');
- return data;
- }
- : opts.domain; // NOOP
- // Parse an EdDSA digest as a little-endian integer and reduce it modulo the scalar field order.
- function modN_LE(hash) {
- return Fn.create(bytesToNumberLE(hash)); // Not Fn.fromBytes: it has length limit
- }
- // Get the hashed private scalar per RFC8032 5.1.5
- function getPrivateScalar(key) {
- const len = lengths.secretKey;
- abytes(key, lengths.secretKey, 'secretKey');
- // Hash private key with curve's hash function to produce uniformingly random input
- // Check byte lengths: ensure(64, h(ensure(32, key)))
- const hashed = abytes(hash(key), 2 * len, 'hashedSecretKey');
- // Slice before clamping so in-place adjustors don't corrupt the prefix half.
- const head = adjustScalarBytes(hashed.slice(0, len)); // clear first half bits, produce FE
- const prefix = hashed.slice(len, 2 * len); // second half is called key prefix (5.1.6)
- const scalar = modN_LE(head); // The actual private scalar
- return { head, prefix, scalar };
- }
- /** Convenience method that creates public key from scalar. RFC8032 5.1.5
- * Also exposes the derived scalar/prefix tuple and point form reused by sign().
- */
- function getExtendedPublicKey(secretKey) {
- const { head, prefix, scalar } = getPrivateScalar(secretKey);
- const point = BASE.multiply(scalar); // Point on Edwards curve aka public key
- const pointBytes = point.toBytes();
- return { head, prefix, scalar, point, pointBytes };
- }
- /** Calculates EdDSA pub key. RFC8032 5.1.5. */
- function getPublicKey(secretKey) {
- return getExtendedPublicKey(secretKey).pointBytes;
- }
- // Hash domain-separated chunks into a little-endian scalar modulo the group order.
- function hashDomainToScalar(context = Uint8Array.of(), ...msgs) {
- const msg = concatBytes(...msgs);
- return modN_LE(hash(domain(msg, abytes(context, undefined, 'context'), !!prehash)));
- }
- /** Signs message with secret key. RFC8032 5.1.6 */
- function sign(msg, secretKey, options = {}) {
- msg = abytes(msg, undefined, 'message');
- if (prehash)
- msg = prehash(msg); // for ed25519ph etc.
- const { prefix, scalar, pointBytes } = getExtendedPublicKey(secretKey);
- const r = hashDomainToScalar(options.context, prefix, msg); // r = dom2(F, C) || prefix || PH(M)
- // RFC 8032 5.1.6 allows r mod L = 0, and SUPERCOP ref10 accepts the resulting identity-point
- // signature.
- // We intentionally keep the safe multiply() rejection here so a miswired all-zero hash provider
- // fails loudly instead of silently producing a degenerate signature.
- const R = BASE.multiply(r).toBytes(); // R = rG
- const k = hashDomainToScalar(options.context, R, pointBytes, msg); // R || A || PH(M)
- const s = Fn.create(r + k * scalar); // S = (r + k * s) mod L
- if (!Fn.isValid(s))
- throw new Error('sign failed: invalid s'); // 0 <= s < L
- const rs = concatBytes(R, Fn.toBytes(s));
- return abytes(rs, lengths.signature, 'result');
- }
- // Keep the shared helper strict by default: RFC 8032 / NIST-style wrappers should reject
- // non-canonical encodings unless they explicitly opt into ZIP-215's more permissive decode rules.
- const verifyOpts = {
- zip215: opts.zip215,
- };
- /**
- * Verifies EdDSA signature against message and public key. RFC 8032 §§5.1.7 and 5.2.7.
- * A cofactored verification equation is checked.
- */
- function verify(sig, msg, publicKey, options = verifyOpts) {
- // Preserve the wrapper-selected default for `{}` / `{ zip215: undefined }`, not just omitted opts.
- const { context } = options;
- const zip215 = options.zip215 === undefined ? !!verifyOpts.zip215 : options.zip215;
- const len = lengths.signature;
- sig = abytes(sig, len, 'signature');
- msg = abytes(msg, undefined, 'message');
- publicKey = abytes(publicKey, lengths.publicKey, 'publicKey');
- if (zip215 !== undefined)
- abool(zip215, 'zip215');
- if (prehash)
- msg = prehash(msg); // for ed25519ph, etc
- const mid = len / 2;
- const r = sig.subarray(0, mid);
- const s = bytesToNumberLE(sig.subarray(mid, len));
- let A, R, SB;
- try {
- // ZIP-215 is more permissive than RFC 8032 / NIST186-5. Use it only for wrappers that
- // explicitly want consensus-style unreduced encoding acceptance.
- // zip215=true: 0 <= y < MASK (2^256 for ed25519)
- // zip215=false: 0 <= y < P (2^255-19 for ed25519)
- A = Point.fromBytes(publicKey, zip215);
- R = Point.fromBytes(r, zip215);
- SB = BASE.multiplyUnsafe(s); // 0 <= s < l is done inside
- }
- catch (error) {
- return false;
- }
- // RFC 8032 §§5.1.7/5.2.7 and FIPS 186-5 §§7.7.2/7.8.2 only decode A' and check the cofactored
- // verification equation; they do not add a separate low-order-public-key rejection here.
- // Strict mode still rejects small-order A' intentionally for SBS-style non-repudiation and to
- // avoid ambiguous verification outcomes where unusual low-order keys can make distinct
- // key/signature/message combinations verify.
- if (!zip215 && A.isSmallOrder())
- return false;
- // ZIP-215 accepts noncanonical / unreduced point encodings, so the challenge hash must use the
- // exact signature/public-key bytes rather than canonicalized re-encodings of the decoded points.
- const k = hashDomainToScalar(context, r, publicKey, msg);
- const RkA = R.add(A.multiplyUnsafe(k));
- // Check the cofactored verification equation via the curve cofactor h.
- // [h][S]B = [h]R + [h][k]A'
- return RkA.subtract(SB).clearCofactor().is0();
- }
- const _size = Fp.BYTES; // 32 for ed25519, 57 for ed448
- const lengths = {
- secretKey: _size,
- publicKey: _size,
- signature: 2 * _size,
- seed: _size,
- };
- function randomSecretKey(seed) {
- seed = seed === undefined ? randomBytes(lengths.seed) : seed;
- return abytes(seed, lengths.seed, 'seed');
- }
- function isValidSecretKey(key) {
- return isBytes(key) && key.length === lengths.secretKey;
- }
- function isValidPublicKey(key, zip215) {
- try {
- // Preserve the wrapper-selected default for omitted / `undefined` ZIP-215 flags here too.
- return !!Point.fromBytes(key, zip215 === undefined ? verifyOpts.zip215 : zip215);
- }
- catch (error) {
- return false;
- }
- }
- const utils = {
- getExtendedPublicKey,
- randomSecretKey,
- isValidSecretKey,
- 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))`
- */
- 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);
- },
- toMontgomerySecret(secretKey) {
- const size = lengths.secretKey;
- abytes(secretKey, size);
- const hashed = hash(secretKey.subarray(0, size));
- return adjustScalarBytes(hashed).subarray(0, size);
- },
- };
- Object.freeze(lengths);
- Object.freeze(utils);
- return Object.freeze({
- keygen: createKeygen(randomSecretKey, getPublicKey),
- getPublicKey,
- sign,
- verify,
- utils,
- Point,
- lengths,
- });
-}
-//# sourceMappingURL=edwards.js.map
\ No newline at end of file
diff --git a/node_modules/@noble/curves/abstract/edwards.js.map b/node_modules/@noble/curves/abstract/edwards.js.map
deleted file mode 100644
index 2bba3b7..0000000
--- a/node_modules/@noble/curves/abstract/edwards.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"edwards.js","sourceRoot":"","sources":["../src/abstract/edwards.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sEAAsE;AACtE,OAAO,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,SAAS,EACT,UAAU,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACd,WAAW,IAAI,aAAa,GAK7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,IAAI,GAKL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAe,MAAM,cAAc,CAAC;AAE3C,qEAAqE;AACrE,kBAAkB;AAClB,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAsNzI,yFAAyF;AACzF,wEAAwE;AACxE,SAAS,WAAW,CAAC,EAAwB,EAAE,KAAkB,EAAE,CAAS,EAAE,CAAS;IACrF,MAAM,EAAE,GA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O,CAAC,SAAS,CAAC;YAC/B,MAAM,OAAO,GAAG,IAAI,KAAK,EAAE,CAAC;YAC5B,IAAI,CAAC,OAAO,IAAI,IAAI,KAAK,EAAE;gBAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;YAC/E,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;YACxE,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,CAAqB,CAAC;QAC3C,CAAC;QACD,kBAAkB,CAAC,SAA2B;YAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC;YAC/B,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YACxB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;YACjD,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAqB,CAAC;QACzE,CAAC;KACF,CAAC;IACF,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErB,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,MAAM,EAAE,YAAY,CAAC,eAAe,EAAE,YAAY,CAAC;QACnD,YAAY;QACZ,IAAI;QACJ,MAAM;QACN,KAAK;QACL,KAAK;QACL,OAAO;KACR,CAAkB,CAAC;AACtB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@noble/curves/abstract/fft.d.ts b/node_modules/@noble/curves/abstract/fft.d.ts
deleted file mode 100644
index de23516..0000000
--- a/node_modules/@noble/curves/abstract/fft.d.ts
+++ /dev/null
@@ -1,439 +0,0 @@
-/**
- * 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 type { TArg } from '../utils.ts';
-import type { IField } from './modular.ts';
-/** Array-like coefficient storage that can be mutated in place. */
-export interface MutableArrayLike {
- /** Element access by numeric index. */
- [index: number]: T;
- /** Current amount of stored coefficients. */
- length: number;
- /**
- * Return a sliced copy using the same storage shape.
- * @param start - Inclusive start index.
- * @param end - Exclusive end index.
- * @returns Sliced copy.
- */
- slice(start?: number, end?: number): this;
- /**
- * Iterate over stored coefficients in order.
- * @returns Coefficient iterator.
- */
- [Symbol.iterator](): Iterator;
-}
-/**
- * Concrete polynomial containers accepted by the high-level `poly(...)` helpers.
- * Lower-level FFT helpers can work with structural `MutableArrayLike`, but `poly(...)`
- * intentionally keeps runtime dispatch on plain arrays and typed-array views.
- */
-export type PolyStorage = T[] | (MutableArrayLike & ArrayBufferView);
-/**
- * Checks if integer is in form of `1 << X`.
- * @param x - Integer to inspect.
- * @returns `true` when the value is a power of two.
- * @throws If `x` is not a valid unsigned 32-bit integer. {@link Error}
- * @example
- * Validate that an FFT size is a power of two.
- *
- * ```ts
- * isPowerOfTwo(8);
- * ```
- */
-export declare function isPowerOfTwo(x: number): boolean;
-/**
- * @param n - Input value.
- * @returns Next power of two within the u32/array-length domain.
- * @throws If `n` is not a valid unsigned 32-bit integer. {@link Error}
- * @example
- * Round an integer up to the FFT size it needs.
- *
- * ```ts
- * nextPowerOfTwo(9);
- * ```
- */
-export declare function nextPowerOfTwo(n: number): number;
-/**
- * @param n - Value to reverse.
- * @param bits - Number of bits to use.
- * @returns Bit-reversed integer.
- * @throws If `n` is not a valid unsigned 32-bit integer. {@link Error}
- * @example
- * Reverse the low `bits` bits of one index.
- *
- * ```ts
- * reverseBits(3, 3);
- * ```
- */
-export declare function reverseBits(n: number, bits: number): number;
-/**
- * Similar to `bitLen(x)-1` but much faster for small integers, like indices.
- * @param n - Input value.
- * @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
- * Compute the radix-2 stage count for one transform size.
- *
- * ```ts
- * log2(8);
- * ```
- */
-export declare function log2(n: number): number;
-/**
- * Moves lowest bit to highest position, which at first step splits
- * array on even and odd indices, then it applied again to each part,
- * which is core of fft
- * @param values - Mutable coefficient array.
- * @returns Mutated input array.
- * @throws If the array length is not a positive power of two. {@link Error}
- * @example
- * Reorder coefficients into bit-reversed order in place.
- *
- * ```ts
- * const values = Uint8Array.from([0, 1, 2, 3]);
- * bitReversalInplace(values);
- * ```
- */
-export declare function bitReversalInplace>(values: T): T;
-/**
- * @param values - Input values.
- * @returns Reordered copy.
- * @throws If the array length is not a positive power of two. {@link Error}
- * @example
- * Return a reordered copy instead of mutating the input in place.
- *
- * ```ts
- * const reordered = bitReversalPermutation([0, 1, 2, 3]);
- * ```
- */
-export declare function bitReversalPermutation(values: T[]): T[];
-/** Cached roots-of-unity tables derived from one finite field. */
-export type RootsOfUnity = {
- /** Generator and 2-adicity metadata for the cached field. */
- info: {
- G: bigint;
- oddFactor: bigint;
- powerOfTwo: number;
- };
- /**
- * Return the natural-order roots of unity for one radix-2 size.
- * @param bits - Transform size as `log2(N)`.
- * @returns Natural-order roots for that size.
- */
- roots: (bits: number) => bigint[];
- /**
- * Return the bit-reversal permutation of the roots for one radix-2 size.
- * @param bits - Transform size as `log2(N)`.
- * @returns Bit-reversed roots.
- */
- brp(bits: number): bigint[];
- /**
- * Return the inverse roots of unity for one radix-2 size.
- * @param bits - Transform size as `log2(N)`.
- * @returns Inverse roots.
- */
- inverse(bits: number): bigint[];
- /**
- * Return one primitive root used by a radix-2 stage.
- * @param bits - Transform size as `log2(N)`.
- * @returns Primitive root for that stage.
- */
- omega: (bits: number) => bigint;
- /**
- * Drop all cached root tables.
- * @returns Nothing.
- */
- clear: () => void;
-};
-/**
- * We limit roots up to 2**31, which is a lot: 2-billion polynomimal should be rare.
- * @param field - Field implementation.
- * @param generator - Optional generator override.
- * @returns Roots-of-unity cache.
- * @example
- * Cache roots once, then ask for the omega table of one FFT size.
- *
- * ```ts
- * import { rootsOfUnity } from '@noble/curves/abstract/fft.js';
- * import { Field } from '@noble/curves/abstract/modular.js';
- * const roots = rootsOfUnity(Field(17n));
- * const omega = roots.omega(4);
- * ```
- */
-export declare function rootsOfUnity(field: TArg>, generator?: bigint): RootsOfUnity;
-/** Polynomial coefficient container used by the FFT helpers. */
-export type Polynomial = MutableArrayLike;
-/**
- * Arithmetic operations used by the generic FFT implementation.
- *
- * Maps great to Field, but not to Group (EC points):
- * - inv from scalar field
- * - we need multiplyUnsafe here, instead of multiply for speed
- * - multiplyUnsafe is safe in the context: we do mul(rootsOfUnity), which are public and sparse
- */
-export type FFTOpts = {
- /**
- * Add two coefficients.
- * @param a - Left coefficient.
- * @param b - Right coefficient.
- * @returns Sum coefficient.
- */
- add: (a: T, b: T) => T;
- /**
- * Subtract two coefficients.
- * @param a - Left coefficient.
- * @param b - Right coefficient.
- * @returns Difference coefficient.
- */
- sub: (a: T, b: T) => T;
- /**
- * Multiply one coefficient by a scalar/root factor.
- * @param a - Coefficient value.
- * @param scalar - Scalar/root factor.
- * @returns Scaled coefficient.
- */
- mul: (a: T, scalar: R) => T;
- /**
- * Invert one scalar/root factor.
- * @param a - Scalar/root factor.
- * @returns Inverse factor.
- */
- inv: (a: R) => R;
-};
-/** Configuration for one low-level FFT loop. */
-export type FFTCoreOpts = {
- /** Transform size. Must be a power of two. */
- N: number;
- /** Stage roots for the selected transform size. */
- roots: Polynomial;
- /** Whether to run the DIT variant instead of DIF. */
- dit: boolean;
- /** Whether to invert butterfly placement for decode-oriented layouts. */
- invertButterflies?: boolean;
- /** Number of initial stages to skip. */
- skipStages?: number;
- /** Whether to apply bit-reversal permutation at the boundary. */
- brp?: boolean;
-};
-/**
- * Callable low-level FFT loop over one polynomial storage shape.
- * @param values - Polynomial coefficients to transform in place.
- * @returns The mutated input polynomial.
- */
-export type FFTCoreLoop = >(values: P) => P;
-/**
- * Constructs different flavors of FFT. radix2 implementation of low level mutating API. Flavors:
- *
- * - DIT (Decimation-in-Time): Bottom-Up (leaves to root), Cool-Turkey
- * - DIF (Decimation-in-Frequency): Top-Down (root to leaves), Gentleman-Sande
- *
- * DIT takes brp input, returns natural output.
- * DIF takes natural input, returns brp output.
- *
- * The output is actually identical. Time / frequence distinction is not meaningful
- * for Polynomial multiplication in fields.
- * Which means if protocol supports/needs brp output/inputs, then we can skip this step.
- *
- * Cyclic NTT: Rq = Zq[x]/(x^n-1). butterfly_DIT+loop_DIT OR butterfly_DIF+loop_DIT, roots are omega
- * Negacyclic NTT: Rq = Zq[x]/(x^n+1). butterfly_DIT+loop_DIF, at least for mlkem / mldsa
- * @param F - Field operations.
- * @param coreOpts - FFT configuration:
- * - `N`: Transform size. Must be a power of two.
- * - `roots`: Stage roots for the selected transform size.
- * - `dit`: Whether to run the DIT variant instead of DIF.
- * - `invertButterflies` (optional): Whether to invert butterfly placement.
- * - `skipStages` (optional): Number of initial stages to skip.
- * - `brp` (optional): Whether to apply bit-reversal permutation at the boundary.
- * @returns Low-level FFT loop.
- * @throws If the FFT options or cached roots are invalid for the requested size. {@link Error}
- * @example
- * Constructs different flavors of FFT.
- *
- * ```ts
- * import { FFTCore, rootsOfUnity } from '@noble/curves/abstract/fft.js';
- * import { Field } from '@noble/curves/abstract/modular.js';
- * const Fp = Field(17n);
- * const roots = rootsOfUnity(Fp).roots(2);
- * const loop = FFTCore(Fp, { N: 4, roots, dit: true });
- * const values = loop([1n, 2n, 3n, 4n]);
- * ```
- */
-export declare const FFTCore: (F: FFTOpts, coreOpts: FFTCoreOpts) => FFTCoreLoop;
-/** Forward and inverse FFT helpers for one coefficient domain. */
-export type FFTMethods = {
- /**
- * Apply the forward transform.
- * @param values - Polynomial coefficients to transform.
- * @param brpInput - Whether the input is already bit-reversed.
- * @param brpOutput - Whether to keep the output bit-reversed.
- * @returns Transformed copy.
- */
- direct>(values: P, brpInput?: boolean, brpOutput?: boolean): P;
- /**
- * Apply the inverse transform.
- * @param values - Polynomial coefficients to transform.
- * @param brpInput - Whether the input is already bit-reversed.
- * @param brpOutput - Whether to keep the output bit-reversed.
- * @returns Inverse-transformed copy.
- */
- inverse
>(values: P, brpInput?: boolean, brpOutput?: boolean): P;
-};
-/**
- * NTT aka FFT over finite field (NOT over complex numbers).
- * Naming mirrors other libraries.
- * @param roots - Roots-of-unity cache.
- * @param opts - Field operations. See {@link FFTOpts}.
- * @returns Forward and inverse FFT helpers.
- * @example
- * NTT aka FFT over finite field (NOT over complex numbers).
- *
- * ```ts
- * import { FFT, rootsOfUnity } from '@noble/curves/abstract/fft.js';
- * import { Field } from '@noble/curves/abstract/modular.js';
- * const Fp = Field(17n);
- * const fft = FFT(rootsOfUnity(Fp), Fp);
- * const values = fft.direct([1n, 2n, 3n, 4n]);
- * ```
- */
-export declare function FFT(roots: RootsOfUnity, opts: FFTOpts): FFTMethods;
-/**
- * Factory that allocates one polynomial storage container.
- * Callers must ensure `_create(len)` returns field-zero-filled storage when `elm` is omitted,
- * because the quadratic `mul()` / `convolve()` paths and the Kronecker-δ shortcut in
- * `lagrange.basis()` rely on that default instead of always passing `field.ZERO` explicitly.
- * @param len - Requested amount of coefficients.
- * @param elm - Optional fill value.
- * @returns Newly allocated polynomial container.
- */
-export type CreatePolyFn, T> = (len: number, elm?: T) => P;
-/** High-level polynomial helpers layered on top of FFT and field arithmetic. */
-export type PolyFn
, T> = {
- /** Roots-of-unity cache used by the helper namespace. */
- roots: RootsOfUnity;
- /** Factory used to allocate new polynomial containers. */
- create: CreatePolyFn
;
- /** Optional enforced polynomial length. */
- length?: number;
- /**
- * Compute the polynomial degree.
- * @param a - Polynomial coefficients.
- * @returns Polynomial degree.
- */
- degree: (a: P) => number;
- /**
- * Extend or truncate one polynomial to a requested length.
- * @param a - Polynomial coefficients.
- * @param len - Target length.
- * @returns Resized polynomial.
- */
- extend: (a: P, len: number) => P;
- /**
- * Add two polynomials coefficient-wise.
- * @param a - Left polynomial.
- * @param b - Right polynomial.
- * @returns Sum polynomial.
- */
- add: (a: P, b: P) => P;
- /**
- * Subtract two polynomials coefficient-wise.
- * @param a - Left polynomial.
- * @param b - Right polynomial.
- * @returns Difference polynomial.
- */
- sub: (a: P, b: P) => P;
- /**
- * Multiply by another polynomial or by one scalar.
- * @param a - Left polynomial.
- * @param b - Right polynomial or scalar.
- * @returns Product polynomial.
- */
- mul: (a: P, b: P | T) => P;
- /**
- * Multiply coefficients point-wise.
- * @param a - Left polynomial.
- * @param b - Right polynomial.
- * @returns Point-wise product polynomial.
- */
- dot: (a: P, b: P) => P;
- /**
- * Multiply two polynomials with convolution.
- * @param a - Left polynomial.
- * @param b - Right polynomial.
- * @returns Convolution product.
- */
- convolve: (a: P, b: P) => P;
- /**
- * Apply a point-wise coefficient shift by powers of one factor.
- * @param p - Polynomial coefficients.
- * @param factor - Shift factor.
- * @returns Shifted polynomial.
- */
- shift: (p: P, factor: bigint) => P;
- /**
- * Clone one polynomial container.
- * @param a - Polynomial coefficients.
- * @returns Cloned polynomial.
- */
- clone: (a: P) => P;
- /**
- * Evaluate one polynomial on a basis vector.
- * @param a - Polynomial coefficients.
- * @param basis - Basis vector.
- * @returns Evaluated field element.
- */
- eval: (a: P, basis: P) => T;
- /** Helpers for monomial-basis polynomials. */
- monomial: {
- /** Build the monomial basis vector for one evaluation point. */
- basis: (x: T, n: number) => P;
- /** Evaluate a polynomial in the monomial basis. */
- eval: (a: P, x: T) => T;
- };
- /** Helpers for Lagrange-basis polynomials. */
- lagrange: {
- /** Build the Lagrange basis vector for one evaluation point. */
- basis: (x: T, n: number, brp?: boolean) => P;
- /** Evaluate a polynomial in the Lagrange basis. */
- eval: (a: P, x: T, brp?: boolean) => T;
- };
- /**
- * Build the vanishing polynomial for a root set.
- * @param roots - Root set.
- * @returns Vanishing polynomial.
- */
- vanishing: (roots: P) => P;
-};
-/**
- * Poly wants a cracker.
- *
- * Polynomials are functions like `y=f(x)`, which means when we multiply two polynomials, result is
- * function `f3(x) = f1(x) * f2(x)`, we don't multiply values. Key takeaways:
- *
- * - **Polynomial** is an array of coefficients: `f(x) = sum(coeff[i] * basis[i](x))`
- * - **Basis** is array of functions
- * - **Monominal** is Polynomial where `basis[i](x) == x**i` (powers)
- * - **Array size** is domain size
- * - **Lattice** is matrix (Polynomial of Polynomials)
- * @param field - Field implementation.
- * @param roots - Roots-of-unity cache.
- * @param create - Optional polynomial factory. Runtime input validation accepts only plain `Array`
- * and typed-array polynomial containers; arbitrary structural wrappers are intentionally rejected.
- * @param fft - Optional FFT implementation.
- * @param length - Optional fixed polynomial length.
- * @returns Polynomial helper namespace.
- * @example
- * Build polynomial helpers, then convolve two coefficient arrays.
- *
- * ```ts
- * import { poly, rootsOfUnity } from '@noble/curves/abstract/fft.js';
- * import { Field } from '@noble/curves/abstract/modular.js';
- * const Fp = Field(17n);
- * const poly17 = poly(Fp, rootsOfUnity(Fp));
- * const product = poly17.convolve([1n, 2n], [3n, 4n]);
- * ```
- */
-export declare function poly(field: TArg>, roots: RootsOfUnity, create?: undefined, fft?: FFTMethods, length?: number): PolyFn;
-export declare function poly