Once we have the compile artefacts available through the build pipeline, we need to access them in o1js to call into them and execute native rust functions
// Provides: caml_pasta_fp_poseidon_block_cipher
// Requires: plonk_wasm, tsRustConversion, tsRustConversion
function caml_pasta_fp_poseidon_block_cipher(_fake_params, fp_vector) {
// 1. get permuted field vector from rust
var wasm_flat_vector = plonk_wasm.caml_pasta_fp_poseidon_block_cipher(
tsRustConversion.fp.vectorToRust(fp_vector)
);
var new_fp_vector = tsRustConversion.fp.vectorFromRust(wasm_flat_vector);
// 2. write back modified field vector to original one
new_fp_vector.forEach(function (a, i) {
fp_vector[i] = a;
});
}
Once we have the compile artefacts available through the build pipeline, we need to access them in o1js to call into them and execute native rust functions
plonk_wasmobject into o1js and the jsoo bindings for the node version as well as the web version - ideally we maintain the exact same interface and only inject the native prover artefact into the bindings via a third injection specifically for node-native (note: we definitely want to keep web-wasm and we may even consider keeping the node-wasm version as a fallback, so we don't need to change any of the existing implementations and pipelines, only add a new one for node-native)caml_pasta_fp_poseidon_block_cipherplonk_wasm, ideally we also refactor this part and rename it to something more generic, such asrust_interfaceto avoid confusion in the future