[Example] Add a WASI-crypto example
Motivation
In current state, we only have unit tests for wasi-crypto plugin in WasmEdge. We need a tutorial for creating a WASM program which uses wasi-crypto.
Details
- A rust source to use wasi-crypto and compile into the wasm32-wasi target.
- Use WasmEdge with wasi-crypto plugin to run the WASM.
Hi @q82419, I am trying to add a example of using wasi-crypto in rust.
But I fail to import host function like this:
#[link(wasm_import_module = "wasi_ephemeral_crypto_signatures")]
extern "C" {
pub fn signature_import(
AlgPtr: *const c_char,
AlgLen: u32,
EncodedPtr: *const u8,
EncodedLen: u32,
Encoding: u32,
SigHandlePtr: *mut u32,
);
}
I build the wasmedge from source with enabling the wasi-crypto plugin. How can I confirm if wasi-crypto plugin is loaded?
@hydai Is this completed or are you looking for more examples?
@hydai Is this completed or are you looking for more examples?
We always look for more examples :-) The previous example is here: https://github.com/WasmEdge/WasmEdge/pull/1817/files It only covers limited usage in WASI-Crypto.