Crate subtle [] [src]

Pure-Rust traits and utilities for constant-time cryptographic implementations.

Macros

generate_array_conditional_assign

Generate a constant time conditional_assign() method for an array of type [$t; $n], where $t is a type which implements core::ops::BitAnd and core::ops::BitXor and $n is an expression which evaluates to an integer.

Traits

ConditionallyAssignable

Trait for items which can be conditionally assigned in constant time.

ConditionallyNegatable

Trait for items which can be conditionally negated in constant time.

ConditionallySwappable

Trait for things which are conditionally swappable in constant time.

Equal

Trait for items whose equality to another item may be tested in constant time.

IsNonZero

Trait for testing if something is non-zero in constant time.

Functions

byte_is_nonzero

Test if a byte is non-zero in constant time.

bytes_equal

Check equality of two bytes in constant time.

slices_equal

Check equality of two slices, a and b, in constant time.

Type Definitions

Mask

A Mask represents a choice which is not a boolean.