pub trait CtNeg: Sized {
// Required method
fn ct_neg(&self, choice: Choice) -> Self;
// Provided method
fn ct_neg_assign(&mut self, choice: Choice) { ... }
}Expand description
Constant-time conditional negation: negates a value when choice is Choice::TRUE.
Required Methods§
Sourcefn ct_neg(&self, choice: Choice) -> Self
fn ct_neg(&self, choice: Choice) -> Self
Conditionally negate self, returning -self if choice is Choice::TRUE, or self
otherwise.
Provided Methods§
Sourcefn ct_neg_assign(&mut self, choice: Choice)
fn ct_neg_assign(&mut self, choice: Choice)
Conditionally negate self in-place, replacing it with -self if choice is
Choice::TRUE.
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.