Comparing version 0.3.0 to 0.3.1
@@ -8,2 +8,6 @@ # Changelog | ||
## 0.3.1 - 2024-03-14 | ||
- Add optional trusted setup parameter to `loadKZG`, PR [#9](https://github.com/ethereumjs/kzg-wasm/pull/9) | ||
## 0.3.0 - 2024-03-14 | ||
@@ -10,0 +14,0 @@ |
@@ -10,7 +10,7 @@ export type TrustedSetup = { | ||
* | ||
* @param setupPath Optional setup, otherwise official KZG setup from the KZG ceremony is used | ||
* @param trustedSetup Optional trusted setup, otherwise official KZG setup from the KZG ceremony is used | ||
* | ||
* @returns object - the KZG methods required for all 4844 related operations | ||
*/ | ||
export declare const loadKZG: () => Promise<{ | ||
export declare const loadKZG: (trustedSetup?: TrustedSetup) => Promise<{ | ||
loadTrustedSetup: (trustedSetup?: TrustedSetup) => number; | ||
@@ -17,0 +17,0 @@ freeTrustedSetup: () => void; |
@@ -10,7 +10,7 @@ "use strict"; | ||
* | ||
* @param setupPath Optional setup, otherwise official KZG setup from the KZG ceremony is used | ||
* @param trustedSetup Optional trusted setup, otherwise official KZG setup from the KZG ceremony is used | ||
* | ||
* @returns object - the KZG methods required for all 4844 related operations | ||
*/ | ||
const loadKZG = async () => { | ||
const loadKZG = async (trustedSetup = trustedSetup_js_1.default) => { | ||
const module = await (0, kzg_js_1.default)(); | ||
@@ -29,5 +29,2 @@ const loadTrustedSetupWasm = module.cwrap('load_trusted_setup_from_wasm', 'number', ['string', 'number', 'string', 'number']); | ||
const loadTrustedSetup = (trustedSetup = trustedSetup_js_1.default) => { | ||
if (trustedSetup === undefined) { | ||
trustedSetup = trustedSetup_js_1.default; | ||
} | ||
return loadTrustedSetupWasm(trustedSetup.g1, trustedSetup.n1, trustedSetup.g2, trustedSetup.n2); | ||
@@ -95,2 +92,3 @@ }; | ||
}; | ||
loadTrustedSetup(trustedSetup); | ||
return { | ||
@@ -97,0 +95,0 @@ loadTrustedSetup, freeTrustedSetup, blobToKzgCommitment, computeBlobKzgProof, verifyBlobKzgProofBatch, verifyKzgProof, verifyBlobKzgProof |
@@ -10,7 +10,7 @@ export type TrustedSetup = { | ||
* | ||
* @param setupPath Optional setup, otherwise official KZG setup from the KZG ceremony is used | ||
* @param trustedSetup Optional trusted setup, otherwise official KZG setup from the KZG ceremony is used | ||
* | ||
* @returns object - the KZG methods required for all 4844 related operations | ||
*/ | ||
export declare const loadKZG: () => Promise<{ | ||
export declare const loadKZG: (trustedSetup?: TrustedSetup) => Promise<{ | ||
loadTrustedSetup: (trustedSetup?: TrustedSetup) => number; | ||
@@ -17,0 +17,0 @@ freeTrustedSetup: () => void; |
@@ -7,7 +7,7 @@ import { hexToBytes } from './util.js'; | ||
* | ||
* @param setupPath Optional setup, otherwise official KZG setup from the KZG ceremony is used | ||
* @param trustedSetup Optional trusted setup, otherwise official KZG setup from the KZG ceremony is used | ||
* | ||
* @returns object - the KZG methods required for all 4844 related operations | ||
*/ | ||
export const loadKZG = async () => { | ||
export const loadKZG = async (trustedSetup = mainnetTrustedSetup) => { | ||
const module = await kzgWasm(); | ||
@@ -26,5 +26,2 @@ const loadTrustedSetupWasm = module.cwrap('load_trusted_setup_from_wasm', 'number', ['string', 'number', 'string', 'number']); | ||
const loadTrustedSetup = (trustedSetup = mainnetTrustedSetup) => { | ||
if (trustedSetup === undefined) { | ||
trustedSetup = mainnetTrustedSetup; | ||
} | ||
return loadTrustedSetupWasm(trustedSetup.g1, trustedSetup.n1, trustedSetup.g2, trustedSetup.n2); | ||
@@ -92,2 +89,3 @@ }; | ||
}; | ||
loadTrustedSetup(trustedSetup); | ||
return { | ||
@@ -94,0 +92,0 @@ loadTrustedSetup, freeTrustedSetup, blobToKzgCommitment, computeBlobKzgProof, verifyBlobKzgProofBatch, verifyKzgProof, verifyBlobKzgProof |
{ | ||
"name": "kzg-wasm", | ||
"version": "0.3.0", | ||
"description": "", | ||
"version": "0.3.1", | ||
"description": "a WASM compilation of c-kzg-4844", | ||
"scripts": { | ||
@@ -6,0 +6,0 @@ "build": "npm run build:ts && npm run transpileCJS && npm run fixRequire", |
@@ -13,7 +13,7 @@ import { hexToBytes } from './util.js' | ||
* | ||
* @param setupPath Optional setup, otherwise official KZG setup from the KZG ceremony is used | ||
* @param trustedSetup Optional trusted setup, otherwise official KZG setup from the KZG ceremony is used | ||
* | ||
* @returns object - the KZG methods required for all 4844 related operations | ||
*/ | ||
export const loadKZG = async () => { | ||
export const loadKZG = async (trustedSetup: TrustedSetup = mainnetTrustedSetup) => { | ||
const module = await kzgWasm() | ||
@@ -34,5 +34,2 @@ | ||
const loadTrustedSetup = (trustedSetup: TrustedSetup = mainnetTrustedSetup) => { | ||
if (trustedSetup === undefined) { | ||
trustedSetup = mainnetTrustedSetup | ||
} | ||
return loadTrustedSetupWasm(trustedSetup.g1, trustedSetup.n1, trustedSetup.g2, trustedSetup.n2) | ||
@@ -104,2 +101,4 @@ } | ||
loadTrustedSetup(trustedSetup) | ||
return { | ||
@@ -106,0 +105,0 @@ loadTrustedSetup, freeTrustedSetup, blobToKzgCommitment, computeBlobKzgProof, verifyBlobKzgProofBatch, verifyKzgProof, verifyBlobKzgProof |
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 not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1012921
12
4459