WebAssembly / wasi-crypto

WASI Cryptography API Proposal
162 stars 25 forks source link

New release of the hostcalls implementation for wasmtime? #75

Closed rjzak closed 1 year ago

rjzak commented 1 year ago

Could we have a new release so that Wasmtime may pull it in from crates.io?

Refs: https://github.com/bytecodealliance/wasmtime/pull/4612

jedisct1 commented 1 year ago

Sure.

The absence of symmetric_state_clone() may still be an issue, though.

Does wasmtime compile without this being implemented?

jedisct1 commented 1 year ago

v0.1.6 has been uploaded to crates.io.

rjzak commented 1 year ago

@jedisct1 I have a PR for Wasmtime where clone throws a not implemented error. https://github.com/bytecodealliance/wasmtime/pull/4612/files#diff-91afb02a17fcb6af253b7333ddcc5f2a14cc46313fb7a8527b78f3922d521b5b

You mentioned before that you had code but it wasn't working. Could we work on that together? With the references, and learning about witx, I haven't been able to get it working properly.

jedisct1 commented 1 year ago

Ideally, that function should be implemented in the wasi-crypto crate, even if it returns NotImplemented.

rjzak commented 1 year ago

For some reason, wasmtime-wasi-crypto also generates code from the Witx files, including the code which glues wasi-crypto to the Wasmtime exec. That should also be moved to wasi-crypto I think, but I haven't been able to get my head around Witx and how the generated code connects to everything else. Also, isn't there an effort or goal to move Witx to Wit? Not sure how that changes things.

jedisct1 commented 1 year ago

The wasi-crypto crate can be reused across runtimes, while the wasmtime-wasi-crypto contains the wasmtime specific bits.

The witx file is required so that wasmtime can link all the functions. And wiggle generates prototypes (well... "traits") from witx files to make sure that they are implemented.

Using WIT is going to be necessary, but will require a ton of work, as with WIT comes a new ABI and new tools that are still WIP or existing tools that have to be updated.