Skip to content

Commit

Permalink
Run npm run bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
dannywillems committed Jul 11, 2023
1 parent 1f509b7 commit 586c3bb
Show file tree
Hide file tree
Showing 11 changed files with 257 additions and 208 deletions.
136 changes: 71 additions & 65 deletions compiled/node_bindings/plonk_wasm.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -546,19 +546,37 @@ module.exports.caml_vesta_affine_deep_copy = function(x) {
return WasmGVesta.__wrap(ret);
};

let cachedUint32Memory0 = null;

function getUint32Memory0() {
if (cachedUint32Memory0 === null || cachedUint32Memory0.buffer !== wasm.memory.buffer) {
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
}
return cachedUint32Memory0;
}

function passArray32ToWasm0(arg, malloc) {
const ptr = malloc(arg.length * 4);
getUint32Memory0().set(arg, ptr / 4);
WASM_VECTOR_LEN = arg.length;
return ptr;
}
/**
* @param {WasmFpGateVector} gates
* @param {number} public_
* @param {Uint32Array} runtime_table_cfgs
* @param {number} prev_challenges
* @param {WasmFpSrs} srs
* @returns {WasmPastaFpPlonkIndex}
*/
module.exports.caml_pasta_fp_plonk_index_create = function(gates, public_, prev_challenges, srs) {
module.exports.caml_pasta_fp_plonk_index_create = function(gates, public_, runtime_table_cfgs, prev_challenges, srs) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
_assertClass(gates, WasmFpGateVector);
const ptr0 = passArray32ToWasm0(runtime_table_cfgs, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
_assertClass(srs, WasmFpSrs);
wasm.caml_pasta_fp_plonk_index_create(retptr, gates.ptr, public_, prev_challenges, srs.ptr);
wasm.caml_pasta_fp_plonk_index_create(retptr, gates.ptr, public_, ptr0, len0, prev_challenges, srs.ptr);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
Expand Down Expand Up @@ -689,59 +707,22 @@ module.exports.caml_pasta_fp_plonk_index_serialize = function(index) {
}
};

/**
* @param {Uint8Array} state
* @returns {Uint8Array}
*/
module.exports.caml_pasta_fp_poseidon_block_cipher = function(state) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.caml_pasta_fp_poseidon_block_cipher(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var v1 = getArrayU8FromWasm0(r0, r1).slice();
wasm.__wbindgen_free(r0, r1 * 1);
return v1;
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
};

/**
* @param {Uint8Array} state
* @returns {Uint8Array}
*/
module.exports.caml_pasta_fq_poseidon_block_cipher = function(state) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.caml_pasta_fq_poseidon_block_cipher(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var v1 = getArrayU8FromWasm0(r0, r1).slice();
wasm.__wbindgen_free(r0, r1 * 1);
return v1;
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
};

/**
* @param {WasmFqGateVector} gates
* @param {number} public_
* @param {Uint32Array} runtime_table_cfgs
* @param {number} prev_challenges
* @param {WasmFqSrs} srs
* @returns {WasmPastaFqPlonkIndex}
*/
module.exports.caml_pasta_fq_plonk_index_create = function(gates, public_, prev_challenges, srs) {
module.exports.caml_pasta_fq_plonk_index_create = function(gates, public_, runtime_table_cfgs, prev_challenges, srs) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
_assertClass(gates, WasmFqGateVector);
const ptr0 = passArray32ToWasm0(runtime_table_cfgs, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
_assertClass(srs, WasmFqSrs);
wasm.caml_pasta_fq_plonk_index_create(retptr, gates.ptr, public_, prev_challenges, srs.ptr);
wasm.caml_pasta_fq_plonk_index_create(retptr, gates.ptr, public_, ptr0, len0, prev_challenges, srs.ptr);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
Expand All @@ -760,7 +741,7 @@ module.exports.caml_pasta_fq_plonk_index_create = function(gates, public_, prev_
*/
module.exports.caml_pasta_fq_plonk_index_max_degree = function(index) {
_assertClass(index, WasmPastaFqPlonkIndex);
const ret = wasm.caml_pasta_fq_plonk_index_max_degree(index.ptr);
const ret = wasm.caml_pasta_fp_plonk_index_max_degree(index.ptr);
return ret;
};

Expand All @@ -770,7 +751,7 @@ module.exports.caml_pasta_fq_plonk_index_max_degree = function(index) {
*/
module.exports.caml_pasta_fq_plonk_index_public_inputs = function(index) {
_assertClass(index, WasmPastaFqPlonkIndex);
const ret = wasm.caml_pasta_fq_plonk_index_public_inputs(index.ptr);
const ret = wasm.caml_pasta_fp_plonk_index_public_inputs(index.ptr);
return ret;
};

Expand All @@ -780,7 +761,7 @@ module.exports.caml_pasta_fq_plonk_index_public_inputs = function(index) {
*/
module.exports.caml_pasta_fq_plonk_index_domain_d1_size = function(index) {
_assertClass(index, WasmPastaFqPlonkIndex);
const ret = wasm.caml_pasta_fq_plonk_index_domain_d1_size(index.ptr);
const ret = wasm.caml_pasta_fp_plonk_index_domain_d1_size(index.ptr);
return ret;
};

Expand All @@ -790,7 +771,7 @@ module.exports.caml_pasta_fq_plonk_index_domain_d1_size = function(index) {
*/
module.exports.caml_pasta_fq_plonk_index_domain_d4_size = function(index) {
_assertClass(index, WasmPastaFqPlonkIndex);
const ret = wasm.caml_pasta_fq_plonk_index_domain_d4_size(index.ptr);
const ret = wasm.caml_pasta_fp_plonk_index_domain_d4_size(index.ptr);
return ret;
};

Expand All @@ -800,7 +781,7 @@ module.exports.caml_pasta_fq_plonk_index_domain_d4_size = function(index) {
*/
module.exports.caml_pasta_fq_plonk_index_domain_d8_size = function(index) {
_assertClass(index, WasmPastaFqPlonkIndex);
const ret = wasm.caml_pasta_fq_plonk_index_domain_d8_size(index.ptr);
const ret = wasm.caml_pasta_fp_plonk_index_domain_d8_size(index.ptr);
return ret;
};

Expand Down Expand Up @@ -869,6 +850,46 @@ module.exports.caml_pasta_fq_plonk_index_serialize = function(index) {
}
};

/**
* @param {Uint8Array} state
* @returns {Uint8Array}
*/
module.exports.caml_pasta_fp_poseidon_block_cipher = function(state) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.caml_pasta_fp_poseidon_block_cipher(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var v1 = getArrayU8FromWasm0(r0, r1).slice();
wasm.__wbindgen_free(r0, r1 * 1);
return v1;
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
};

/**
* @param {Uint8Array} state
* @returns {Uint8Array}
*/
module.exports.caml_pasta_fq_poseidon_block_cipher = function(state) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.caml_pasta_fq_poseidon_block_cipher(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var v1 = getArrayU8FromWasm0(r0, r1).slice();
wasm.__wbindgen_free(r0, r1 * 1);
return v1;
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
};

/**
* @returns {WasmFpGateVector}
*/
Expand Down Expand Up @@ -1190,21 +1211,6 @@ module.exports.caml_fp_srs_b_poly_commitment = function(srs, chals) {
}
};

let cachedUint32Memory0 = null;

function getUint32Memory0() {
if (cachedUint32Memory0 === null || cachedUint32Memory0.buffer !== wasm.memory.buffer) {
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
}
return cachedUint32Memory0;
}

function passArray32ToWasm0(arg, malloc) {
const ptr = malloc(arg.length * 4);
getUint32Memory0().set(arg, ptr / 4);
WASM_VECTOR_LEN = arg.length;
return ptr;
}
/**
* @param {WasmFpSrs} srs
* @param {Uint32Array} comms
Expand Down Expand Up @@ -7400,7 +7406,7 @@ class WasmPastaFqLookupTable {
constructor(id, data) {
_assertClass(data, WasmVecVecFq);
var ptr0 = data.__destroy_into_raw();
const ret = wasm.wasmpastafqlookuptable_new(id, ptr0);
const ret = wasm.wasmpastafplookuptable_new(id, ptr0);
return WasmPastaFqLookupTable.__wrap(ret);
}
}
Expand Down
26 changes: 14 additions & 12 deletions compiled/node_bindings/plonk_wasm.d.cts
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,12 @@ export function caml_vesta_affine_deep_copy(x: WasmGVesta): WasmGVesta;
/**
* @param {WasmFpGateVector} gates
* @param {number} public_
* @param {Uint32Array} runtime_table_cfgs
* @param {number} prev_challenges
* @param {WasmFpSrs} srs
* @returns {WasmPastaFpPlonkIndex}
*/
export function caml_pasta_fp_plonk_index_create(gates: WasmFpGateVector, public_: number, prev_challenges: number, srs: WasmFpSrs): WasmPastaFpPlonkIndex;
export function caml_pasta_fp_plonk_index_create(gates: WasmFpGateVector, public_: number, runtime_table_cfgs: Uint32Array, prev_challenges: number, srs: WasmFpSrs): WasmPastaFpPlonkIndex;
/**
* @param {WasmPastaFpPlonkIndex} index
* @returns {number}
Expand Down Expand Up @@ -200,23 +201,14 @@ export function caml_pasta_fp_plonk_index_write(append: boolean | undefined, ind
*/
export function caml_pasta_fp_plonk_index_serialize(index: WasmPastaFpPlonkIndex): string;
/**
* @param {Uint8Array} state
* @returns {Uint8Array}
*/
export function caml_pasta_fp_poseidon_block_cipher(state: Uint8Array): Uint8Array;
/**
* @param {Uint8Array} state
* @returns {Uint8Array}
*/
export function caml_pasta_fq_poseidon_block_cipher(state: Uint8Array): Uint8Array;
/**
* @param {WasmFqGateVector} gates
* @param {number} public_
* @param {Uint32Array} runtime_table_cfgs
* @param {number} prev_challenges
* @param {WasmFqSrs} srs
* @returns {WasmPastaFqPlonkIndex}
*/
export function caml_pasta_fq_plonk_index_create(gates: WasmFqGateVector, public_: number, prev_challenges: number, srs: WasmFqSrs): WasmPastaFqPlonkIndex;
export function caml_pasta_fq_plonk_index_create(gates: WasmFqGateVector, public_: number, runtime_table_cfgs: Uint32Array, prev_challenges: number, srs: WasmFqSrs): WasmPastaFqPlonkIndex;
/**
* @param {WasmPastaFqPlonkIndex} index
* @returns {number}
Expand Down Expand Up @@ -261,6 +253,16 @@ export function caml_pasta_fq_plonk_index_write(append: boolean | undefined, ind
*/
export function caml_pasta_fq_plonk_index_serialize(index: WasmPastaFqPlonkIndex): string;
/**
* @param {Uint8Array} state
* @returns {Uint8Array}
*/
export function caml_pasta_fp_poseidon_block_cipher(state: Uint8Array): Uint8Array;
/**
* @param {Uint8Array} state
* @returns {Uint8Array}
*/
export function caml_pasta_fq_poseidon_block_cipher(state: Uint8Array): Uint8Array;
/**
* @returns {WasmFpGateVector}
*/
export function caml_pasta_fp_plonk_gate_vector_create(): WasmFpGateVector;
Expand Down
Binary file modified compiled/node_bindings/plonk_wasm_bg.wasm
Binary file not shown.
30 changes: 15 additions & 15 deletions compiled/node_bindings/plonk_wasm_bg.wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function __wbg_wasmpastafplookuptable_free(a: number): void;
export function wasmpastafplookuptable_new(a: number, b: number): number;
export function __wbg_wasmpastafpruntimetablecfg_free(a: number): void;
export function wasmpastafpruntimetablecfg_new(a: number, b: number, c: number): number;
export function caml_pasta_fp_plonk_index_create(a: number, b: number, c: number, d: number, e: number): void;
export function caml_pasta_fp_plonk_index_create(a: number, b: number, c: number, d: number, e: number, f: number, g: number): void;
export function caml_pasta_fp_plonk_index_max_degree(a: number): number;
export function caml_pasta_fp_plonk_index_public_inputs(a: number): number;
export function caml_pasta_fp_plonk_index_domain_d1_size(a: number): number;
Expand All @@ -58,8 +58,22 @@ export function caml_pasta_fp_plonk_index_domain_d8_size(a: number): number;
export function caml_pasta_fp_plonk_index_read(a: number, b: number, c: number, d: number, e: number, f: number): void;
export function caml_pasta_fp_plonk_index_write(a: number, b: number, c: number, d: number, e: number): void;
export function caml_pasta_fp_plonk_index_serialize(a: number, b: number): void;
export function __wbg_wasmpastafqplonkindex_free(a: number): void;
export function wasmpastafqruntimetablecfg_new(a: number, b: number, c: number): number;
export function caml_pasta_fq_plonk_index_create(a: number, b: number, c: number, d: number, e: number, f: number, g: number): void;
export function caml_pasta_fq_plonk_index_read(a: number, b: number, c: number, d: number, e: number, f: number): void;
export function caml_pasta_fq_plonk_index_write(a: number, b: number, c: number, d: number, e: number): void;
export function caml_pasta_fq_plonk_index_serialize(a: number, b: number): void;
export function caml_pasta_fp_poseidon_block_cipher(a: number, b: number, c: number): void;
export function caml_pasta_fq_poseidon_block_cipher(a: number, b: number, c: number): void;
export function caml_pasta_fq_plonk_index_domain_d1_size(a: number): number;
export function caml_pasta_fq_plonk_index_public_inputs(a: number): number;
export function __wbg_wasmpastafqlookuptable_free(a: number): void;
export function __wbg_wasmpastafqruntimetablecfg_free(a: number): void;
export function caml_pasta_fq_plonk_index_max_degree(a: number): number;
export function caml_pasta_fq_plonk_index_domain_d4_size(a: number): number;
export function caml_pasta_fq_plonk_index_domain_d8_size(a: number): number;
export function wasmpastafqlookuptable_new(a: number, b: number): number;
export function __wbg_wasmgatewires_free(a: number): void;
export function __wbg_get_wasmgatewires_0(a: number): number;
export function __wbg_set_wasmgatewires_0(a: number, b: number): void;
Expand All @@ -76,20 +90,6 @@ export function __wbg_set_wasmgatewires_5(a: number, b: number): void;
export function __wbg_get_wasmgatewires_6(a: number): number;
export function __wbg_set_wasmgatewires_6(a: number, b: number): void;
export function wasmgatewires_new(a: number, b: number, c: number, d: number, e: number, f: number, g: number): number;
export function __wbg_wasmpastafqplonkindex_free(a: number): void;
export function __wbg_wasmpastafqlookuptable_free(a: number): void;
export function wasmpastafqlookuptable_new(a: number, b: number): number;
export function __wbg_wasmpastafqruntimetablecfg_free(a: number): void;
export function wasmpastafqruntimetablecfg_new(a: number, b: number, c: number): number;
export function caml_pasta_fq_plonk_index_create(a: number, b: number, c: number, d: number, e: number): void;
export function caml_pasta_fq_plonk_index_max_degree(a: number): number;
export function caml_pasta_fq_plonk_index_public_inputs(a: number): number;
export function caml_pasta_fq_plonk_index_domain_d1_size(a: number): number;
export function caml_pasta_fq_plonk_index_domain_d4_size(a: number): number;
export function caml_pasta_fq_plonk_index_domain_d8_size(a: number): number;
export function caml_pasta_fq_plonk_index_read(a: number, b: number, c: number, d: number, e: number, f: number): void;
export function caml_pasta_fq_plonk_index_write(a: number, b: number, c: number, d: number, e: number): void;
export function caml_pasta_fq_plonk_index_serialize(a: number, b: number): void;
export function __wbg_wasmfpgatevector_free(a: number): void;
export function __wbg_wasmfpgate_free(a: number): void;
export function __wbg_get_wasmfpgate_typ(a: number): number;
Expand Down
Loading

0 comments on commit 586c3bb

Please sign in to comment.