Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.15 to 0.0.16

7

package.json

@@ -8,3 +8,3 @@ {

},
"version": "0.0.15",
"version": "0.0.16",
"description": "r1cs file format parser",

@@ -39,4 +39,5 @@ "main": "./build/main.cjs",

"dependencies": {
"fastfile": "0.0.16",
"ffjavascript": "0.2.4"
"@iden3/bigarray": "0.0.2",
"fastfile": "0.0.18",
"ffjavascript": "0.2.22"
},

@@ -43,0 +44,0 @@ "devDependencies": {

import {Scalar, ZqField} from "ffjavascript";
import * as fastFile from "fastfile";
import BigArray from "@iden3/bigarray";
async function readBinFile(fileName, type, maxVersion) {
const fd = await fastFile.readExisting(fileName, 1<<20, 1<<22);
const fd = await fastFile.readExisting(fileName, 1<<27, 1<<29);

@@ -84,3 +85,3 @@ const b = await fd.read(4);

export async function load(fileName, loadConstraints, loadMap) {
export async function load(fileName, loadConstraints, loadMap, logger) {

@@ -93,4 +94,9 @@ const {fd, sections} = await readBinFile(fileName, "r1cs", 1);

await startReadUniqueSection(fd, sections, 2);
res.constraints = [];
if (res.nConstraints>1<<20) {
res.constraints = new BigArray();
} else {
res.constraints = [];
}
for (let i=0; i<res.nConstraints; i++) {
if ((logger)&&(i%10000 == 0)) logger.info(`Loading constraints: ${i}/${res.nConstraints}`);
const c = await readConstraint();

@@ -106,4 +112,7 @@ res.constraints.push(c);

await startReadUniqueSection(fd, sections, 3);
res.map = [];
if (res.nVars>1<<20) {
res.map = new BigArray();
} else {
res.map = [];
}
for (let i=0; i<res.nVars; i++) {

@@ -131,5 +140,7 @@ const idx = await fd.readULE64();

const nIdx = await fd.readULE32();
const buff = await fd.read( (4+res.n8)*nIdx );
const buffV = new DataView(buff.buffer);
for (let i=0; i<nIdx; i++) {
const idx = await fd.readULE32();
const val = res.Fr.e(await readBigInt(fd, res.n8));
const idx = buffV.getUint32(i*(4+res.n8), true);
const val = res.Fr.fromRprLE(buff, i*(4+res.n8)+4);
lc[idx] = val;

@@ -136,0 +147,0 @@ }

Sorry, the diff of this file is not supported yet

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