WebAssembly / wasi-crypto

WASI Cryptography API Proposal
162 stars 25 forks source link

Use WASI Streams #57

Open npmccallum opened 2 years ago

npmccallum commented 2 years ago

WASI streams are beginning to reach a point of maturity. This standard should define how it interacts with streams (if at all).

jedisct1 commented 2 years ago

Good call.

Is there any implementation yet? Especially outside Rust?

npmccallum commented 2 years ago

@sunfishcode ^

sunfishcode commented 2 years ago

There is parsing support for the wit syntax in wit-bindgen, but the canonical ABI implementation is not complete yet.

jedisct1 commented 2 years ago

What we currently have for signatures and symmetric operations is something that can be directly mapped to the traditional NIST init()/update()/finalize() APIs.

But we can add update()/absorb()/squeeze() alternatives that accept a stream handle. That can indeed be useful to emulate OpenSSL BIO objects.

jedisct1 commented 2 years ago

There is parsing support for the wit syntax in wit-bindgen, but the canonical ABI implementation is not complete yet.

witx-codegen doesn't support streams either, so there is some preliminary work to do.

But if we can keep the current interface, and augment it with streams-oriented functions later, that shouldn't be an issue.