WebAssembly / WebAssembly/wasi-crypto

Resumable host calls

Open
#26 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.