Socket
Socket
Sign inDemoInstall

snarkjs

Package Overview
Dependencies
Maintainers
1
Versions
135
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snarkjs - npm Package Compare versions

Comparing version 0.6.9 to 0.6.10

src/cmds/wtns_check_cmd.js

18

cli.js

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

import * as fflonkCmd from "./src/cmds/fflonk_cmds.js";
import * as wtnsCmd from "./src/cmds/wtns_cmds.js";
import * as wtns from "./src/wtns.js";

@@ -178,2 +179,8 @@ import * as curves from "./src/curves.js";

{
cmd: "wtns check [circuit.r1cs] [[witness.wtns]",
description: "Check if a specific witness of a circuit fullfills the r1cs constraints",
alias: ["wchk"],
action: wtnsCheck
},
{
cmd: "zkey contribute <circuit_old.zkey> <circuit_new.zkey>",

@@ -477,3 +484,14 @@ description: "creates a zkey file with a new contribution",

// wtns export json [witness.wtns] [witness.json]
// -get|g -set|s -trigger|t
async function wtnsCheck(params, options) {
const r1csFilename = params[0] || "circuit.r1cs";
const wtnsFilename = params[1] || "witness.wtns";
if (options.verbose) Logger.setLogLevel("DEBUG");
return await wtnsCmd.wtnsCheckCmd(r1csFilename, wtnsFilename, logger);
}
/*

@@ -480,0 +498,0 @@ // zksnark setup [circuit.r1cs] [circuit.zkey] [verification_key.json]

1

main.js

@@ -7,3 +7,4 @@

export * as wtns from "./src/wtns.js";
export * as wtnsCmds from "./src/cmds/wtns_cmds.js";
export * as zKey from "./src/zkey.js";
export * as plonk from "./src/plonk.js";

2

package.json
{
"name": "snarkjs",
"type": "module",
"version": "0.6.9",
"version": "0.6.10",
"description": "zkSNARKs implementation in JavaScript",

@@ -6,0 +6,0 @@ "main": "./build/main.cjs",

@@ -324,2 +324,9 @@

We can check if the generated witness complies with the `r1cs` file with the following command:
```sh
snarkjs wtns check circuit.r1cs witness.wtns
```
### 15. Setup

@@ -326,0 +333,0 @@

@@ -115,2 +115,6 @@ import * as snarkjs from "../main.js";

it ("checks witness complies with r1cs", async () => {
await snarkjs.wtnsCmds.wtnsCheckCmd(path.join("test", "circuit", "circuit.r1cs"), wtns);
});
it ("groth16 proof", async () => {

@@ -117,0 +121,0 @@ const res = await snarkjs.groth16.prove(zkey_final, wtns);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc