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

@noir-lang/backend_barretenberg

Package Overview
Dependencies
Maintainers
1
Versions
263
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@noir-lang/backend_barretenberg - npm Package Compare versions

Comparing version 0.31.0-96ef87b.nightly to 0.31.0-b59a29e.nightly

12

lib/cjs/backend.d.ts
import { Backend, CompiledCircuit, ProofData, VerifierBackend } from '@noir-lang/types';
import { BackendOptions } from './types.js';
import { type Barretenberg } from '@aztec/bb.js';
export declare class BarretenbergVerifierBackend implements VerifierBackend {
export declare class BarretenbergBackend implements Backend, VerifierBackend {
protected options: BackendOptions;

@@ -12,8 +12,2 @@ protected api: Barretenberg;

instantiate(): Promise<void>;
/** @description Verifies a proof */
verifyProof(proofData: ProofData): Promise<boolean>;
getVerificationKey(): Promise<Uint8Array>;
destroy(): Promise<void>;
}
export declare class BarretenbergBackend extends BarretenbergVerifierBackend implements Backend {
/** @description Generates a proof */

@@ -42,2 +36,6 @@ generateProof(compressedWitness: Uint8Array): Promise<ProofData>;

}>;
/** @description Verifies a proof */
verifyProof(proofData: ProofData): Promise<boolean>;
getVerificationKey(): Promise<Uint8Array>;
destroy(): Promise<void>;
}

@@ -26,3 +26,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.BarretenbergBackend = exports.BarretenbergVerifierBackend = void 0;
exports.BarretenbergBackend = void 0;
const fflate_1 = require("fflate");

@@ -35,3 +35,3 @@ const serialize_js_1 = require("./serialize.js");

const numBytesInProofWithoutPublicInputs = 2144;
class BarretenbergVerifierBackend {
class BarretenbergBackend {
options;

@@ -78,23 +78,2 @@ // These type assertions are used so that we don't

}
/** @description Verifies a proof */
async verifyProof(proofData) {
const proof = (0, verifier_js_1.reconstructProofWithPublicInputs)(proofData);
await this.instantiate();
await this.api.acirInitVerificationKey(this.acirComposer);
return await this.api.acirVerifyProof(this.acirComposer, proof);
}
async getVerificationKey() {
await this.instantiate();
await this.api.acirInitVerificationKey(this.acirComposer);
return await this.api.acirGetVerificationKey(this.acirComposer);
}
async destroy() {
if (!this.api) {
return;
}
await this.api.destroy();
}
}
exports.BarretenbergVerifierBackend = BarretenbergVerifierBackend;
class BarretenbergBackend extends BarretenbergVerifierBackend {
/** @description Generates a proof */

@@ -141,3 +120,21 @@ async generateProof(compressedWitness) {

}
/** @description Verifies a proof */
async verifyProof(proofData) {
const proof = (0, verifier_js_1.reconstructProofWithPublicInputs)(proofData);
await this.instantiate();
await this.api.acirInitVerificationKey(this.acirComposer);
return await this.api.acirVerifyProof(this.acirComposer, proof);
}
async getVerificationKey() {
await this.instantiate();
await this.api.acirInitVerificationKey(this.acirComposer);
return await this.api.acirGetVerificationKey(this.acirComposer);
}
async destroy() {
if (!this.api) {
return;
}
await this.api.destroy();
}
}
exports.BarretenbergBackend = BarretenbergBackend;
import { Backend, CompiledCircuit, ProofData, VerifierBackend } from '@noir-lang/types';
import { BackendOptions } from './types.js';
import { type Barretenberg } from '@aztec/bb.js';
export declare class BarretenbergVerifierBackend implements VerifierBackend {
export declare class BarretenbergBackend implements Backend, VerifierBackend {
protected options: BackendOptions;

@@ -12,8 +12,2 @@ protected api: Barretenberg;

instantiate(): Promise<void>;
/** @description Verifies a proof */
verifyProof(proofData: ProofData): Promise<boolean>;
getVerificationKey(): Promise<Uint8Array>;
destroy(): Promise<void>;
}
export declare class BarretenbergBackend extends BarretenbergVerifierBackend implements Backend {
/** @description Generates a proof */

@@ -42,2 +36,6 @@ generateProof(compressedWitness: Uint8Array): Promise<ProofData>;

}>;
/** @description Verifies a proof */
verifyProof(proofData: ProofData): Promise<boolean>;
getVerificationKey(): Promise<Uint8Array>;
destroy(): Promise<void>;
}

@@ -8,3 +8,3 @@ import { decompressSync as gunzip } from 'fflate';

const numBytesInProofWithoutPublicInputs = 2144;
export class BarretenbergVerifierBackend {
export class BarretenbergBackend {
options;

@@ -51,22 +51,2 @@ // These type assertions are used so that we don't

}
/** @description Verifies a proof */
async verifyProof(proofData) {
const proof = reconstructProofWithPublicInputs(proofData);
await this.instantiate();
await this.api.acirInitVerificationKey(this.acirComposer);
return await this.api.acirVerifyProof(this.acirComposer, proof);
}
async getVerificationKey() {
await this.instantiate();
await this.api.acirInitVerificationKey(this.acirComposer);
return await this.api.acirGetVerificationKey(this.acirComposer);
}
async destroy() {
if (!this.api) {
return;
}
await this.api.destroy();
}
}
export class BarretenbergBackend extends BarretenbergVerifierBackend {
/** @description Generates a proof */

@@ -113,2 +93,20 @@ async generateProof(compressedWitness) {

}
/** @description Verifies a proof */
async verifyProof(proofData) {
const proof = reconstructProofWithPublicInputs(proofData);
await this.instantiate();
await this.api.acirInitVerificationKey(this.acirComposer);
return await this.api.acirVerifyProof(this.acirComposer, proof);
}
async getVerificationKey() {
await this.instantiate();
await this.api.acirInitVerificationKey(this.acirComposer);
return await this.api.acirGetVerificationKey(this.acirComposer);
}
async destroy() {
if (!this.api) {
return;
}
await this.api.destroy();
}
}

@@ -6,3 +6,3 @@ {

],
"version": "0.31.0-96ef87b.nightly",
"version": "0.31.0-b59a29e.nightly",
"packageManager": "yarn@3.5.1",

@@ -45,4 +45,4 @@ "license": "(MIT OR Apache-2.0)",

"dependencies": {
"@aztec/bb.js": "0.43.0",
"@noir-lang/types": "0.31.0-96ef87b.nightly",
"@aztec/bb.js": "0.46.1",
"@noir-lang/types": "0.31.0-b59a29e.nightly",
"fflate": "^0.8.0"

@@ -49,0 +49,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