libcrux
libcrux copied to clipboard
Type-based secret independence
trafficstars
This is an initial PR to include type-based secret independence in Libcrux.
The new crate secrets introduces types and functions for secret integers.
A future PR will provide a more comprehensive crate with secure erasure and constant-time ops.
To enable secret independence checking, it provides the feature check-secret-independence.
If this flag is not set, the crate implements all integers transparently, with (hopefully) no performance cost.
The secrets crate has been tested in libcrux-ml-kem.
Specifically, this PR also adapts the code within vector/portable to use secret integers.
To check secret independence, call cargo check --features "check-secret-independence"