Expand description
Glue that exposes the wasi-crypto host functions to Wasmtime, the same way
Wasmtime exposes the regular preview1 WASI calls.
The heavy lifting (every cryptographic primitive, every handle table) lives
in the wasi-crypto host-functions crate, which speaks in terms of Rust
slices and u32 handles. The wasm ABI, on the other hand, speaks in terms of
guest pointers and integer error codes. Wiggle bridges the two: from the
witx description it generates one host trait per witx module plus a matching
add_to_linker. All this file does is implement those traits by reading the
arguments out of guest memory, calling into the CryptoCtx, and writing the
results back.
Modules§
Structs§
- Wasi
Crypto Ctx - Host state for the wasi-crypto functions. Drop this into your Wasmtime store
(or expose it through a view) and hand
add_to_linkera closure returning&mut WasiCryptoCtx.
Enums§
- Wasi
Crypto Error - Either something went wrong inside the cryptography layer (
CryptoError) or while touching guest memory (GuestError). Both funnel into a single witxcrypto_errnofor the guest.
Functions§
- add_
to_ linker - Register the complete wasi-crypto API (all five witx modules) on a linker in
one call, the same way
wasmtime_wasi::p1::add_to_linker_syncregisters WASI.