Skip to content

createWasmConstantTimeKernel

createWasmConstantTimeKernel(): Promise<ConstantTimeKernel>

Defined in: kernel/wasm/kernel.ts:78

Adapts an instantiated fixed_uint.wasm module to a ConstantTimeKernel.

The caller instantiates the module — the mechanism and its timing are the caller’s business — and installs the result with installConstantTimeKernel. Nothing here is asynchronous, so arithmetic never awaits once a kernel is installed.

Promise<ConstantTimeKernel>

A kernel ready to install.

const { instance } = await WebAssembly.instantiate(await readFile(path));
installConstantTimeKernel(
createWasmConstantTimeKernel(instance.exports as ConstantTimeWasmExports),
);
```;