Skip to content

Commit cc4b411

Browse files
committed
Revert "jsoo: remove proof conversions"
This reverts commit 2686bf1. Because we need full access to the proof structure we cannot avoid the conversions.
1 parent 2686bf1 commit cc4b411

File tree

1 file changed

+6
-6
lines changed
  • src/lib/crypto/kimchi_bindings/js/native/native-overrides

1 file changed

+6
-6
lines changed

src/lib/crypto/kimchi_bindings/js/native/native-overrides/proof.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ var caml_pasta_fp_plonk_proof_create = function (
2020
var wasm_runtime_tables =
2121
tsRustConversionNative.fp.runtimeTablesToRust(caml_runtime_tables);
2222
prev_sgs = tsRustConversionNative.fp.pointsToRust(prev_sgs);
23-
// Because proof is an external object, it does not need conversion
24-
return plonk_wasm.caml_pasta_fp_plonk_proof_create(
23+
var proof = plonk_wasm.caml_pasta_fp_plonk_proof_create(
2524
index,
2625
witness_cols,
2726
wasm_runtime_tables,
2827
prev_challenges,
2928
prev_sgs
3029
);
30+
return tsRustConversionNative.fp.proofFromRust(proof);
3131
};
3232

3333
// Provides: caml_pasta_fp_plonk_proof_verify
3434
// Requires: plonk_wasm, tsRustConversionNative
3535
var caml_pasta_fp_plonk_proof_verify = function (index, proof) {
3636
index = tsRustConversionNative.fp.verifierIndexToRust(index);
37-
// Because proof is an external object, it does not need conversion
37+
proof = tsRustConversionNative.fp.proofToRust(proof);
3838
return plonk_wasm.caml_pasta_fp_plonk_proof_verify(index, proof);
3939
};
4040

@@ -58,20 +58,20 @@ var caml_pasta_fq_plonk_proof_create = function (
5858
var wasm_runtime_tables =
5959
tsRustConversionNative.fq.runtimeTablesToRust(caml_runtime_tables);
6060
prev_sgs = tsRustConversionNative.fq.pointsToRust(prev_sgs);
61-
// Because proof is an external object, it does not need conversion
62-
return plonk_wasm.caml_pasta_fq_plonk_proof_create(
61+
var proof = plonk_wasm.caml_pasta_fq_plonk_proof_create(
6362
index,
6463
witness_cols,
6564
wasm_runtime_tables,
6665
prev_challenges,
6766
prev_sgs
6867
);
68+
return tsRustConversionNative.fq.proofFromRust(proof);
6969
};
7070

7171
// Provides: caml_pasta_fq_plonk_proof_verify
7272
// Requires: plonk_wasm, tsRustConversionNative
7373
var caml_pasta_fq_plonk_proof_verify = function (index, proof) {
7474
index = tsRustConversionNative.fq.verifierIndexToRust(index);
75-
// Because proof is an external object, it does not need conversion
75+
proof = tsRustConversionNative.fq.proofToRust(proof);
7676
return plonk_wasm.caml_pasta_fq_plonk_proof_verify(index, proof);
7777
};

0 commit comments

Comments
 (0)