This repository is for development of Cryptography API proposals for the WASI Subgroup of the WebAssembly Community Group.
Please refer to those groups' documentation for more information on their processes, goals, scope, and deliverables.
- High-level goals
- Security design document
- Specification
- Interface definitions:
- Concise API overview
- Wasmtime implementation - Wasmtime fork with wasi-crypto integration
- Example AssemblyScript bindings
- Example Rust bindings
The example implementation exports:
- A Rust interface
CryptoCtxmodeled after thewitxfile, but that can be directly used without a WebAssembly runtime. - A thin
WasiCryptoCtxlayer that directly maps that API to the WASI calling conventions, usingwiggle.
CryptoCtx can be used to quickly experiment with the API in Rust.
Other languages can use the wasmtime fork above as a WebAssembly runtime in order to access the crypto API.
In that configuration, the API can be accessed via the exported wasi_ephemeral_crypto module.
See the AssemblyScript and Rust bindings as an example.
Currently supported algorithms as a proof of concept:
ECDSA_P256_SHA256ECDSA_K256_SHA256Ed25519RSA_PKCS1_2048_SHA256RSA_PKCS1_2048_SHA384RSA_PKCS1_2048_SHA512RSA_PKCS1_3072_SHA384RSA_PKCS1_3072_SHA512RSA_PKCS1_4096_SHA512RSA_PSS_2048_SHA256RSA_PSS_2048_SHA384RSA_PSS_2048_SHA512RSA_PSS_3072_SHA384RSA_PSS_3072_SHA512RSA_PSS_4096_SHA512HKDF-EXTRACT/SHA-256HKDF-EXTRACT/SHA-512HKDF-EXPAND/SHA-256HKDF-EXPAND/SHA-512HMAC/SHA-256HMAC/SHA-512SHA-256SHA-512SHA-512/256AES-128-GCMAES-256-GCMCHACHA20-POLY1305XCHACHA20-POLY1305XOODYAK-128XOODYAK-160X25519KYBER768