Skip to content

Commit a7e7ab7

Browse files
committed
wip dont use napi types just yet
1 parent 698b18b commit a7e7ab7

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/lib/crypto/kimchi_bindings/js/bindings/verifier-index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ var caml_opt_to_rust = function (caml_optional_value, to_rust) {
2525
// Requires: plonk_wasm, tsRustConversion
2626
var caml_pasta_fp_plonk_verifier_index_create = function (x) {
2727
console.log("caml_pasta_fp_plonk_verifier_index_create", x)
28-
var vk = plonk_wasm.caml_pasta_fp_plonk_verifier_index_create(x);
28+
var bytes = plonk_wasm.prover_index_fp_to_bytes(x);
29+
console.log("bytes", bytes)
30+
var index = plonk_wasm.WasmPastaFpPlonkIndex.deserialize(bytes)
31+
console.log("index", index)
32+
var vk = plonk_wasm.caml_pasta_fp_plonk_verifier_index_create(index);
33+
console.log("vk", vk)
2934
return tsRustConversion.fp.verifierIndexFromRust(vk);
3035
};
3136

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ var plonk_wasm = (function() {
2020
"caml_pasta_fp_plonk_proof_create",
2121
"caml_pasta_fp_plonk_verifier_index_shifts",
2222
"caml_pasta_fq_plonk_verifier_index_shifts",
23-
"WasmFpPolyComm",
24-
"WasmFqPolyComm",
2523
"caml_pasta_fp_plonk_gate_vector_create",
2624
"caml_pasta_fq_plonk_gate_vector_create",
2725
"caml_pasta_fp_plonk_gate_vector_add",
@@ -84,18 +82,18 @@ var plonk_wasm = (function() {
8482
"caml_fq_srs_batch_accumulator_check",
8583
"caml_fq_srs_batch_accumulator_generate",
8684
"caml_fq_srs_h",
87-
"WasmFpPolyComm",
88-
"WasmFqPolyComm",
89-
"WasmGPallas",
90-
"WasmGVesta",
85+
/* "WasmFpPolyComm",
86+
"WasmFqPolyComm", */
87+
/* "WasmGPallas",
88+
"WasmGVesta", */
9189
"WasmPastaFp",
9290
"WasmPastaFq",
9391
];
9492

9593
overrides.forEach(function (override) {
96-
wasm[override] = function(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) {
94+
wasm[override] = function(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) {
9795
console.log("calling native override:", override);
98-
return native[override](x1, x2, x3, x4, x5, x6, x7, x8, x9, x10);
96+
return native[override](x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12);
9997
}
10098
})
10199
wasm.native = true;

0 commit comments

Comments
 (0)