Expand description
A set of constant-time helper functions for the following:
- Basic arithmetic operations such as less-than(x, y), is_zero(x), etc.
- Conditional operations such as select and swap whose output depends on whether the condition is true or false.
- Implementing boolean operators for Condition<T>: &, &=, |, |=, ^, ^=.
Structs§
- Condition
- Helper functions for checking some condition on some data using constant-time operations.
Functions§
- conditional_
copy_ bytes - Copies either the contents of
aorbintooutaccording totake_aand it does it in a constant-time manner without branching. - ct_
eq_ bytes - Rust doesn’t guarantee that anything can truly be constant-time under all compilation targets and optimization levels. The following presents the standard constant-time shape.
- ct_
eq_ zero_ bytes - Rust doesn’t guarantee that anything can truly be constant-time under all compilation targets and optimization levels. The following presents the standard constant-time shape.