CtSelectArray

Trait CtSelectArray 

Source
pub trait CtSelectArray<const N: usize>: CtSelect + Sized {
    // Provided method
    fn ct_select_array(
        a: &[Self; N],
        b: &[Self; N],
        choice: Choice,
    ) -> [Self; N] { ... }
}
Expand description

Implementing this trait enables use of the CtSelect trait to construct [T; N] where T is the Self type implementing the trait, via a blanket impl.

All types which impl Clone + CtAssignSlice + CtSelect will receive a blanket impl of this trait and thus also be usable with the CtSelect impl for [T; N].

Provided Methods§

Source

fn ct_select_array(a: &[Self; N], b: &[Self; N], choice: Choice) -> [Self; N]

Select between a and b in constant-time based on choice.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, const N: usize> CtSelectArray<N> for T