WebAssembly / WebAssembly/wasi-crypto
Resumable host calls
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 180
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
Some functions, such as password stretching functions and key pair creation functions, can take a long time to return.
This is an issue in contexts that don't expect calls to be blocking. JavaScript is an obvious example of this.
The usual way to workaround it is to make the API asynchronous (as in scrypt-async). A computation step is performed, then the function returns but signals that more steps are needed in order to complete.
We can do something very similar. Reserve an error code for this, and bindings would try again until the operation returns a different error code.
Is there a better way to address this? I remember discussions about having the equivalent of promises in WASI. Is it still something being considered, and that we could use instead?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the issue's proposed resumable error-code approach and the linked discussion of promises in WASI. Determine whether an existing WASI mechanism addresses long-running password-stretching and key-pair creation calls; done would require an agreed API direction, not just an isolated code change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- api, cryptography
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100