Skip to content

Commit 464b918

Browse files
committed
jsoo: remove serde workaround for wasm/napi as we are advancing in exposing all the intermediate types
1 parent 6189fa7 commit 464b918

File tree

3 files changed

+24
-27
lines changed

3 files changed

+24
-27
lines changed

src/lib/crypto/kimchi_bindings/js/native/header-d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
// This file gets auto-included in the generated plonk-napi types to supplement
55
// external pointer types.
66

7-
type NapiGVesta = {};
8-
type NapiGPallas = {};
9-
type NapiPastaFpPlonkIndex = {};
10-
type NapiPastaFqPlonkIndex = {};
11-
type NapiPastaFp = {};
12-
type NapiPastaFq = {};
13-
type NapiLookupInfo = {};
7+
type WasmGVesta = {};
8+
type WasmGPallas = {};
9+
type WasmPastaFp = {};
10+
type WasmPastaFq = {};
11+
type WasmLookupInfo = {};
1412
type WasmPastaFpPlonkIndex = {};
1513
type WasmPastaFqPlonkIndex = {};
1614
type Proof = {}
17-
type NapiVector<T> = {};
18-
type NapiFlatVector<T> = {};
15+
type WasmVector<T> = {};
16+
type WasmFlatVector<T> = {};
1917
type WasmVecVecFp = {};
2018
type WasmVecVecFq = {};
19+
type WasmFpSrs = {};
20+
type WasmFqSrs = {};
2121
type Self = {};
2222

2323
// Header section end

src/lib/crypto/kimchi_bindings/js/native/native-overrides/prover-index.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function caml_pasta_fq_plonk_index_domain_d8_size(prover_index) {
106106

107107

108108
// Provides: caml_pasta_fp_plonk_index_create
109-
// Requires: plonk_wasm, free_on_finalize, tsRustConversionNative
109+
// Requires: plonk_wasm, tsRustConversionNative
110110
var caml_pasta_fp_plonk_index_create = function (
111111
gates,
112112
public_inputs,
@@ -121,10 +121,10 @@ var caml_pasta_fp_plonk_index_create = function (
121121
var wasm_runtime_table_cfgs = tsRustConversionNative.fp.runtimeTableCfgsToRust(
122122
caml_runtime_table_cfgs
123123
);
124-
console.time("conversion")
124+
console.time("conversion plonk index create")
125125
var gate_vec = plonk_wasm.caml_pasta_fp_plonk_gate_vector_from_bytes(gates.serialize());
126126
var urs_ser = plonk_wasm.caml_fp_srs_from_bytes_external(urs.serialize())
127-
console.timeEnd("conversion")
127+
console.timeEnd("conversion plonk index create")
128128

129129
console.time("index_create")
130130
var t = plonk_wasm.caml_pasta_fp_plonk_index_create(
@@ -138,11 +138,7 @@ var caml_pasta_fp_plonk_index_create = function (
138138
);
139139
console.timeEnd("index_create");
140140

141-
console.time("finalize_conversion")
142-
var wasm_t = plonk_wasm.WasmPastaFpPlonkIndex.deserialize(plonk_wasm.prover_index_fp_to_bytes(t))
143-
console.timeEnd("finalize_conversion")
144-
145-
return free_on_finalize(wasm_t);
141+
return plonk_wasm.prover_index_fp_to_bytes(t);
146142
};
147143

148144
// Provides: caml_pasta_fp_plonk_index_create_bytecode
@@ -198,7 +194,7 @@ var caml_pasta_fp_plonk_index_write = function (append, t, path) {
198194
};
199195

200196
// Provides: caml_pasta_fq_plonk_index_create
201-
// Requires: plonk_wasm, free_on_finalize, tsRustConversionNative
197+
// Requires: plonk_wasm, tsRustConversionNative
202198
var caml_pasta_fq_plonk_index_create = function (
203199
gates,
204200
public_inputs,
@@ -208,16 +204,20 @@ var caml_pasta_fq_plonk_index_create = function (
208204
urs,
209205
lazy_mode
210206
) {
207+
console.log("anais: 1");
211208
var wasm_lookup_tables =
212209
tsRustConversionNative.fq.lookupTablesToRust(caml_lookup_tables);
210+
console.log("anais: 2");
213211
var wasm_runtime_table_cfgs = tsRustConversionNative.fq.runtimeTableCfgsToRust(
214212
caml_runtime_table_cfgs
215213
);
214+
console.log("anais: 3");
216215

217216
console.time("conversion")
218217
var gate_vec = plonk_wasm.caml_pasta_fq_plonk_gate_vector_from_bytes(gates.serialize());
219218
var urs_ser = plonk_wasm.caml_fq_srs_from_bytes_external(urs.serialize())
220219
console.timeEnd("conversion")
220+
console.log("anais: 4");
221221

222222
console.time("index_create")
223223
var t = plonk_wasm.caml_pasta_fq_plonk_index_create(
@@ -231,11 +231,7 @@ var caml_pasta_fq_plonk_index_create = function (
231231
);
232232
console.timeEnd("index_create");
233233

234-
console.time("finalize_conversion")
235-
var wasm_t = plonk_wasm.WasmPastaFqPlonkIndex.deserialize(plonk_wasm.prover_index_fq_to_bytes(t))
236-
console.timeEnd("finalize_conversion")
237-
238-
return free_on_finalize(wasm_t);
234+
return plonk_wasm.prover_index_fq_to_bytes(t);
239235
};
240236

241237
// Provides: caml_pasta_fq_plonk_index_create_bytecode

src/lib/crypto/kimchi_bindings/js/node_js/node_backend.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var plonk_wasm = (function() {
1818
"caml_pasta_fp_poseidon_block_cipher",
1919
"caml_pasta_fq_poseidon_block_cipher",
2020
"caml_pasta_fp_plonk_proof_create",
21+
"caml_pasta_fp_plonk_verifier_index_create",
2122
"caml_pasta_fp_plonk_verifier_index_shifts",
2223
"caml_pasta_fq_plonk_verifier_index_shifts",
2324
"caml_pasta_fp_plonk_gate_vector_create",
@@ -98,10 +99,10 @@ var plonk_wasm = (function() {
9899
"caml_fq_srs_batch_accumulator_check",
99100
"caml_fq_srs_batch_accumulator_generate",
100101
"caml_fq_srs_h",
101-
/* "WasmFpPolyComm",
102-
"WasmFqPolyComm", */
103-
/* "WasmGPallas",
104-
"WasmGVesta", */
102+
"WasmFpPolyComm",
103+
"WasmFqPolyComm",
104+
"WasmGPallas",
105+
"WasmGVesta",
105106
"WasmPastaFp",
106107
"WasmPastaFq",
107108
"caml_pasta_fp_plonk_proof_create",

0 commit comments

Comments
 (0)