bytecodealliance / bytecodealliance/wasmtime

Support cryptographic constant-time in cranelift

Open
#5,617 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 19h
Merged PRs (30d)
121

Description

#### Feature

Add support for doing cryptographic constant-time in cranelift.

A great introductory guide to cryptographic constant-time can be found at: https://www.chosenplaintext.ca/articles/beginners-guide-constant-time-cryptography.html

Citing the main idea:
> Secret information may only be used in an input to an instruction if that input has no impact on what resources will be used and for how long

#### Benefit

Enables giving higher assurances for cryptographic implementations by allowing them to be secured against or at least resistant to timing attacks.

#### Implementation

* Adding support for annotating "secret" values/identifiers
* Restricting optimizations and codegen involving these secrets

#### Caveats

* Performance is very important for cryptography, so the level of interest depends on whether it is possible to get comparable performance with Cranelift. This is not about how good Cranelift optimizes, but how well hand-optimized code that ends up in Cranelift can run in the best case.
* It is unlikely for cryptography to be written in cranelift IR itself, so the benefits of this proposal are unlikely to bear fruit until WASM or Rust get support.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.