Trait subtle::ConditionallyNegatable [] [src]

pub trait ConditionallyNegatable {
    fn conditional_negate(&mut self, choice: Choice);
}

A type which can be conditionally negated in constant time.

Note

A generic implementation of ConditionallyNegatable is provided for types which are ConditionallyNegatable + Neg, but this generic implementation is feature-gated on the generic-impls feature in order to allow users to make custom implementations without clashing with the orphan rules.

Required Methods

Negate self if choice == Choice(1); otherwise, leave it unchanged.

This function should execute in constant time.

Implementors