mirror of
https://github.com/status-im/c-kzg-4844.git
synced 2025-02-17 04:27:08 +00:00
gitignore dist
This commit is contained in:
parent
8683fac75a
commit
1d1254e380
11
bindings/node.js/dist/dts/kzg.d.ts
vendored
11
bindings/node.js/dist/dts/kzg.d.ts
vendored
@ -1,11 +0,0 @@
|
||||
export declare type BLSFieldElement = Uint8Array;
|
||||
export declare type KZGProof = Uint8Array;
|
||||
export declare type KZGCommitment = Uint8Array;
|
||||
export declare type Blob = Uint8Array;
|
||||
export declare const FIELD_ELEMENTS_PER_BLOB: number;
|
||||
export declare const BYTES_PER_FIELD_ELEMENT: number;
|
||||
export declare function loadTrustedSetup(filePath: string): void;
|
||||
export declare function freeTrustedSetup(): void;
|
||||
export declare function blobToKzgCommitment(blob: Blob): KZGCommitment;
|
||||
export declare function computeAggregateKzgProof(blobs: Blob[]): KZGProof;
|
||||
export declare function verifyAggregateKzgProof(blobs: Blob[], expectedKzgCommitments: KZGCommitment[], kzgAggregatedProof: KZGProof): boolean;
|
1
bindings/node.js/dist/dts/test.d.ts
vendored
1
bindings/node.js/dist/dts/test.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
44
bindings/node.js/dist/kzg.js
vendored
44
bindings/node.js/dist/kzg.js
vendored
@ -1,44 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* The public interface of this module exposes the functions as specified by
|
||||
* https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/polynomial-commitments.md#kzg
|
||||
*/
|
||||
const kzg = require("./kzg.node");
|
||||
const FIELD_ELEMENTS_PER_BLOB = kzg.FIELD_ELEMENTS_PER_BLOB;
|
||||
const BYTES_PER_FIELD_ELEMENT = kzg.BYTES_PER_FIELD_ELEMENT;
|
||||
// Stored as internal state
|
||||
let setupHandle;
|
||||
function requireSetupHandle() {
|
||||
if (!setupHandle) {
|
||||
throw new Error("You must call loadTrustedSetup to initialize KZG.");
|
||||
}
|
||||
return setupHandle;
|
||||
}
|
||||
function loadTrustedSetup(filePath) {
|
||||
if (setupHandle) {
|
||||
throw new Error("Call freeTrustedSetup before loading a new trusted setup.");
|
||||
}
|
||||
setupHandle = kzg.loadTrustedSetup(filePath);
|
||||
}
|
||||
function freeTrustedSetup() {
|
||||
kzg.freeTrustedSetup(requireSetupHandle());
|
||||
setupHandle = undefined;
|
||||
}
|
||||
function blobToKzgCommitment(blob) {
|
||||
return kzg.blobToKzgCommitment(blob, requireSetupHandle());
|
||||
}
|
||||
function computeAggregateKzgProof(blobs) {
|
||||
return kzg.computeAggregateKzgProof(blobs, requireSetupHandle());
|
||||
}
|
||||
function verifyAggregateKzgProof(blobs, expectedKzgCommitments, kzgAggregatedProof) {
|
||||
return kzg.verifyAggregateKzgProof(blobs, expectedKzgCommitments, kzgAggregatedProof, requireSetupHandle());
|
||||
}
|
||||
|
||||
exports.BYTES_PER_FIELD_ELEMENT = BYTES_PER_FIELD_ELEMENT;
|
||||
exports.FIELD_ELEMENTS_PER_BLOB = FIELD_ELEMENTS_PER_BLOB;
|
||||
exports.blobToKzgCommitment = blobToKzgCommitment;
|
||||
exports.computeAggregateKzgProof = computeAggregateKzgProof;
|
||||
exports.freeTrustedSetup = freeTrustedSetup;
|
||||
exports.loadTrustedSetup = loadTrustedSetup;
|
||||
exports.verifyAggregateKzgProof = verifyAggregateKzgProof;
|
Loading…
x
Reference in New Issue
Block a user