Skip to content

Commit 6d67e95

Browse files
committed
jsoo: move prover index read/write to native overrides
1 parent 785e057 commit 6d67e95

File tree

2 files changed

+104
-110
lines changed

2 files changed

+104
-110
lines changed
Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +0,0 @@
1-
/* global plonk_wasm, tsRustConversion, caml_string_of_jsstring,
2-
free_on_finalize, caml_jsstring_of_string
3-
*/
4-
5-
// Provides: caml_pasta_fp_plonk_index_create_bytecode
6-
// Requires: caml_pasta_fp_plonk_index_create
7-
var caml_pasta_fp_plonk_index_create_bytecode = function (
8-
gates,
9-
public_inputs,
10-
caml_lookup_tables,
11-
caml_runtime_table_cfgs,
12-
prev_challenges,
13-
urs,
14-
lazy_mode
15-
) {
16-
return caml_pasta_fp_plonk_index_create(
17-
gates,
18-
public_inputs,
19-
caml_lookup_tables,
20-
caml_runtime_table_cfgs,
21-
prev_challenges,
22-
urs,
23-
lazy_mode
24-
);
25-
};
26-
27-
// Provides: caml_pasta_fp_plonk_index_read
28-
// Requires: plonk_wasm, caml_jsstring_of_string
29-
var caml_pasta_fp_plonk_index_read = function (offset, urs, path) {
30-
if (offset === 0) {
31-
offset = undefined;
32-
} else {
33-
offset = offset[1];
34-
}
35-
return plonk_wasm.caml_pasta_fp_plonk_index_read(
36-
offset,
37-
urs,
38-
caml_jsstring_of_string(path)
39-
);
40-
};
41-
42-
// Provides: caml_pasta_fp_plonk_index_write
43-
// Requires: plonk_wasm, caml_jsstring_of_string
44-
var caml_pasta_fp_plonk_index_write = function (append, t, path) {
45-
if (append === 0) {
46-
append = undefined;
47-
} else {
48-
append = append[1];
49-
}
50-
return plonk_wasm.caml_pasta_fp_plonk_index_write(
51-
append,
52-
t,
53-
caml_jsstring_of_string(path)
54-
);
55-
};
56-
57-
58-
// Provides: caml_pasta_fq_plonk_index_create_bytecode
59-
// Requires: caml_pasta_fq_plonk_index_create
60-
var caml_pasta_fq_plonk_index_create_bytecode = function (
61-
gates,
62-
public_inputs,
63-
caml_lookup_tables,
64-
caml_runtime_table_cfgs,
65-
prev_challenges,
66-
urs,
67-
lazy_mode
68-
) {
69-
return caml_pasta_fq_plonk_index_create(
70-
gates,
71-
public_inputs,
72-
caml_lookup_tables,
73-
caml_runtime_table_cfgs,
74-
prev_challenges,
75-
urs,
76-
lazy_mode
77-
);
78-
};
79-
80-
// Provides: caml_pasta_fq_plonk_index_read
81-
// Requires: plonk_wasm, caml_jsstring_of_string
82-
var caml_pasta_fq_plonk_index_read = function (offset, urs, path) {
83-
if (offset === 0) {
84-
offset = undefined;
85-
} else {
86-
offset = offset[1];
87-
}
88-
return plonk_wasm.caml_pasta_fq_plonk_index_read(
89-
offset,
90-
urs,
91-
caml_jsstring_of_string(path)
92-
);
93-
};
94-
95-
// Provides: caml_pasta_fq_plonk_index_write
96-
// Requires: plonk_wasm, caml_jsstring_of_string
97-
var caml_pasta_fq_plonk_index_write = function (append, t, path) {
98-
if (append === 0) {
99-
append = undefined;
100-
} else {
101-
append = append[1];
102-
}
103-
return plonk_wasm.caml_pasta_fq_plonk_index_write(
104-
append,
105-
t,
106-
caml_jsstring_of_string(path)
107-
);
108-
};

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

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/* global plonk_wasm, tsRustConversionNative */
2-
1+
/* global plonk_wasm, tsRustConversionNative, caml_jsstring_of_string */
32

43
// Provides: caml_pasta_fp_plonk_index_max_degree
54
// Requires: plonk_wasm
@@ -146,6 +145,57 @@ var caml_pasta_fp_plonk_index_create = function (
146145
return free_on_finalize(wasm_t);
147146
};
148147

148+
// Provides: caml_pasta_fp_plonk_index_create_bytecode
149+
// Requires: caml_pasta_fp_plonk_index_create
150+
var caml_pasta_fp_plonk_index_create_bytecode = function (
151+
gates,
152+
public_inputs,
153+
caml_lookup_tables,
154+
caml_runtime_table_cfgs,
155+
prev_challenges,
156+
urs,
157+
lazy_mode
158+
) {
159+
return caml_pasta_fp_plonk_index_create(
160+
gates,
161+
public_inputs,
162+
caml_lookup_tables,
163+
caml_runtime_table_cfgs,
164+
prev_challenges,
165+
urs,
166+
lazy_mode
167+
);
168+
};
169+
170+
// Provides: caml_pasta_fp_plonk_index_read
171+
// Requires: plonk_wasm, caml_jsstring_of_string
172+
var caml_pasta_fp_plonk_index_read = function (offset, urs, path) {
173+
if (offset === 0) {
174+
offset = undefined;
175+
} else {
176+
offset = offset[1];
177+
}
178+
return plonk_wasm.caml_pasta_fp_plonk_index_read(
179+
offset,
180+
urs,
181+
caml_jsstring_of_string(path)
182+
);
183+
};
184+
185+
// Provides: caml_pasta_fp_plonk_index_write
186+
// Requires: plonk_wasm, caml_jsstring_of_string
187+
var caml_pasta_fp_plonk_index_write = function (append, t, path) {
188+
if (append === 0) {
189+
append = undefined;
190+
} else {
191+
append = append[1];
192+
}
193+
return plonk_wasm.caml_pasta_fp_plonk_index_write(
194+
append,
195+
t,
196+
caml_jsstring_of_string(path)
197+
);
198+
};
149199

150200
// Provides: caml_pasta_fq_plonk_index_create
151201
// Requires: plonk_wasm, free_on_finalize, tsRustConversion
@@ -187,3 +237,55 @@ var caml_pasta_fq_plonk_index_create = function (
187237

188238
return free_on_finalize(wasm_t);
189239
};
240+
241+
// Provides: caml_pasta_fq_plonk_index_create_bytecode
242+
// Requires: caml_pasta_fq_plonk_index_create
243+
var caml_pasta_fq_plonk_index_create_bytecode = function (
244+
gates,
245+
public_inputs,
246+
caml_lookup_tables,
247+
caml_runtime_table_cfgs,
248+
prev_challenges,
249+
urs,
250+
lazy_mode
251+
) {
252+
return caml_pasta_fq_plonk_index_create(
253+
gates,
254+
public_inputs,
255+
caml_lookup_tables,
256+
caml_runtime_table_cfgs,
257+
prev_challenges,
258+
urs,
259+
lazy_mode
260+
);
261+
};
262+
263+
// Provides: caml_pasta_fq_plonk_index_read
264+
// Requires: plonk_wasm, caml_jsstring_of_string
265+
var caml_pasta_fq_plonk_index_read = function (offset, urs, path) {
266+
if (offset === 0) {
267+
offset = undefined;
268+
} else {
269+
offset = offset[1];
270+
}
271+
return plonk_wasm.caml_pasta_fq_plonk_index_read(
272+
offset,
273+
urs,
274+
caml_jsstring_of_string(path)
275+
);
276+
};
277+
278+
// Provides: caml_pasta_fq_plonk_index_write
279+
// Requires: plonk_wasm, caml_jsstring_of_string
280+
var caml_pasta_fq_plonk_index_write = function (append, t, path) {
281+
if (append === 0) {
282+
append = undefined;
283+
} else {
284+
append = append[1];
285+
}
286+
return plonk_wasm.caml_pasta_fq_plonk_index_write(
287+
append,
288+
t,
289+
caml_jsstring_of_string(path)
290+
);
291+
};

0 commit comments

Comments
 (0)