Socket
Socket
Sign inDemoInstall

r1csfile

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

r1csfile - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

.eslintrc.js

32

doc/r1cs_bin_format.md
# Binary format for R1CS
---
eip:
title: r1cs binary format
author: Jordi Baylina <jordi@baylina.cat>
discussions-to:
status: draft
type: Standards Track
category: ERC
created: 2019-09-24
requires:
---
## Simple Summary

@@ -481,3 +469,3 @@

┏━━━━━━━━━━┓
┃ 72316377 ┃ Magic
┃ 72316373 ┃ Magic
┣━━━━━━━━━━┫

@@ -493,5 +481,5 @@ ┃ 01000000 ┃ Version

┃ 20000000 ┃ Field Size
┣━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┣━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ 010000f0 93f5e143 9170b979 48e83328 5d588181 b64550b8 29a031e1 724e6430 ┃
┣━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┣━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┃ 07000000 ┃ # of wires

@@ -510,3 +498,3 @@ ┣━━━━━━━━━━┫

┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓
┃ 02000000 ┃ 88200000 00000000 ┃ SectionType: Constraints
┃ 02000000 ┃ 88020000 00000000 ┃ SectionType: Constraints
┗━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━┛

@@ -518,3 +506,3 @@ ┏━━━━━━━━━━┓ Constraint 0: (3w_5 + 8w_6) * (2w_0 + 20w_2 + 12w_3) - (5w_0 + 7w_2) = 0

┣━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ 06000000 ┃ 01000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ┃
┃ 06000000 ┃ 08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ┃
┗━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

@@ -526,3 +514,3 @@ ┏━━━━━━━━━━┓

┣━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ 02000000 ┃ 01140000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ┃
┃ 02000000 ┃ 14000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ┃
┣━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫

@@ -602,3 +590,3 @@ ┃ 03000000 ┃ 0C000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ┃

````
72316377
72316373
01000000

@@ -615,9 +603,9 @@ 03000000

03000000
02000000 88200000 00000000
02000000 88020000 00000000
02000000
05000000 03000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
06000000 01000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
06000000 08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03000000
00000000 02000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
02000000 01140000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
02000000 14000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03000000 0C000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

@@ -624,0 +612,0 @@ 02000000

{
"name": "r1csfile",
"version": "0.0.1",
"version": "0.0.2",
"description": "r1cs file format parser",

@@ -29,3 +29,9 @@ "main": "index.js",

},
"homepage": "https://github.com/iden3/r1csfile#readme"
"homepage": "https://github.com/iden3/r1csfile#readme",
"dependencies": {
"big-integer": "^1.6.48"
},
"devDependencies": {
"eslint": "^6.8.0"
}
}

@@ -56,6 +56,6 @@

res.nWires = await readU32();
res.nPubOuts = await readU32();
res.nPubIns = await readU32();
res.nPrvIns = await readU32();
res.nVars = await readU32();
res.nOutputs = await readU32();
res.nPubInputs = await readU32();
res.nPrvInputs = await readU32();
res.nLabels = await readU64();

@@ -84,3 +84,3 @@ res.nConstraints = await readU32();

res.map = [];
for (let i=0; i<res.nLabels; i++) {
for (let i=0; i<res.nVars; i++) {
const idx = await readU64();

@@ -107,3 +107,3 @@ res.map.push(idx);

const b = Buffer.allocUnsafe(8);
await fd.read(b, 0, 4, p);
await fd.read(b, 0, 8, p);

@@ -123,3 +123,3 @@ p+=8;

for (let i=0; i<n32; i++) {
arr[n32-1-i] = b.readUInt32LL(i*4);
arr[n32-1-i] = b.readUInt32LE(i*4);
}

@@ -126,0 +126,0 @@

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