.
diff --git a/packages/groth16/README.md b/packages/groth16/README.md
new file mode 100644
index 000000000..9ee19e40b
--- /dev/null
+++ b/packages/groth16/README.md
@@ -0,0 +1,125 @@
+
+
+ SnarkJS Groth16
+
+ A snippet of SnarkJS code for verifying and generating Groth16 proofs only.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+| This package contains [SnarkJS](https://github.com/iden3/snarkjs) functions for generating and verifying zero knowledge proofs with Groth16 specifically. In addition to the original code it also uses the cached `bn128` curve if it already exists, making verification and generation of consecutive proofs faster. |
+| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+
+Some advantages of using this package instead of `snarkjs` directly are:
+* It only includes code to verify and generate Groth16 proofs, making your final bundle lighter.
+* It doesn't call the [ffjavascript](https://github.com/iden3/ffjavascript) `buildBn128` function if a `bn128` cached curve already exists, making verification and generation of consecutive proofs much faster (e.g. verification seems to be ~9 times faster after the first one).
+* It includes TS types.
+* It provides an ESM bundle that is compatible with browsers. So there is no need to add any polyfill or additional configuration.
+
+## 🛠 Install
+
+### npm or yarn
+
+Install the `@zk-kit/groth16` package and its peer dependencies with npm:
+
+```bash
+npm i @zk-kit/groth16
+```
+
+or yarn:
+
+```bash
+yarn add @zk-kit/groth16
+```
+
+## 📜 Usage
+
+\# **prove**(input: _CircuitSignals_, wasmFile: _ZKArtifact_, zkeyFile: _ZKArtifact_): Promise\<_{
+proof: Groth16Proof
+publicSignals: PublicSignals
+}_>
+
+```typescript
+import { prove } from "@zk-kit/groth16"
+
+const input = {
+ message: 12,
+ scope: 122
+}
+
+const proof = await prove(input, "./circuit.zkey", "./circuit.wasm")
+
+console.log(proof)
+/*
+{
+ proof: {
+ pi_a: [
+ '8259885706934172848141475422209230656096448508815982888010519325096632035723',
+ '3142099172052192611205205328157407975469005554072266974009053708782134081166',
+ '1'
+ ],
+ pi_b: [ [Array], [Array], [Array] ],
+ pi_c: [
+ '13863804425308906943736719856399634046638544298517159271373916818387594277305',
+ '21340646707244019956779928177502771923632450548108204371058275686712196195969',
+ '1'
+ ],
+ protocol: 'groth16',
+ curve: 'bn128'
+ },
+ publicSignals: [
+ '527758365153958423212195330785598453331596731388181860789801455413116800554',
+ '19104626566001952573667666924569656871967113105870778077087237826253896482830',
+ '122'
+ ]
+}
+*/
+```
+
+\# **verify**(verificationKey: _any_, proof: _{
+proof: Groth16Proof
+publicSignals: PublicSignals
+}_): Promise\<_boolean_>
+
+```typescript
+import { verify } from "@zk-kit/groth16"
+import verificationKey from "./circuit.json"
+
+const response = await verify(verificationKey, proof)
+
+console.log(response) // true
+```
diff --git a/packages/groth16/build.tsconfig.json b/packages/groth16/build.tsconfig.json
new file mode 100644
index 000000000..2d4a1d6da
--- /dev/null
+++ b/packages/groth16/build.tsconfig.json
@@ -0,0 +1,8 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "baseUrl": ".",
+ "declarationDir": "dist/types"
+ },
+ "include": ["src"]
+}
diff --git a/packages/groth16/package.json b/packages/groth16/package.json
new file mode 100644
index 000000000..22ecb348d
--- /dev/null
+++ b/packages/groth16/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "@zk-kit/groth16",
+ "version": "0.2.0",
+ "description": "A snippet of SnarkJS code for verifying and generating Groth16 proofs only.",
+ "license": "MIT",
+ "main": "dist/index.node.js",
+ "exports": {
+ "node": {
+ "import": "./dist/index.node.mjs",
+ "require": "./dist/index.node.js"
+ },
+ "browser": "./dist/index.browser.mjs",
+ "default": "./dist/index.browser.mjs"
+ },
+ "types": "dist/types/index.d.ts",
+ "files": [
+ "dist/",
+ "src/",
+ "LICENSE",
+ "README.md"
+ ],
+ "repository": "https://github.com/privacy-scaling-explorations/zk-kit",
+ "homepage": "https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/groth16",
+ "bugs": {
+ "url": "https://github.com/privacy-scaling-explorations/zk-kit.git/issues"
+ },
+ "scripts": {
+ "build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
+ "build": "rimraf dist && yarn build:browser && yarn build:node",
+ "build:browser": "rollup -c rollup.browser.config.ts --configPlugin typescript",
+ "build:node": "rollup -c rollup.node.config.ts --configPlugin typescript",
+ "prepublishOnly": "yarn build"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "devDependencies": {
+ "@iden3/binfileutils": "0.0.11",
+ "@rollup/plugin-commonjs": "^24.1.0",
+ "@rollup/plugin-node-resolve": "^15.0.2",
+ "@rollup/plugin-virtual": "^3.0.2",
+ "fastfile": "0.0.20",
+ "rimraf": "^5.0.5",
+ "rollup": "^4.0.2",
+ "rollup-plugin-cleanup": "^3.2.1",
+ "rollup-plugin-typescript2": "^0.31.2"
+ },
+ "dependencies": {
+ "circom_runtime": "0.1.24",
+ "ffjavascript": "0.2.60"
+ }
+}
diff --git a/packages/groth16/rollup.browser.config.ts b/packages/groth16/rollup.browser.config.ts
new file mode 100644
index 000000000..058143451
--- /dev/null
+++ b/packages/groth16/rollup.browser.config.ts
@@ -0,0 +1,56 @@
+import commonjs from "@rollup/plugin-commonjs"
+import { nodeResolve } from "@rollup/plugin-node-resolve"
+import virtual from "@rollup/plugin-virtual"
+import * as fs from "fs"
+import cleanup from "rollup-plugin-cleanup"
+import typescript from "rollup-plugin-typescript2"
+
+// Needed by fastfile.
+import { O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_TRUNC } from "constants"
+
+const constants = `
+export const O_TRUNC = ${O_TRUNC};
+export const O_CREAT = ${O_CREAT};
+export const O_RDWR = ${O_RDWR};
+export const O_EXCL = ${O_EXCL};
+export const O_RDONLY = ${O_RDONLY}
+`
+
+const empty = "export default {}"
+
+const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8"))
+const banner = `/**
+ * @module ${pkg.name}
+ * @version ${pkg.version}
+ * @file ${pkg.description}
+ * @copyright Ethereum Foundation 2023
+ * @license ${pkg.license}
+ * @see [Github]{@link ${pkg.homepage}}
+*/`
+
+export default {
+ input: "src/index.ts",
+ output: [
+ {
+ file: pkg.exports.browser,
+ format: "es",
+ banner
+ }
+ ],
+ external: Object.keys(pkg.dependencies),
+ plugins: [
+ typescript({
+ tsconfig: "./build.tsconfig.json",
+ useTsconfigDeclarationDir: true
+ }),
+ virtual({
+ fs: empty,
+ constants
+ }),
+ nodeResolve(),
+ commonjs({
+ esmExternals: true
+ }),
+ cleanup({ comments: "jsdoc" })
+ ]
+}
diff --git a/packages/groth16/rollup.node.config.ts b/packages/groth16/rollup.node.config.ts
new file mode 100644
index 000000000..66f4a02cb
--- /dev/null
+++ b/packages/groth16/rollup.node.config.ts
@@ -0,0 +1,44 @@
+import commonjs from "@rollup/plugin-commonjs"
+import { nodeResolve } from "@rollup/plugin-node-resolve"
+import * as fs from "fs"
+import cleanup from "rollup-plugin-cleanup"
+import typescript from "rollup-plugin-typescript2"
+
+const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8"))
+const banner = `/**
+ * @module ${pkg.name}
+ * @version ${pkg.version}
+ * @file ${pkg.description}
+ * @copyright Ethereum Foundation 2023
+ * @license ${pkg.license}
+ * @see [Github]{@link ${pkg.homepage}}
+*/`
+
+export default {
+ input: "src/index.ts",
+ output: [
+ {
+ file: pkg.exports.node.require,
+ format: "cjs",
+ banner,
+ exports: "auto"
+ },
+ {
+ file: pkg.exports.node.import,
+ format: "es",
+ banner
+ }
+ ],
+ external: Object.keys(pkg.dependencies),
+ plugins: [
+ typescript({
+ tsconfig: "./build.tsconfig.json",
+ useTsconfigDeclarationDir: true
+ }),
+ nodeResolve(),
+ commonjs({
+ esmExternals: true
+ }),
+ cleanup({ comments: "jsdoc" })
+ ]
+}
diff --git a/packages/groth16/snark-artifacts/index.json b/packages/groth16/snark-artifacts/index.json
new file mode 100644
index 000000000..874031cd3
--- /dev/null
+++ b/packages/groth16/snark-artifacts/index.json
@@ -0,0 +1,95 @@
+{
+ "protocol": "groth16",
+ "curve": "bn128",
+ "nPublic": 3,
+ "vk_alpha_1": [
+ "20491192805390485299153009773594534940189261866228447918068658471970481763042",
+ "9383485363053290200918347156157836566562967994039712273449902621266178545958",
+ "1"
+ ],
+ "vk_beta_2": [
+ [
+ "6375614351688725206403948262868962793625744043794305715222011528459656738731",
+ "4252822878758300859123897981450591353533073413197771768651442665752259397132"
+ ],
+ [
+ "10505242626370262277552901082094356697409835680220590971873171140371331206856",
+ "21847035105528745403288232691147584728191162732299865338377159692350059136679"
+ ],
+ ["1", "0"]
+ ],
+ "vk_gamma_2": [
+ [
+ "10857046999023057135944570762232829481370756359578518086990519993285655852781",
+ "11559732032986387107991004021392285783925812861821192530917403151452391805634"
+ ],
+ [
+ "8495653923123431417604973247489272438418190587263600148770280649306958101930",
+ "4082367875863433681332203403145435568316851327593401208105741076214120093531"
+ ],
+ ["1", "0"]
+ ],
+ "vk_delta_2": [
+ [
+ "17546152771742044890128665170773308307706885904145171368861289731338407120726",
+ "21635289475723704811498602453116541869848271742675656134593605133653559871988"
+ ],
+ [
+ "12208424286857750236404959484429248934995357114248145547240410687755355066198",
+ "19321625097082563598592975631421044551870980615218660051914871088320678365555"
+ ],
+ ["1", "0"]
+ ],
+ "vk_alphabeta_12": [
+ [
+ [
+ "2029413683389138792403550203267699914886160938906632433982220835551125967885",
+ "21072700047562757817161031222997517981543347628379360635925549008442030252106"
+ ],
+ [
+ "5940354580057074848093997050200682056184807770593307860589430076672439820312",
+ "12156638873931618554171829126792193045421052652279363021382169897324752428276"
+ ],
+ [
+ "7898200236362823042373859371574133993780991612861777490112507062703164551277",
+ "7074218545237549455313236346927434013100842096812539264420499035217050630853"
+ ]
+ ],
+ [
+ [
+ "7077479683546002997211712695946002074877511277312570035766170199895071832130",
+ "10093483419865920389913245021038182291233451549023025229112148274109565435465"
+ ],
+ [
+ "4595479056700221319381530156280926371456704509942304414423590385166031118820",
+ "19831328484489333784475432780421641293929726139240675179672856274388269393268"
+ ],
+ [
+ "11934129596455521040620786944827826205713621633706285934057045369193958244500",
+ "8037395052364110730298837004334506829870972346962140206007064471173334027475"
+ ]
+ ]
+ ],
+ "IC": [
+ [
+ "10540353245037691655240058832465935071147222378795512774896416883563614389198",
+ "20042286059857913285646233979306226083538103143380748863555356103197961213823",
+ "1"
+ ],
+ [
+ "12178048393484805922448151297512780036777540315506565788645040495931277621130",
+ "9697539656531822741576184528195082340044862873578980581504958946888585254425",
+ "1"
+ ],
+ [
+ "20991907493060125430185038723439696392069163847357524165903787100018954817952",
+ "12348708907766483529401318577288191297476103087328423321867414316726183562292",
+ "1"
+ ],
+ [
+ "6823739927950557742246913693052072220213742766782370219666937126411380340633",
+ "19878777316727584245579797737044924949420447706770682437221414501064053790692",
+ "1"
+ ]
+ ]
+}
diff --git a/packages/groth16/snark-artifacts/index.wasm b/packages/groth16/snark-artifacts/index.wasm
new file mode 100644
index 000000000..7a67220dc
Binary files /dev/null and b/packages/groth16/snark-artifacts/index.wasm differ
diff --git a/packages/groth16/snark-artifacts/index.zkey b/packages/groth16/snark-artifacts/index.zkey
new file mode 100644
index 000000000..3d37f26c1
Binary files /dev/null and b/packages/groth16/snark-artifacts/index.zkey differ
diff --git a/packages/groth16/src/index.ts b/packages/groth16/src/index.ts
new file mode 100644
index 000000000..d2ac9dc31
--- /dev/null
+++ b/packages/groth16/src/index.ts
@@ -0,0 +1,5 @@
+import prove from "./prove"
+import verify from "./verify"
+
+export { prove, verify }
+export * from "./types"
diff --git a/packages/groth16/src/prove.ts b/packages/groth16/src/prove.ts
new file mode 100644
index 000000000..285c8ba7c
--- /dev/null
+++ b/packages/groth16/src/prove.ts
@@ -0,0 +1,235 @@
+/* eslint-disable no-plusplus */
+/* eslint-disable eqeqeq */
+/* eslint-disable @typescript-eslint/naming-convention */
+/* istanbul ignore file */
+
+// @ts-ignore
+import * as binFileUtils from "@iden3/binfileutils"
+import { BigBuffer, Scalar, utils } from "ffjavascript"
+import { log2 } from "./utils"
+import * as zkeyUtils from "./zkey-utils"
+import * as wtnsUtils from "./wtns-utils"
+import wtnsCalculate from "./wtns-calculate"
+import { CircuitSignals, Groth16Proof, PublicSignals, ZKArtifact } from "./types"
+
+const { stringifyBigInts, unstringifyBigInts } = utils
+
+async function buildABC1(curve: any, zkey: any, witness: any, coeffs: any) {
+ const { n8 } = curve.Fr
+ const sCoef = 4 * 3 + zkey.n8r
+ const nCoef = (coeffs.byteLength - 4) / sCoef
+
+ const outBuffA = new BigBuffer(zkey.domainSize * n8)
+ const outBuffB = new BigBuffer(zkey.domainSize * n8)
+ const outBuffC = new BigBuffer(zkey.domainSize * n8)
+
+ const outBuf = [outBuffA, outBuffB]
+ for (let i = 0; i < nCoef; i++) {
+ const buffCoef = coeffs.slice(4 + i * sCoef, 4 + i * sCoef + sCoef)
+ const buffCoefV = new DataView(buffCoef.buffer)
+ const m = buffCoefV.getUint32(0, true)
+ const c = buffCoefV.getUint32(4, true)
+ const s = buffCoefV.getUint32(8, true)
+ const coef = buffCoef.slice(12, 12 + n8)
+ outBuf[m].set(
+ curve.Fr.add(outBuf[m].slice(c * n8, c * n8 + n8), curve.Fr.mul(coef, witness.slice(s * n8, s * n8 + n8))),
+ c * n8
+ )
+ }
+
+ for (let i = 0; i < zkey.domainSize; i++) {
+ outBuffC.set(curve.Fr.mul(outBuffA.slice(i * n8, i * n8 + n8), outBuffB.slice(i * n8, i * n8 + n8)), i * n8)
+ }
+
+ return [outBuffA, outBuffB, outBuffC]
+}
+
+async function joinABC(curve: any, _zkey: any, a: any, b: any, c: any) {
+ const MAX_CHUNK_SIZE = 1 << 22
+
+ const { n8 } = curve.Fr
+ const nElements = Math.floor(a.byteLength / curve.Fr.n8)
+
+ const promises = []
+
+ for (let i = 0; i < nElements; i += MAX_CHUNK_SIZE) {
+ const n = Math.min(nElements - i, MAX_CHUNK_SIZE)
+
+ const task = []
+
+ const aChunk = a.slice(i * n8, (i + n) * n8)
+ const bChunk = b.slice(i * n8, (i + n) * n8)
+ const cChunk = c.slice(i * n8, (i + n) * n8)
+
+ task.push({ cmd: "ALLOCSET", var: 0, buff: aChunk })
+ task.push({ cmd: "ALLOCSET", var: 1, buff: bChunk })
+ task.push({ cmd: "ALLOCSET", var: 2, buff: cChunk })
+ task.push({ cmd: "ALLOC", var: 3, len: n * n8 })
+ task.push({
+ cmd: "CALL",
+ fnName: "qap_joinABC",
+ params: [{ var: 0 }, { var: 1 }, { var: 2 }, { val: n }, { var: 3 }]
+ })
+ task.push({ cmd: "CALL", fnName: "frm_batchFromMontgomery", params: [{ var: 3 }, { val: n }, { var: 3 }] })
+ task.push({ cmd: "GET", out: 0, var: 3, len: n * n8 })
+ promises.push(curve.tm.queueAction(task))
+ }
+
+ const result = await Promise.all(promises)
+
+ let outBuff
+ if (a instanceof BigBuffer) {
+ // @ts-ignore
+ outBuff = new BigBuffer(a.byteLength)
+ } else {
+ outBuff = new Uint8Array(a.byteLength)
+ }
+
+ let p = 0
+ for (let i = 0; i < result.length; i++) {
+ outBuff.set(result[i][0], p)
+ p += result[i][0].byteLength
+ }
+
+ return outBuff
+}
+
+/**
+ * Creates a Groth16 proof composed of public signals and zero-knowledge parameters.
+ * @param input Input signals of the circuit.
+ * @param wasmFile WASM file of the circuit.
+ * @param zkeyFile ZKey file of the circuit.
+ * @returns A proof containing public signals and zero-knowledge parameters.
+ */
+export default async function prove(
+ input: CircuitSignals,
+ wasmFile: ZKArtifact,
+ zkeyFile: ZKArtifact
+): Promise<{
+ proof: Groth16Proof
+ publicSignals: PublicSignals
+}> {
+ input = unstringifyBigInts(input)
+
+ const witnessFileName = {
+ type: "mem"
+ }
+
+ await wtnsCalculate(input, wasmFile, witnessFileName)
+
+ const { fd: fdWtns, sections: sectionsWtns } = await binFileUtils.readBinFile(
+ witnessFileName,
+ "wtns",
+ 2,
+ 1 << 25,
+ 1 << 23
+ )
+
+ const wtns = await wtnsUtils.readHeader(fdWtns, sectionsWtns)
+
+ const { fd: fdZKey, sections: sectionsZKey } = await binFileUtils.readBinFile(zkeyFile, "zkey", 2, 1 << 25, 1 << 23)
+
+ const zkey = await zkeyUtils.readHeader(fdZKey, sectionsZKey, undefined)
+
+ if (zkey.protocol !== "groth16") {
+ throw new Error("zkey file is not groth16")
+ }
+
+ if (!Scalar.eq(zkey.r, wtns.q)) {
+ throw new Error("Curve of the witness does not match the curve of the proving key")
+ }
+
+ if (wtns.nWitness !== zkey.nVars) {
+ throw new Error(`Invalid witness length. Circuit: ${zkey.nVars}, witness: ${wtns.nWitness}`)
+ }
+
+ const { curve } = zkey
+ const { Fr } = curve
+ const { G1 } = curve
+ const { G2 } = curve
+
+ const power = log2(zkey.domainSize)
+
+ const buffWitness = await binFileUtils.readSection(fdWtns, sectionsWtns, 2)
+ const buffCoeffs = await binFileUtils.readSection(fdZKey, sectionsZKey, 4)
+
+ const [buffA_T, buffB_T, buffC_T] = await buildABC1(curve, zkey, buffWitness, buffCoeffs)
+
+ const inc = power == Fr.s ? curve.Fr.shift : curve.Fr.w[power + 1]
+
+ const buffA = await Fr.ifft(buffA_T, "", "", undefined, "IFFT_A")
+ const buffAodd = await Fr.batchApplyKey(buffA, Fr.e(1), inc)
+ const buffAodd_T = await Fr.fft(buffAodd, "", "", undefined, "FFT_A")
+
+ const buffB = await Fr.ifft(buffB_T, "", "", undefined, "IFFT_B")
+ const buffBodd = await Fr.batchApplyKey(buffB, Fr.e(1), inc)
+ const buffBodd_T = await Fr.fft(buffBodd, "", "", undefined, "FFT_B")
+
+ const buffC = await Fr.ifft(buffC_T, "", "", undefined, "IFFT_C")
+ const buffCodd = await Fr.batchApplyKey(buffC, Fr.e(1), inc)
+ const buffCodd_T = await Fr.fft(buffCodd, "", "", undefined, "FFT_C")
+
+ const buffPodd_T = await joinABC(curve, zkey, buffAodd_T, buffBodd_T, buffCodd_T)
+
+ let proof: any = {}
+
+ const buffBasesA = await binFileUtils.readSection(fdZKey, sectionsZKey, 5)
+ proof.pi_a = await curve.G1.multiExpAffine(buffBasesA, buffWitness, undefined, "multiexp A")
+
+ const buffBasesB1 = await binFileUtils.readSection(fdZKey, sectionsZKey, 6)
+ let pib1 = await curve.G1.multiExpAffine(buffBasesB1, buffWitness, undefined, "multiexp B1")
+
+ const buffBasesB2 = await binFileUtils.readSection(fdZKey, sectionsZKey, 7)
+ proof.pi_b = await curve.G2.multiExpAffine(buffBasesB2, buffWitness, undefined, "multiexp B2")
+
+ const buffBasesC = await binFileUtils.readSection(fdZKey, sectionsZKey, 8)
+ proof.pi_c = await curve.G1.multiExpAffine(
+ buffBasesC,
+ buffWitness.slice((zkey.nPublic + 1) * curve.Fr.n8),
+ undefined,
+ "multiexp C"
+ )
+
+ const buffBasesH = await binFileUtils.readSection(fdZKey, sectionsZKey, 9)
+ const resH = await curve.G1.multiExpAffine(buffBasesH, buffPodd_T, undefined, "multiexp H")
+
+ const r = curve.Fr.random()
+ const s = curve.Fr.random()
+
+ proof.pi_a = G1.add(proof.pi_a, zkey.vk_alpha_1)
+ proof.pi_a = G1.add(proof.pi_a, G1.timesFr(zkey.vk_delta_1, r))
+
+ proof.pi_b = G2.add(proof.pi_b, zkey.vk_beta_2)
+ proof.pi_b = G2.add(proof.pi_b, G2.timesFr(zkey.vk_delta_2, s))
+
+ pib1 = G1.add(pib1, zkey.vk_beta_1)
+ pib1 = G1.add(pib1, G1.timesFr(zkey.vk_delta_1, s))
+
+ proof.pi_c = G1.add(proof.pi_c, resH)
+
+ proof.pi_c = G1.add(proof.pi_c, G1.timesFr(proof.pi_a, s))
+ proof.pi_c = G1.add(proof.pi_c, G1.timesFr(pib1, r))
+ proof.pi_c = G1.add(proof.pi_c, G1.timesFr(zkey.vk_delta_1, Fr.neg(Fr.mul(r, s))))
+
+ let publicSignals = []
+
+ for (let i = 1; i <= zkey.nPublic; i++) {
+ const b = buffWitness.slice(i * Fr.n8, i * Fr.n8 + Fr.n8)
+ publicSignals.push(Scalar.fromRprLE(b, undefined, undefined))
+ }
+
+ proof.pi_a = G1.toObject(G1.toAffine(proof.pi_a))
+ proof.pi_b = G2.toObject(G2.toAffine(proof.pi_b))
+ proof.pi_c = G1.toObject(G1.toAffine(proof.pi_c))
+
+ proof.protocol = "groth16"
+ proof.curve = curve.name
+
+ await fdZKey.close()
+ await fdWtns.close()
+
+ proof = stringifyBigInts(proof)
+ publicSignals = stringifyBigInts(publicSignals)
+
+ return { proof, publicSignals }
+}
diff --git a/packages/groth16/src/types/index.ts b/packages/groth16/src/types/index.ts
new file mode 100644
index 000000000..0583a0377
--- /dev/null
+++ b/packages/groth16/src/types/index.ts
@@ -0,0 +1,19 @@
+export type ZKArtifact = string | Uint8Array
+
+export type NumericString = `${number}` | string
+
+export type SignalValueType = NumericString | number | bigint | SignalValueType[]
+
+export interface CircuitSignals {
+ [signal: string]: SignalValueType
+}
+
+export interface Groth16Proof {
+ pi_a: NumericString[]
+ pi_b: NumericString[][]
+ pi_c: NumericString[]
+ protocol: string
+ curve: string
+}
+
+export type PublicSignals = NumericString[]
diff --git a/packages/groth16/src/utils.ts b/packages/groth16/src/utils.ts
new file mode 100644
index 000000000..198edd1d3
--- /dev/null
+++ b/packages/groth16/src/utils.ts
@@ -0,0 +1,14 @@
+/* eslint-disable import/prefer-default-export */
+/* eslint-disable no-return-assign */
+/* istanbul ignore file */
+
+export function log2(V: any) {
+ return (
+ ((V & 0xffff0000) !== 0 ? ((V &= 0xffff0000), 16) : 0) |
+ ((V & 0xff00ff00) !== 0 ? ((V &= 0xff00ff00), 8) : 0) |
+ ((V & 0xf0f0f0f0) !== 0 ? ((V &= 0xf0f0f0f0), 4) : 0) |
+ ((V & 0xcccccccc) !== 0 ? ((V &= 0xcccccccc), 2) : 0) |
+ // @ts-ignore
+ ((V & 0xaaaaaaaa) !== 0)
+ )
+}
diff --git a/packages/groth16/src/verify.ts b/packages/groth16/src/verify.ts
new file mode 100644
index 000000000..016ee202e
--- /dev/null
+++ b/packages/groth16/src/verify.ts
@@ -0,0 +1,90 @@
+/* eslint-disable no-plusplus */
+/* eslint-disable @typescript-eslint/naming-convention */
+/* istanbul ignore file */
+
+import { Scalar, utils, buildBn128 } from "ffjavascript"
+import { Groth16Proof, PublicSignals } from "./types"
+
+const { unstringifyBigInts } = utils
+
+function isWellConstructed(curve: any, proof: any) {
+ const { G1 } = curve
+ const { G2 } = curve
+
+ return G1.isValid(proof.pi_a) && G2.isValid(proof.pi_b) && G1.isValid(proof.pi_c)
+}
+
+function publicInputsAreValid(curve: any, publicInputs: any) {
+ for (let i = 0; i < publicInputs.length; i++) {
+ if (!Scalar.lt(publicInputs[i], curve.r)) {
+ return false
+ }
+ }
+ return true
+}
+
+/**
+ * Verifies if a Groth16 proof is valid or not.
+ * @param verificationKey The verification key used to verify the proof.
+ * @param proof The proof containing public signals and zero-knowledge parameters.
+ * @returns True if the proof is valid, and false otherwise.
+ */
+export default async function verify(
+ verificationKey: any,
+ {
+ proof,
+ publicSignals
+ }: {
+ proof: Groth16Proof
+ publicSignals: PublicSignals
+ }
+): Promise {
+ verificationKey = unstringifyBigInts(verificationKey)
+ proof = unstringifyBigInts(proof)
+ publicSignals = unstringifyBigInts(publicSignals)
+
+ // @ts-ignore
+ const curve = globalThis.curve_bn128 ?? (await buildBn128(undefined, undefined))
+
+ const IC0 = curve.G1.fromObject(verificationKey.IC[0])
+ const IC = new Uint8Array(curve.G1.F.n8 * 2 * publicSignals.length)
+ const w = new Uint8Array(curve.Fr.n8 * publicSignals.length)
+
+ if (!publicInputsAreValid(curve, publicSignals)) {
+ return false
+ }
+
+ for (let i = 0; i < publicSignals.length; i++) {
+ const buffP = curve.G1.fromObject(verificationKey.IC[i + 1])
+ IC.set(buffP, i * curve.G1.F.n8 * 2)
+ Scalar.toRprLE(w, curve.Fr.n8 * i, publicSignals[i], curve.Fr.n8)
+ }
+
+ let cpub = await curve.G1.multiExpAffine(IC, w)
+ cpub = curve.G1.add(cpub, IC0)
+
+ const pi_a = curve.G1.fromObject(proof.pi_a)
+ const pi_b = curve.G2.fromObject(proof.pi_b)
+ const pi_c = curve.G1.fromObject(proof.pi_c)
+
+ if (!isWellConstructed(curve, { pi_a, pi_b, pi_c })) {
+ return false
+ }
+
+ const vk_gamma_2 = curve.G2.fromObject(verificationKey.vk_gamma_2)
+ const vk_delta_2 = curve.G2.fromObject(verificationKey.vk_delta_2)
+ const vk_alpha_1 = curve.G1.fromObject(verificationKey.vk_alpha_1)
+ const vk_beta_2 = curve.G2.fromObject(verificationKey.vk_beta_2)
+
+ return curve.pairingEq(
+ curve.G1.neg(pi_a),
+ pi_b,
+ cpub,
+ vk_gamma_2,
+ pi_c,
+ vk_delta_2,
+
+ vk_alpha_1,
+ vk_beta_2
+ )
+}
diff --git a/packages/groth16/src/wtns-calculate.ts b/packages/groth16/src/wtns-calculate.ts
new file mode 100644
index 000000000..263f7e91e
--- /dev/null
+++ b/packages/groth16/src/wtns-calculate.ts
@@ -0,0 +1,39 @@
+/* eslint-disable eqeqeq */
+/* istanbul ignore file */
+
+// @ts-ignore
+import * as binFileUtils from "@iden3/binfileutils"
+// @ts-ignore
+import { WitnessCalculatorBuilder } from "circom_runtime"
+// @ts-ignore
+import * as fastFile from "fastfile"
+import { utils } from "ffjavascript"
+import * as wtnsUtils from "./wtns-utils"
+
+const { unstringifyBigInts } = utils
+
+export default async function wtnsCalculate(_input: any, wasmFileName: any, wtnsFileName: any) {
+ const input = unstringifyBigInts(_input)
+
+ const fdWasm = await fastFile.readExisting(wasmFileName)
+ const wasm = await fdWasm.read(fdWasm.totalSize)
+ await fdWasm.close()
+
+ const wc = await WitnessCalculatorBuilder(wasm)
+
+ if (wc.circom_version() == 1) {
+ const w = await wc.calculateBinWitness(input)
+
+ const fdWtns = await binFileUtils.createBinFile(wtnsFileName, "wtns", 2, 2)
+
+ await wtnsUtils.writeBin(fdWtns, w, wc.prime)
+ await fdWtns.close()
+ } else {
+ const fdWtns = await fastFile.createOverride(wtnsFileName)
+
+ const w = await wc.calculateWTNSBin(input)
+
+ await fdWtns.write(w)
+ await fdWtns.close()
+ }
+}
diff --git a/packages/groth16/src/wtns-utils.ts b/packages/groth16/src/wtns-utils.ts
new file mode 100644
index 000000000..cadca43b2
--- /dev/null
+++ b/packages/groth16/src/wtns-utils.ts
@@ -0,0 +1,32 @@
+/* eslint-disable eqeqeq */
+/* istanbul ignore file */
+
+// @ts-ignore
+import * as binFileUtils from "@iden3/binfileutils"
+import { Scalar } from "ffjavascript"
+
+export async function writeBin(fd: any, witnessBin: any, prime: any) {
+ await binFileUtils.startWriteSection(fd, 1)
+ const n8 = (Math.floor((Scalar.bitLength(prime) - 1) / 64) + 1) * 8
+ await fd.writeULE32(n8)
+ await binFileUtils.writeBigInt(fd, prime, n8)
+ if (witnessBin.byteLength % n8 != 0) {
+ throw new Error("Invalid witness length")
+ }
+ await fd.writeULE32(witnessBin.byteLength / n8)
+ await binFileUtils.endWriteSection(fd)
+
+ await binFileUtils.startWriteSection(fd, 2)
+ await fd.write(witnessBin)
+ await binFileUtils.endWriteSection(fd)
+}
+
+export async function readHeader(fd: any, sections: any) {
+ await binFileUtils.startReadUniqueSection(fd, sections, 1)
+ const n8 = await fd.readULE32()
+ const q = await binFileUtils.readBigInt(fd, n8)
+ const nWitness = await fd.readULE32()
+ await binFileUtils.endReadSection(fd)
+
+ return { n8, q, nWitness }
+}
diff --git a/packages/groth16/src/zkey-utils.ts b/packages/groth16/src/zkey-utils.ts
new file mode 100644
index 000000000..c3b245a28
--- /dev/null
+++ b/packages/groth16/src/zkey-utils.ts
@@ -0,0 +1,63 @@
+/* eslint-disable import/prefer-default-export */
+/* istanbul ignore file */
+
+// @ts-ignore
+import * as binFileUtils from "@iden3/binfileutils"
+import { buildBn128 } from "ffjavascript"
+import { log2 } from "./utils"
+
+async function readG1(fd: any, curve: any, toObject: any) {
+ const buff = await fd.read(curve.G1.F.n8 * 2)
+ const res = curve.G1.fromRprLEM(buff, 0)
+ return toObject ? curve.G1.toObject(res) : res
+}
+
+async function readG2(fd: any, curve: any, toObject: any) {
+ const buff = await fd.read(curve.G2.F.n8 * 2)
+ const res = curve.G2.fromRprLEM(buff, 0)
+ return toObject ? curve.G2.toObject(res) : res
+}
+
+async function readHeaderGroth16(fd: any, sections: any, toObject: any) {
+ const zkey: any = {}
+
+ zkey.protocol = "groth16"
+
+ await binFileUtils.startReadUniqueSection(fd, sections, 2)
+ const n8q = await fd.readULE32()
+ zkey.n8q = n8q
+ zkey.q = await binFileUtils.readBigInt(fd, n8q)
+
+ const n8r = await fd.readULE32()
+ zkey.n8r = n8r
+ zkey.r = await binFileUtils.readBigInt(fd, n8r)
+
+ // @ts-ignore
+ zkey.curve = globalThis.curve_bn128 ?? (await buildBn128(undefined, undefined))
+
+ zkey.nVars = await fd.readULE32()
+ zkey.nPublic = await fd.readULE32()
+ zkey.domainSize = await fd.readULE32()
+ zkey.power = log2(zkey.domainSize)
+ zkey.vk_alpha_1 = await readG1(fd, zkey.curve, toObject)
+ zkey.vk_beta_1 = await readG1(fd, zkey.curve, toObject)
+ zkey.vk_beta_2 = await readG2(fd, zkey.curve, toObject)
+ zkey.vk_gamma_2 = await readG2(fd, zkey.curve, toObject)
+ zkey.vk_delta_1 = await readG1(fd, zkey.curve, toObject)
+ zkey.vk_delta_2 = await readG2(fd, zkey.curve, toObject)
+ await binFileUtils.endReadSection(fd)
+
+ return zkey
+}
+
+export async function readHeader(fd: any, sections: any, toObject: any) {
+ await binFileUtils.startReadUniqueSection(fd, sections, 1)
+ const protocolId = await fd.readULE32()
+ await binFileUtils.endReadSection(fd)
+
+ if (protocolId === 1) {
+ return readHeaderGroth16(fd, sections, toObject)
+ }
+
+ throw new Error("Protocol not supported: ")
+}
diff --git a/packages/groth16/tests/index.test.ts b/packages/groth16/tests/index.test.ts
new file mode 100644
index 000000000..c2f04e379
--- /dev/null
+++ b/packages/groth16/tests/index.test.ts
@@ -0,0 +1,46 @@
+import { getCurveFromName } from "ffjavascript"
+import { verify, prove } from "../src"
+import verificationKey from "../snark-artifacts/index.json"
+
+describe("Groth16", () => {
+ const wasmFilePath = "./packages/groth16/snark-artifacts/index.wasm"
+ const zkeyFilePath = "./packages/groth16/snark-artifacts/index.zkey"
+
+ let curve: any
+ let proof: any
+
+ beforeAll(async () => {
+ curve = await getCurveFromName("bn128")
+ })
+
+ afterAll(async () => {
+ await curve.terminate()
+ })
+
+ it("Should generate a proof", async () => {
+ proof = await prove(
+ {
+ message: 12,
+ scope: 122
+ },
+ wasmFilePath,
+ zkeyFilePath
+ )
+
+ expect(typeof proof).toBe("object")
+ }, 20000)
+
+ it("Should verify a valid proof", async () => {
+ const response = await verify(verificationKey, proof)
+
+ expect(response).toBe(true)
+ })
+
+ it("Should verify an invalid proof", async () => {
+ proof.publicSignals[0] = 0
+
+ const response = await verify(verificationKey, proof)
+
+ expect(response).toBe(false)
+ })
+})
diff --git a/packages/groth16/tsconfig.json b/packages/groth16/tsconfig.json
new file mode 100644
index 000000000..d90026c5a
--- /dev/null
+++ b/packages/groth16/tsconfig.json
@@ -0,0 +1,7 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "resolveJsonModule": true
+ },
+ "include": ["src", "tests", "rollup.browser.config.ts", "rollup.node.config.ts"]
+}
diff --git a/packages/groth16/typedoc.json b/packages/groth16/typedoc.json
new file mode 100644
index 000000000..77a471c91
--- /dev/null
+++ b/packages/groth16/typedoc.json
@@ -0,0 +1,3 @@
+{
+ "entryPoints": ["src/index.ts"]
+}
diff --git a/types/ffjavascript/index.d.ts b/types/ffjavascript/index.d.ts
new file mode 100644
index 000000000..f754ad716
--- /dev/null
+++ b/types/ffjavascript/index.d.ts
@@ -0,0 +1,509 @@
+/** Declaration file generated by dts-gen */
+
+declare module "ffjavascript" {
+ export class BigBuffer {
+ constructor(...args: any[])
+
+ set(...args: any[]): void
+
+ slice(...args: any[]): void
+ }
+
+ export class ChaCha {
+ constructor(...args: any[])
+
+ nextBool(...args: any[]): void
+
+ nextU32(...args: any[]): void
+
+ nextU64(...args: any[]): void
+
+ update(...args: any[]): void
+ }
+
+ export class EC {
+ constructor(...args: any[])
+
+ add(...args: any[]): void
+
+ affine(...args: any[]): void
+
+ double(...args: any[]): void
+
+ eq(...args: any[]): void
+
+ fromRng(...args: any[]): void
+
+ fromRprBE(...args: any[]): void
+
+ fromRprBEM(...args: any[]): void
+
+ fromRprCompressed(...args: any[]): void
+
+ fromRprLE(...args: any[]): void
+
+ fromRprLEJM(...args: any[]): void
+
+ fromRprLEM(...args: any[]): void
+
+ fromRprUncompressed(...args: any[]): void
+
+ isZero(...args: any[]): void
+
+ mulScalar(...args: any[]): void
+
+ multiAffine(...args: any[]): void
+
+ neg(...args: any[]): void
+
+ sub(...args: any[]): void
+
+ timesScalar(...args: any[]): void
+
+ toRprBE(...args: any[]): void
+
+ toRprBEM(...args: any[]): void
+
+ toRprCompressed(...args: any[]): void
+
+ toRprLE(...args: any[]): void
+
+ toRprLEJM(...args: any[]): void
+
+ toRprLEM(...args: any[]): void
+
+ toRprUncompressed(...args: any[]): void
+
+ toString(...args: any[]): void
+ }
+
+ export class F1Field {
+ constructor(...args: any[])
+
+ e(...args: any[]): any
+ add(...args: any[]): any
+ sub(...args: any[]): any
+ neg(...args: any[]): any
+ mul(...args: any[]): any
+ mulScalar(...args: any[]): any
+ square(...args: any[]): any
+ eq(...args: any[]): any
+ neq(...args: any[]): any
+ lt(...args: any[]): any
+ gt(...args: any[]): any
+ leq(...args: any[]): any
+ geq(...args: any[]): any
+ div(...args: any[]): any
+ idiv(...args: any[]): any
+ inv(...args: any[]): any
+ mod(...args: any[]): any
+ pow(...args: any[]): any
+ exp(...args: any[]): any
+ band(...args: any[]): any
+ bor(...args: any[]): any
+ bxor(...args: any[]): any
+ bnot(...args: any[]): any
+ shl(...args: any[]): any
+ shr(...args: any[]): any
+ land(...args: any[]): any
+ lor(...args: any[]): any
+ lnot(...args: any[]): any
+ sqrt_old(...args: any[]): any
+ normalize(...args: any[]): any
+ random(...args: any[]): any
+ toString(...args: any[]): any
+ isZero(...args: any[]): any
+ fromRng(...args: any[]): any
+
+ fromRprBE(...args: any[]): void
+
+ fromRprBEM(...args: any[]): void
+
+ fromRprLE(...args: any[]): void
+
+ fromRprLEM(...args: any[]): void
+
+ toRprBE(...args: any[]): void
+
+ toRprBEM(...args: any[]): void
+
+ toRprLE(...args: any[]): void
+
+ toRprLEM(...args: any[]): void
+ }
+
+ export class F2Field {
+ constructor(...args: any[])
+
+ add(...args: any[]): void
+
+ conjugate(...args: any[]): void
+
+ copy(...args: any[]): void
+
+ div(...args: any[]): void
+
+ double(...args: any[]): void
+
+ eq(...args: any[]): void
+
+ exp(...args: any[]): void
+
+ fromRng(...args: any[]): void
+
+ fromRprBE(...args: any[]): void
+
+ fromRprBEM(...args: any[]): void
+
+ fromRprLE(...args: any[]): void
+
+ fromRprLEM(...args: any[]): void
+
+ geq(...args: any[]): void
+
+ gt(...args: any[]): void
+
+ inv(...args: any[]): void
+
+ isZero(...args: any[]): void
+
+ leq(...args: any[]): void
+
+ lt(...args: any[]): void
+
+ mul(...args: any[]): void
+
+ mulScalar(...args: any[]): void
+
+ neg(...args: any[]): void
+
+ neq(...args: any[]): void
+
+ pow(...args: any[]): void
+
+ random(...args: any[]): void
+
+ square(...args: any[]): void
+
+ sub(...args: any[]): void
+
+ toRprBE(...args: any[]): void
+
+ toRprBEM(...args: any[]): void
+
+ toRprLE(...args: any[]): void
+
+ toRprLEM(...args: any[]): void
+
+ toString(...args: any[]): void
+ }
+
+ export class F3Field {
+ constructor(...args: any[])
+
+ add(...args: any[]): void
+
+ affine(...args: any[]): void
+
+ copy(...args: any[]): void
+
+ div(...args: any[]): void
+
+ double(...args: any[]): void
+
+ eq(...args: any[]): void
+
+ exp(...args: any[]): void
+
+ fromRng(...args: any[]): void
+
+ fromRprBE(...args: any[]): void
+
+ fromRprBEM(...args: any[]): void
+
+ fromRprLE(...args: any[]): void
+
+ fromRprLEM(...args: any[]): void
+
+ geq(...args: any[]): void
+
+ gt(...args: any[]): void
+
+ inv(...args: any[]): void
+
+ isZero(...args: any[]): void
+
+ leq(...args: any[]): void
+
+ lt(...args: any[]): void
+
+ mul(...args: any[]): void
+
+ mulScalar(...args: any[]): void
+
+ neg(...args: any[]): void
+
+ neq(...args: any[]): void
+
+ pow(...args: any[]): void
+
+ random(...args: any[]): void
+
+ square(...args: any[]): void
+
+ sub(...args: any[]): void
+
+ toRprBE(...args: any[]): void
+
+ toRprBEM(...args: any[]): void
+
+ toRprLE(...args: any[]): void
+
+ toRprLEM(...args: any[]): void
+
+ toString(...args: any[]): void
+ }
+
+ export class PolField {
+ constructor(...args: any[])
+
+ add(...args: any[]): void
+
+ computeVanishingPolinomial(...args: any[]): void
+
+ div(...args: any[]): void
+
+ double(...args: any[]): void
+
+ eq(...args: any[]): void
+
+ eval(...args: any[]): void
+
+ eval2(...args: any[]): void
+
+ evaluateLagrangePolynomials(...args: any[]): void
+
+ extend(...args: any[]): void
+
+ fft(...args: any[]): void
+
+ fft2(...args: any[]): void
+
+ ifft(...args: any[]): void
+
+ ifft2(...args: any[]): void
+
+ lagrange(...args: any[]): void
+
+ log2(...args: any[]): void
+
+ mul(...args: any[]): void
+
+ mulFFT(...args: any[]): void
+
+ mulNormal(...args: any[]): void
+
+ mulScalar(...args: any[]): void
+
+ normalize(...args: any[]): void
+
+ oneRoot(...args: any[]): void
+
+ reduce(...args: any[]): void
+
+ ruffini(...args: any[]): void
+
+ scaleX(...args: any[]): void
+
+ square(...args: any[]): void
+
+ sub(...args: any[]): void
+
+ toString(...args: any[]): void
+ }
+
+ export class ZqField {
+ constructor(...args: any[])
+
+ e(...args: any[]): any
+ add(...args: any[]): any
+ sub(...args: any[]): any
+ neg(...args: any[]): any
+ mul(...args: any[]): any
+ mulScalar(...args: any[]): any
+ square(...args: any[]): any
+ eq(...args: any[]): any
+ neq(...args: any[]): any
+ lt(...args: any[]): any
+ gt(...args: any[]): any
+ leq(...args: any[]): any
+ geq(...args: any[]): any
+ div(...args: any[]): any
+ idiv(...args: any[]): any
+ inv(...args: any[]): any
+ mod(...args: any[]): any
+ pow(...args: any[]): any
+ exp(...args: any[]): any
+ band(...args: any[]): any
+ bor(...args: any[]): any
+ bxor(...args: any[]): any
+ bnot(...args: any[]): any
+ shl(...args: any[]): any
+ shr(...args: any[]): any
+ land(...args: any[]): any
+ lor(...args: any[]): any
+ lnot(...args: any[]): any
+ sqrt_old(...args: any[]): any
+ normalize(...args: any[]): any
+ random(...args: any[]): any
+ toString(...args: any[]): any
+ isZero(...args: any[]): any
+ fromRng(...args: any[]): any
+
+ fromRprBE(...args: any[]): void
+
+ fromRprBEM(...args: any[]): void
+
+ fromRprLE(...args: any[]): void
+
+ fromRprLEM(...args: any[]): void
+
+ toRprBE(...args: any[]): void
+
+ toRprBEM(...args: any[]): void
+
+ toRprLE(...args: any[]): void
+
+ toRprLEM(...args: any[]): void
+ }
+
+ export function buildBls12381(singleThread: any, plugins: any): any
+
+ export function buildBn128(singleThread: any, plugins: any): any
+
+ export function getCurveFromName(name: any, singleThread?: any, plugins?: any): any
+
+ export function getCurveFromQ(q: any, singleThread: any, plugins: any): any
+
+ export function getCurveFromR(r: any, singleThread: any, plugins: any): any
+
+ export namespace Scalar {
+ const one: any
+
+ const zero: any
+
+ function abs(a: any): any
+
+ function add(a: any, b: any): any
+
+ function band(a: any, b: any): any
+
+ function bitLength(a: any): any
+
+ function bits(n: any): any
+
+ function bor(a: any, b: any): any
+
+ function bxor(a: any, b: any): any
+
+ function div(a: any, b: any): any
+
+ function e(s: any, radix: any): any
+
+ function eq(a: any, b: any): any
+
+ function exp(a: any, b: any): any
+
+ function fromArray(a: any, radix: any): any
+
+ function fromRprBE(buff: any, o: any, n8: any): any
+
+ function fromRprLE(buff: any, o: any, n8: any): any
+
+ function fromString(s: any, radix: any): any
+
+ function geq(a: any, b: any): any
+
+ function gt(a: any, b: any): any
+
+ function isNegative(a: any): any
+
+ function isOdd(a: any): any
+
+ function isZero(a: any): any
+
+ function land(a: any, b: any): any
+
+ function leq(a: any, b: any): any
+
+ function lnot(a: any): any
+
+ function lor(a: any, b: any): any
+
+ function lt(a: any, b: any): any
+
+ function mod(a: any, b: any): any
+
+ function mul(a: any, b: any): any
+
+ function naf(n: any): any
+
+ function neg(a: any): any
+
+ function neq(a: any, b: any): any
+
+ function pow(a: any, b: any): any
+
+ function shiftLeft(a: any, n: any): any
+
+ function shiftRight(a: any, n: any): any
+
+ function shl(a: any, n: any): any
+
+ function shr(a: any, n: any): any
+
+ function square(a: any): any
+
+ function sub(a: any, b: any): any
+
+ function toArray(s: any, radix: any): any
+
+ function toLEBuff(a: any): any
+
+ function toNumber(s: any): any
+
+ function toRprBE(buff: any, o: any, e: any, n8: any): void
+
+ function toRprLE(buff: any, o: any, e: any, n8: any): void
+
+ function toString(a: any, radix: any): any
+ }
+
+ export namespace utils {
+ function array2buffer(arr: any, sG: any): any
+
+ function beBuff2int(buff: any): any
+
+ function beInt2Buff(n: any, len: any): any
+
+ function bitReverse(idx: any, bits: any): any
+
+ function buffReverseBits(buff: any, eSize: any): void
+
+ function buffer2array(buff: any, sG: any): any
+
+ function leBuff2int(buff: any): any
+
+ function leInt2Buff(n: any, len: any): any
+
+ function log2(V: any): any
+
+ function stringifyBigInts(o: any): any
+
+ function stringifyFElements(F: any, o: any): any
+
+ function unstringifyBigInts(o: any): any
+
+ function unstringifyFElements(F: any, o: any): any
+ }
+}
diff --git a/yarn.lock b/yarn.lock
index 1f534753e..0d4ead41b 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2402,6 +2402,20 @@ __metadata:
languageName: node
linkType: hard
+"@isaacs/cliui@npm:^8.0.2":
+ version: 8.0.2
+ resolution: "@isaacs/cliui@npm:8.0.2"
+ dependencies:
+ string-width: ^5.1.2
+ string-width-cjs: "npm:string-width@^4.2.0"
+ strip-ansi: ^7.0.1
+ strip-ansi-cjs: "npm:strip-ansi@^6.0.1"
+ wrap-ansi: ^8.1.0
+ wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0"
+ checksum: 4a473b9b32a7d4d3cfb7a614226e555091ff0c5a29a1734c28c72a182c2f6699b26fc6b5c2131dfd841e86b185aea714c72201d7c98c2fba5f17709333a67aeb
+ languageName: node
+ linkType: hard
+
"@istanbuljs/load-nyc-config@npm:^1.0.0":
version: 1.1.0
resolution: "@istanbuljs/load-nyc-config@npm:1.1.0"
@@ -2870,6 +2884,13 @@ __metadata:
languageName: node
linkType: hard
+"@jridgewell/sourcemap-codec@npm:^1.4.13":
+ version: 1.4.15
+ resolution: "@jridgewell/sourcemap-codec@npm:1.4.15"
+ checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8
+ languageName: node
+ linkType: hard
+
"@jridgewell/trace-mapping@npm:0.3.9":
version: 0.3.9
resolution: "@jridgewell/trace-mapping@npm:0.3.9"
@@ -3358,6 +3379,51 @@ __metadata:
languageName: node
linkType: hard
+"@pkgjs/parseargs@npm:^0.11.0":
+ version: 0.11.0
+ resolution: "@pkgjs/parseargs@npm:0.11.0"
+ checksum: 6ad6a00fc4f2f2cfc6bff76fb1d88b8ee20bc0601e18ebb01b6d4be583733a860239a521a7fbca73b612e66705078809483549d2b18f370eb346c5155c8e4a0f
+ languageName: node
+ linkType: hard
+
+"@rollup/plugin-commonjs@npm:^24.1.0":
+ version: 24.1.0
+ resolution: "@rollup/plugin-commonjs@npm:24.1.0"
+ dependencies:
+ "@rollup/pluginutils": ^5.0.1
+ commondir: ^1.0.1
+ estree-walker: ^2.0.2
+ glob: ^8.0.3
+ is-reference: 1.2.1
+ magic-string: ^0.27.0
+ peerDependencies:
+ rollup: ^2.68.0||^3.0.0
+ peerDependenciesMeta:
+ rollup:
+ optional: true
+ checksum: 42faafc9bc8e04d75c86bb50d693ebb9c5eee19bf9ab3c09780b872547d12ff5ea85cfec7da75f5176d0aa4b5233101f667f44b85b331450a7bb14c95180852e
+ languageName: node
+ linkType: hard
+
+"@rollup/plugin-node-resolve@npm:^15.0.2":
+ version: 15.2.3
+ resolution: "@rollup/plugin-node-resolve@npm:15.2.3"
+ dependencies:
+ "@rollup/pluginutils": ^5.0.1
+ "@types/resolve": 1.20.2
+ deepmerge: ^4.2.2
+ is-builtin-module: ^3.2.1
+ is-module: ^1.0.0
+ resolve: ^1.22.1
+ peerDependencies:
+ rollup: ^2.78.0||^3.0.0||^4.0.0
+ peerDependenciesMeta:
+ rollup:
+ optional: true
+ checksum: 730f32c2f8fdddff07cf0fca86a5dac7c475605fb96930197a868c066e62eb6388c557545e4f7d99b7a283411754c9fbf98944ab086b6074e04fc1292e234aa8
+ languageName: node
+ linkType: hard
+
"@rollup/plugin-typescript@npm:^8.3.0, @rollup/plugin-typescript@npm:^8.3.3":
version: 8.3.3
resolution: "@rollup/plugin-typescript@npm:8.3.3"
@@ -3375,6 +3441,18 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/plugin-virtual@npm:^3.0.2":
+ version: 3.0.2
+ resolution: "@rollup/plugin-virtual@npm:3.0.2"
+ peerDependencies:
+ rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
+ peerDependenciesMeta:
+ rollup:
+ optional: true
+ checksum: 962bc9efece57a07c328a3d093bd1a62b9b4396a88640ac79cfc04181e06b31c4b37726ca27ded71178ace27db9b0085b43c4de823378773bb44cb233ea1340e
+ languageName: node
+ linkType: hard
+
"@rollup/pluginutils@npm:^3.1.0":
version: 3.1.0
resolution: "@rollup/pluginutils@npm:3.1.0"
@@ -3398,6 +3476,106 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/pluginutils@npm:^5.0.1":
+ version: 5.0.5
+ resolution: "@rollup/pluginutils@npm:5.0.5"
+ dependencies:
+ "@types/estree": ^1.0.0
+ estree-walker: ^2.0.2
+ picomatch: ^2.3.1
+ peerDependencies:
+ rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
+ peerDependenciesMeta:
+ rollup:
+ optional: true
+ checksum: dcd4d6e3cb6047f18c465a5f2bcd29995c565f083fb6ca5505bcf2018ae0c16634fd38d99538fbb7dcef4e1b491cf4b4465f8845b5666778a925a27e9202dbab
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-android-arm-eabi@npm:4.0.2":
+ version: 4.0.2
+ resolution: "@rollup/rollup-android-arm-eabi@npm:4.0.2"
+ conditions: os=android & cpu=arm
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-android-arm64@npm:4.0.2":
+ version: 4.0.2
+ resolution: "@rollup/rollup-android-arm64@npm:4.0.2"
+ conditions: os=android & cpu=arm64
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-darwin-arm64@npm:4.0.2":
+ version: 4.0.2
+ resolution: "@rollup/rollup-darwin-arm64@npm:4.0.2"
+ conditions: os=darwin & cpu=arm64
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-darwin-x64@npm:4.0.2":
+ version: 4.0.2
+ resolution: "@rollup/rollup-darwin-x64@npm:4.0.2"
+ conditions: os=darwin & cpu=x64
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-arm-gnueabihf@npm:4.0.2":
+ version: 4.0.2
+ resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.0.2"
+ conditions: os=linux & cpu=arm
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-arm64-gnu@npm:4.0.2":
+ version: 4.0.2
+ resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.0.2"
+ conditions: os=linux & cpu=arm64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-arm64-musl@npm:4.0.2":
+ version: 4.0.2
+ resolution: "@rollup/rollup-linux-arm64-musl@npm:4.0.2"
+ conditions: os=linux & cpu=arm64 & libc=musl
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-x64-gnu@npm:4.0.2":
+ version: 4.0.2
+ resolution: "@rollup/rollup-linux-x64-gnu@npm:4.0.2"
+ conditions: os=linux & cpu=x64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-linux-x64-musl@npm:4.0.2":
+ version: 4.0.2
+ resolution: "@rollup/rollup-linux-x64-musl@npm:4.0.2"
+ conditions: os=linux & cpu=x64 & libc=musl
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-win32-arm64-msvc@npm:4.0.2":
+ version: 4.0.2
+ resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.0.2"
+ conditions: os=win32 & cpu=arm64
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-win32-ia32-msvc@npm:4.0.2":
+ version: 4.0.2
+ resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.0.2"
+ conditions: os=win32 & cpu=ia32
+ languageName: node
+ linkType: hard
+
+"@rollup/rollup-win32-x64-msvc@npm:4.0.2":
+ version: 4.0.2
+ resolution: "@rollup/rollup-win32-x64-msvc@npm:4.0.2"
+ conditions: os=win32 & cpu=x64
+ languageName: node
+ linkType: hard
+
"@scure/base@npm:~1.1.0":
version: 1.1.1
resolution: "@scure/base@npm:1.1.1"
@@ -3749,6 +3927,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/estree@npm:*, @types/estree@npm:^1.0.0":
+ version: 1.0.2
+ resolution: "@types/estree@npm:1.0.2"
+ checksum: aeedb1b2fe20cbe06f44b99b562bf9703e360bfcdf5bb3d61d248182ee1dd63500f2474e12f098ffe1f5ac3202b43b3e18ec99902d9328d5374f5512fa077e45
+ languageName: node
+ linkType: hard
+
"@types/estree@npm:0.0.39":
version: 0.0.39
resolution: "@types/estree@npm:0.0.39"
@@ -3984,6 +4169,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/resolve@npm:1.20.2":
+ version: 1.20.2
+ resolution: "@types/resolve@npm:1.20.2"
+ checksum: 61c2cad2499ffc8eab36e3b773945d337d848d3ac6b7b0a87c805ba814bc838ef2f262fc0f109bfd8d2e0898ff8bd80ad1025f9ff64f1f71d3d4294c9f14e5f6
+ languageName: node
+ linkType: hard
+
"@types/responselike@npm:^1.0.0":
version: 1.0.0
resolution: "@types/responselike@npm:1.0.0"
@@ -4179,6 +4371,35 @@ __metadata:
languageName: node
linkType: hard
+"@yarn-tool/resolve-package@npm:^1.0.40":
+ version: 1.0.47
+ resolution: "@yarn-tool/resolve-package@npm:1.0.47"
+ dependencies:
+ pkg-dir: < 6 >= 5
+ tslib: ^2
+ upath2: ^3.1.13
+ checksum: 86208b0881c9b262ee9545cc99deec7764f268d4b2fd82b4555d9ef3ec8cdc00a27c81e2c4fb01377052648353d40a515530caf319431637e1146bdd948947a6
+ languageName: node
+ linkType: hard
+
+"@zk-kit/groth16@workspace:packages/groth16":
+ version: 0.0.0-use.local
+ resolution: "@zk-kit/groth16@workspace:packages/groth16"
+ dependencies:
+ "@iden3/binfileutils": 0.0.11
+ "@rollup/plugin-commonjs": ^24.1.0
+ "@rollup/plugin-node-resolve": ^15.0.2
+ "@rollup/plugin-virtual": ^3.0.2
+ circom_runtime: 0.1.24
+ fastfile: 0.0.20
+ ffjavascript: 0.2.60
+ rimraf: ^5.0.5
+ rollup: ^4.0.2
+ rollup-plugin-cleanup: ^3.2.1
+ rollup-plugin-typescript2: ^0.31.2
+ languageName: unknown
+ linkType: soft
+
"@zk-kit/incremental-merkle-tree@npm:^0.4.1":
version: 0.4.3
resolution: "@zk-kit/incremental-merkle-tree@npm:0.4.3"
@@ -4596,6 +4817,13 @@ __metadata:
languageName: node
linkType: hard
+"ansi-styles@npm:^6.1.0":
+ version: 6.2.1
+ resolution: "ansi-styles@npm:6.2.1"
+ checksum: ef940f2f0ced1a6347398da88a91da7930c33ecac3c77b72c5905f8b8fe402c52e6fde304ff5347f616e27a742da3f1dc76de98f6866c69251ad0b07a66776d9
+ languageName: node
+ linkType: hard
+
"antlr4@npm:4.7.1":
version: 4.7.1
resolution: "antlr4@npm:4.7.1"
@@ -5662,6 +5890,13 @@ __metadata:
languageName: node
linkType: hard
+"builtin-modules@npm:^3.3.0":
+ version: 3.3.0
+ resolution: "builtin-modules@npm:3.3.0"
+ checksum: db021755d7ed8be048f25668fe2117620861ef6703ea2c65ed2779c9e3636d5c3b82325bd912244293959ff3ae303afa3471f6a15bf5060c103e4cc3a839749d
+ languageName: node
+ linkType: hard
+
"busboy@npm:^1.6.0":
version: 1.6.0
resolution: "busboy@npm:1.6.0"
@@ -6199,6 +6434,17 @@ __metadata:
languageName: node
linkType: hard
+"circom_runtime@npm:0.1.24":
+ version: 0.1.24
+ resolution: "circom_runtime@npm:0.1.24"
+ dependencies:
+ ffjavascript: 0.2.60
+ bin:
+ calcwit: calcwit.js
+ checksum: 0654649ed64ace5562cec025648422970df885e79048b7942e283ef50f43142673acfd752ac2851917a81c43d4d42d37f5fdfc8df71d59ee81b873c19ea81a31
+ languageName: node
+ linkType: hard
+
"circom_runtime@npm:0.1.8":
version: 0.1.8
resolution: "circom_runtime@npm:0.1.8"
@@ -8341,7 +8587,7 @@ __metadata:
languageName: node
linkType: hard
-"estree-walker@npm:^2.0.1":
+"estree-walker@npm:^2.0.1, estree-walker@npm:^2.0.2":
version: 2.0.2
resolution: "estree-walker@npm:2.0.2"
checksum: 6151e6f9828abe2259e57f5fd3761335bb0d2ebd76dc1a01048ccee22fabcfef3c0859300f6d83ff0d1927849368775ec5a6d265dde2f6de5a1be1721cd94efc
@@ -9057,6 +9303,17 @@ __metadata:
languageName: node
linkType: hard
+"ffjavascript@npm:0.2.60":
+ version: 0.2.60
+ resolution: "ffjavascript@npm:0.2.60"
+ dependencies:
+ wasmbuilder: 0.0.16
+ wasmcurves: 0.2.2
+ web-worker: ^1.2.0
+ checksum: 5dbd597ee108373af1ba1877757a08b47db4bcd7b3b043b260d4475a0b1125454de00fb214224f85d9e6e6a6c0a1cfabd1ba9a2b68279b99c581404266e78138
+ languageName: node
+ linkType: hard
+
"ffjavascript@npm:^0.2.30, ffjavascript@npm:^0.2.35, ffjavascript@npm:^0.2.38":
version: 0.2.55
resolution: "ffjavascript@npm:0.2.55"
@@ -9344,6 +9601,16 @@ __metadata:
languageName: node
linkType: hard
+"foreground-child@npm:^3.1.0":
+ version: 3.1.1
+ resolution: "foreground-child@npm:3.1.1"
+ dependencies:
+ cross-spawn: ^7.0.0
+ signal-exit: ^4.0.1
+ checksum: 139d270bc82dc9e6f8bc045fe2aae4001dc2472157044fdfad376d0a3457f77857fa883c1c8b21b491c6caade9a926a4bed3d3d2e8d3c9202b151a4cbbd0bcd5
+ languageName: node
+ linkType: hard
+
"forever-agent@npm:~0.6.1":
version: 0.6.1
resolution: "forever-agent@npm:0.6.1"
@@ -9839,6 +10106,21 @@ __metadata:
languageName: node
linkType: hard
+"glob@npm:^10.3.7":
+ version: 10.3.10
+ resolution: "glob@npm:10.3.10"
+ dependencies:
+ foreground-child: ^3.1.0
+ jackspeak: ^2.3.5
+ minimatch: ^9.0.1
+ minipass: ^5.0.0 || ^6.0.2 || ^7.0.0
+ path-scurry: ^1.10.1
+ bin:
+ glob: dist/esm/bin.mjs
+ checksum: 4f2fe2511e157b5a3f525a54092169a5f92405f24d2aed3142f4411df328baca13059f4182f1db1bf933e2c69c0bd89e57ae87edd8950cba8c7ccbe84f721cf3
+ languageName: node
+ linkType: hard
+
"glob@npm:^5.0.15":
version: 5.0.15
resolution: "glob@npm:5.0.15"
@@ -9879,6 +10161,19 @@ __metadata:
languageName: node
linkType: hard
+"glob@npm:^8.0.3":
+ version: 8.1.0
+ resolution: "glob@npm:8.1.0"
+ dependencies:
+ fs.realpath: ^1.0.0
+ inflight: ^1.0.4
+ inherits: 2
+ minimatch: ^5.0.1
+ once: ^1.3.0
+ checksum: 92fbea3221a7d12075f26f0227abac435de868dd0736a17170663783296d0dd8d3d532a5672b4488a439bf5d7fb85cdd07c11185d6cd39184f0385cbdfb86a47
+ languageName: node
+ linkType: hard
+
"global-dirs@npm:^0.1.1":
version: 0.1.1
resolution: "global-dirs@npm:0.1.1"
@@ -11098,6 +11393,15 @@ __metadata:
languageName: node
linkType: hard
+"is-builtin-module@npm:^3.2.1":
+ version: 3.2.1
+ resolution: "is-builtin-module@npm:3.2.1"
+ dependencies:
+ builtin-modules: ^3.3.0
+ checksum: e8f0ffc19a98240bda9c7ada84d846486365af88d14616e737d280d378695c8c448a621dcafc8332dbf0fcd0a17b0763b845400709963fa9151ddffece90ae88
+ languageName: node
+ linkType: hard
+
"is-callable@npm:^1.1.3, is-callable@npm:^1.1.4, is-callable@npm:^1.2.4":
version: 1.2.4
resolution: "is-callable@npm:1.2.4"
@@ -11123,6 +11427,15 @@ __metadata:
languageName: node
linkType: hard
+"is-core-module@npm:^2.13.0":
+ version: 2.13.0
+ resolution: "is-core-module@npm:2.13.0"
+ dependencies:
+ has: ^1.0.3
+ checksum: 053ab101fb390bfeb2333360fd131387bed54e476b26860dc7f5a700bbf34a0ec4454f7c8c4d43e8a0030957e4b3db6e16d35e1890ea6fb654c833095e040355
+ languageName: node
+ linkType: hard
+
"is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1, is-core-module@npm:^2.9.0":
version: 2.9.0
resolution: "is-core-module@npm:2.9.0"
@@ -11287,6 +11600,13 @@ __metadata:
languageName: node
linkType: hard
+"is-module@npm:^1.0.0":
+ version: 1.0.0
+ resolution: "is-module@npm:1.0.0"
+ checksum: 8cd5390730c7976fb4e8546dd0b38865ee6f7bacfa08dfbb2cc07219606755f0b01709d9361e01f13009bbbd8099fa2927a8ed665118a6105d66e40f1b838c3f
+ languageName: node
+ linkType: hard
+
"is-nan@npm:^1.2.1":
version: 1.3.2
resolution: "is-nan@npm:1.3.2"
@@ -11373,6 +11693,15 @@ __metadata:
languageName: node
linkType: hard
+"is-reference@npm:1.2.1":
+ version: 1.2.1
+ resolution: "is-reference@npm:1.2.1"
+ dependencies:
+ "@types/estree": "*"
+ checksum: e7b48149f8abda2c10849ea51965904d6a714193d68942ad74e30522231045acf06cbfae5a4be2702fede5d232e61bf50b3183acdc056e6e3afe07fcf4f4b2bc
+ languageName: node
+ linkType: hard
+
"is-regex@npm:^1.1.4":
version: 1.1.4
resolution: "is-regex@npm:1.1.4"
@@ -11623,6 +11952,19 @@ __metadata:
languageName: node
linkType: hard
+"jackspeak@npm:^2.3.5":
+ version: 2.3.6
+ resolution: "jackspeak@npm:2.3.6"
+ dependencies:
+ "@isaacs/cliui": ^8.0.2
+ "@pkgjs/parseargs": ^0.11.0
+ dependenciesMeta:
+ "@pkgjs/parseargs":
+ optional: true
+ checksum: 57d43ad11eadc98cdfe7496612f6bbb5255ea69fe51ea431162db302c2a11011642f50cfad57288bd0aea78384a0612b16e131944ad8ecd09d619041c8531b54
+ languageName: node
+ linkType: hard
+
"jake@npm:^10.8.5":
version: 10.8.5
resolution: "jake@npm:10.8.5"
@@ -13449,6 +13791,13 @@ __metadata:
languageName: node
linkType: hard
+"lru-cache@npm:^9.1.1 || ^10.0.0":
+ version: 10.0.1
+ resolution: "lru-cache@npm:10.0.1"
+ checksum: 06f8d0e1ceabd76bb6f644a26dbb0b4c471b79c7b514c13c6856113879b3bf369eb7b497dad4ff2b7e2636db202412394865b33c332100876d838ad1372f0181
+ languageName: node
+ linkType: hard
+
"lru_map@npm:^0.3.3":
version: 0.3.3
resolution: "lru_map@npm:0.3.3"
@@ -13479,6 +13828,15 @@ __metadata:
languageName: node
linkType: hard
+"magic-string@npm:^0.27.0":
+ version: 0.27.0
+ resolution: "magic-string@npm:0.27.0"
+ dependencies:
+ "@jridgewell/sourcemap-codec": ^1.4.13
+ checksum: 273faaa50baadb7a2df6e442eac34ad611304fc08fe16e24fe2e472fd944bfcb73ffb50d2dc972dc04e92784222002af46868cb9698b1be181c81830fd95a13e
+ languageName: node
+ linkType: hard
+
"make-dir@npm:^3.0.0, make-dir@npm:^3.0.2":
version: 3.1.0
resolution: "make-dir@npm:3.1.0"
@@ -13863,7 +14221,7 @@ __metadata:
languageName: node
linkType: hard
-"minimatch@npm:^9.0.3":
+"minimatch@npm:^9.0.1, minimatch@npm:^9.0.3":
version: 9.0.3
resolution: "minimatch@npm:9.0.3"
dependencies:
@@ -13974,6 +14332,13 @@ __metadata:
languageName: node
linkType: hard
+"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0":
+ version: 7.0.4
+ resolution: "minipass@npm:7.0.4"
+ checksum: 87585e258b9488caf2e7acea242fd7856bbe9a2c84a7807643513a338d66f368c7d518200ad7b70a508664d408aa000517647b2930c259a8b1f9f0984f344a21
+ languageName: node
+ linkType: hard
+
"minizlib@npm:^1.3.3":
version: 1.3.3
resolution: "minizlib@npm:1.3.3"
@@ -15164,6 +15529,15 @@ __metadata:
languageName: node
linkType: hard
+"path-is-network-drive@npm:^1.0.20":
+ version: 1.0.20
+ resolution: "path-is-network-drive@npm:1.0.20"
+ dependencies:
+ tslib: ^2
+ checksum: 4281a5b79cc6aa2837d25643a579d7abfb2a6c57fcb640a45c82abb9d459e9f04cd194fe8efb146d9835fcd1758e32e16c2826a34e59d63764af46928ebaa9c2
+ languageName: node
+ linkType: hard
+
"path-key@npm:^2.0.0, path-key@npm:^2.0.1":
version: 2.0.1
resolution: "path-key@npm:2.0.1"
@@ -15185,6 +15559,25 @@ __metadata:
languageName: node
linkType: hard
+"path-scurry@npm:^1.10.1":
+ version: 1.10.1
+ resolution: "path-scurry@npm:1.10.1"
+ dependencies:
+ lru-cache: ^9.1.1 || ^10.0.0
+ minipass: ^5.0.0 || ^6.0.2 || ^7.0.0
+ checksum: e2557cff3a8fb8bc07afdd6ab163a92587884f9969b05bbbaf6fe7379348bfb09af9ed292af12ed32398b15fb443e81692047b786d1eeb6d898a51eb17ed7d90
+ languageName: node
+ linkType: hard
+
+"path-strip-sep@npm:^1.0.17":
+ version: 1.0.17
+ resolution: "path-strip-sep@npm:1.0.17"
+ dependencies:
+ tslib: ^2
+ checksum: 79b257bd208b196476109cc82dbc60fc8b62fa77f1d9d7a248f9d87e086805c53854def6e5f3ff8cc9616d87827c3c4a005984809cbd7f41bdd91d3bc7bb888a
+ languageName: node
+ linkType: hard
+
"path-to-regexp@npm:0.1.7":
version: 0.1.7
resolution: "path-to-regexp@npm:0.1.7"
@@ -15270,6 +15663,15 @@ __metadata:
languageName: node
linkType: hard
+"pkg-dir@npm:< 6 >= 5":
+ version: 5.0.0
+ resolution: "pkg-dir@npm:5.0.0"
+ dependencies:
+ find-up: ^5.0.0
+ checksum: b167bb8dac7bbf22b1d5e30ec223e6b064b84b63010c9d49384619a36734caf95ed23ad23d4f9bd975e8e8082b60a83395f43a89bb192df53a7c25a38ecb57d9
+ languageName: node
+ linkType: hard
+
"pkg-dir@npm:^4.1.0, pkg-dir@npm:^4.2.0":
version: 4.2.0
resolution: "pkg-dir@npm:4.2.0"
@@ -16103,6 +16505,19 @@ __metadata:
languageName: node
linkType: hard
+"resolve@npm:^1.22.1":
+ version: 1.22.8
+ resolution: "resolve@npm:1.22.8"
+ dependencies:
+ is-core-module: ^2.13.0
+ path-parse: ^1.0.7
+ supports-preserve-symlinks-flag: ^1.0.0
+ bin:
+ resolve: bin/resolve
+ checksum: f8a26958aa572c9b064562750b52131a37c29d072478ea32e129063e2da7f83e31f7f11e7087a18225a8561cfe8d2f0df9dbea7c9d331a897571c0a2527dbb4c
+ languageName: node
+ linkType: hard
+
"resolve@patch:resolve@1.1.x#~builtin":
version: 1.1.7
resolution: "resolve@patch:resolve@npm%3A1.1.7#~builtin::version=1.1.7&hash=07638b"
@@ -16132,6 +16547,19 @@ __metadata:
languageName: node
linkType: hard
+"resolve@patch:resolve@^1.22.1#~builtin":
+ version: 1.22.8
+ resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=07638b"
+ dependencies:
+ is-core-module: ^2.13.0
+ path-parse: ^1.0.7
+ supports-preserve-symlinks-flag: ^1.0.0
+ bin:
+ resolve: bin/resolve
+ checksum: 5479b7d431cacd5185f8db64bfcb7286ae5e31eb299f4c4f404ad8aa6098b77599563ac4257cb2c37a42f59dfc06a1bec2bcf283bb448f319e37f0feb9a09847
+ languageName: node
+ linkType: hard
+
"responselike@npm:^1.0.2":
version: 1.0.2
resolution: "responselike@npm:1.0.2"
@@ -16222,6 +16650,17 @@ __metadata:
languageName: node
linkType: hard
+"rimraf@npm:^5.0.5":
+ version: 5.0.5
+ resolution: "rimraf@npm:5.0.5"
+ dependencies:
+ glob: ^10.3.7
+ bin:
+ rimraf: dist/esm/bin.mjs
+ checksum: d66eef829b2e23b16445f34e73d75c7b7cf4cbc8834b04720def1c8f298eb0753c3d76df77325fad79d0a2c60470525d95f89c2475283ad985fd7441c32732d1
+ languageName: node
+ linkType: hard
+
"ripemd160@npm:^2.0.0, ripemd160@npm:^2.0.1":
version: 2.0.2
resolution: "ripemd160@npm:2.0.2"
@@ -16269,6 +16708,23 @@ __metadata:
languageName: node
linkType: hard
+"rollup-plugin-typescript2@npm:^0.31.2":
+ version: 0.31.2
+ resolution: "rollup-plugin-typescript2@npm:0.31.2"
+ dependencies:
+ "@rollup/pluginutils": ^4.1.2
+ "@yarn-tool/resolve-package": ^1.0.40
+ find-cache-dir: ^3.3.2
+ fs-extra: ^10.0.0
+ resolve: ^1.20.0
+ tslib: ^2.3.1
+ peerDependencies:
+ rollup: ">=1.26.3"
+ typescript: ">=2.4.0"
+ checksum: ceebc686195f8140ee64b89cbd3a284bda50435081bea8f55f404ea293c02ec9787e9147e33f8e078b2c4772d9f198e66f900f54ca77ccda63db9ec2511db665
+ languageName: node
+ linkType: hard
+
"rollup-plugin-typescript2@npm:^0.32.1":
version: 0.32.1
resolution: "rollup-plugin-typescript2@npm:0.32.1"
@@ -16308,6 +16764,56 @@ __metadata:
languageName: node
linkType: hard
+"rollup@npm:^4.0.2":
+ version: 4.0.2
+ resolution: "rollup@npm:4.0.2"
+ dependencies:
+ "@rollup/rollup-android-arm-eabi": 4.0.2
+ "@rollup/rollup-android-arm64": 4.0.2
+ "@rollup/rollup-darwin-arm64": 4.0.2
+ "@rollup/rollup-darwin-x64": 4.0.2
+ "@rollup/rollup-linux-arm-gnueabihf": 4.0.2
+ "@rollup/rollup-linux-arm64-gnu": 4.0.2
+ "@rollup/rollup-linux-arm64-musl": 4.0.2
+ "@rollup/rollup-linux-x64-gnu": 4.0.2
+ "@rollup/rollup-linux-x64-musl": 4.0.2
+ "@rollup/rollup-win32-arm64-msvc": 4.0.2
+ "@rollup/rollup-win32-ia32-msvc": 4.0.2
+ "@rollup/rollup-win32-x64-msvc": 4.0.2
+ fsevents: ~2.3.2
+ dependenciesMeta:
+ "@rollup/rollup-android-arm-eabi":
+ optional: true
+ "@rollup/rollup-android-arm64":
+ optional: true
+ "@rollup/rollup-darwin-arm64":
+ optional: true
+ "@rollup/rollup-darwin-x64":
+ optional: true
+ "@rollup/rollup-linux-arm-gnueabihf":
+ optional: true
+ "@rollup/rollup-linux-arm64-gnu":
+ optional: true
+ "@rollup/rollup-linux-arm64-musl":
+ optional: true
+ "@rollup/rollup-linux-x64-gnu":
+ optional: true
+ "@rollup/rollup-linux-x64-musl":
+ optional: true
+ "@rollup/rollup-win32-arm64-msvc":
+ optional: true
+ "@rollup/rollup-win32-ia32-msvc":
+ optional: true
+ "@rollup/rollup-win32-x64-msvc":
+ optional: true
+ fsevents:
+ optional: true
+ bin:
+ rollup: dist/bin/rollup
+ checksum: 29ada628da893964b238466053e81750a9e0339e2a933fe6b100d0de2cb68c493f6cc4af558f5bbdafdfcd085e7d8d06da025776ef54fdd46447c3244053fb41
+ languageName: node
+ linkType: hard
+
"rsvp@npm:^4.8.4":
version: 4.8.5
resolution: "rsvp@npm:4.8.5"
@@ -16746,6 +17252,13 @@ __metadata:
languageName: node
linkType: hard
+"signal-exit@npm:^4.0.1":
+ version: 4.1.0
+ resolution: "signal-exit@npm:4.1.0"
+ checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549
+ languageName: node
+ linkType: hard
+
"simple-concat@npm:^1.0.0":
version: 1.0.1
resolution: "simple-concat@npm:1.0.1"
@@ -17271,7 +17784,7 @@ __metadata:
languageName: node
linkType: hard
-"string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3":
+"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3":
version: 4.2.3
resolution: "string-width@npm:4.2.3"
dependencies:
@@ -17303,7 +17816,7 @@ __metadata:
languageName: node
linkType: hard
-"string-width@npm:^5.0.0":
+"string-width@npm:^5.0.0, string-width@npm:^5.0.1, string-width@npm:^5.1.2":
version: 5.1.2
resolution: "string-width@npm:5.1.2"
dependencies:
@@ -17387,6 +17900,15 @@ __metadata:
languageName: node
linkType: hard
+"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1":
+ version: 6.0.1
+ resolution: "strip-ansi@npm:6.0.1"
+ dependencies:
+ ansi-regex: ^5.0.1
+ checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c
+ languageName: node
+ linkType: hard
+
"strip-ansi@npm:^4.0.0":
version: 4.0.0
resolution: "strip-ansi@npm:4.0.0"
@@ -17405,15 +17927,6 @@ __metadata:
languageName: node
linkType: hard
-"strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1":
- version: 6.0.1
- resolution: "strip-ansi@npm:6.0.1"
- dependencies:
- ansi-regex: ^5.0.1
- checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c
- languageName: node
- linkType: hard
-
"strip-ansi@npm:^7.0.1":
version: 7.0.1
resolution: "strip-ansi@npm:7.0.1"
@@ -18044,6 +18557,13 @@ __metadata:
languageName: node
linkType: hard
+"tslib@npm:^2":
+ version: 2.6.2
+ resolution: "tslib@npm:2.6.2"
+ checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad
+ languageName: node
+ linkType: hard
+
"tslib@npm:^2.1.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0":
version: 2.4.0
resolution: "tslib@npm:2.4.0"
@@ -18432,6 +18952,18 @@ __metadata:
languageName: node
linkType: hard
+"upath2@npm:^3.1.13":
+ version: 3.1.19
+ resolution: "upath2@npm:3.1.19"
+ dependencies:
+ "@types/node": "*"
+ path-is-network-drive: ^1.0.20
+ path-strip-sep: ^1.0.17
+ tslib: ^2
+ checksum: 043e48f161af8bc246512e19695366959a7ce617ccf4b89527b7736b90c275eef9dc20a82eea091021c18deed31c5ab34f0cfc5924917fa2babfc6bcecd5786e
+ languageName: node
+ linkType: hard
+
"update-browserslist-db@npm:^1.0.0":
version: 1.0.4
resolution: "update-browserslist-db@npm:1.0.4"
@@ -18810,6 +19342,15 @@ __metadata:
languageName: node
linkType: hard
+"wasmcurves@npm:0.2.2":
+ version: 0.2.2
+ resolution: "wasmcurves@npm:0.2.2"
+ dependencies:
+ wasmbuilder: 0.0.16
+ checksum: 95ca8afe3816862f16d4f8f4cbed4a4fb522be03a41af3cf7d65429bcac9ff4ccbc6e02762dd14933f0e5903cfb93d15cf31fc4acc953f3fcdb31190eba969e8
+ languageName: node
+ linkType: hard
+
"web-worker@npm:^1.0.0, web-worker@npm:^1.2.0":
version: 1.2.0
resolution: "web-worker@npm:1.2.0"
@@ -19297,6 +19838,17 @@ __metadata:
languageName: node
linkType: hard
+"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0":
+ version: 7.0.0
+ resolution: "wrap-ansi@npm:7.0.0"
+ dependencies:
+ ansi-styles: ^4.0.0
+ string-width: ^4.1.0
+ strip-ansi: ^6.0.0
+ checksum: a790b846fd4505de962ba728a21aaeda189b8ee1c7568ca5e817d85930e06ef8d1689d49dbf0e881e8ef84436af3a88bc49115c2e2788d841ff1b8b5b51a608b
+ languageName: node
+ linkType: hard
+
"wrap-ansi@npm:^5.1.0":
version: 5.1.0
resolution: "wrap-ansi@npm:5.1.0"
@@ -19319,14 +19871,14 @@ __metadata:
languageName: node
linkType: hard
-"wrap-ansi@npm:^7.0.0":
- version: 7.0.0
- resolution: "wrap-ansi@npm:7.0.0"
+"wrap-ansi@npm:^8.1.0":
+ version: 8.1.0
+ resolution: "wrap-ansi@npm:8.1.0"
dependencies:
- ansi-styles: ^4.0.0
- string-width: ^4.1.0
- strip-ansi: ^6.0.0
- checksum: a790b846fd4505de962ba728a21aaeda189b8ee1c7568ca5e817d85930e06ef8d1689d49dbf0e881e8ef84436af3a88bc49115c2e2788d841ff1b8b5b51a608b
+ ansi-styles: ^6.1.0
+ string-width: ^5.0.1
+ strip-ansi: ^7.0.1
+ checksum: 371733296dc2d616900ce15a0049dca0ef67597d6394c57347ba334393599e800bab03c41d4d45221b6bc967b8c453ec3ae4749eff3894202d16800fdfe0e238
languageName: node
linkType: hard