Skip to main content

CheckedSquareRoot

Trait CheckedSquareRoot 

Source
pub trait CheckedSquareRoot: Sized {
    type Output;

    // Required methods
    fn checked_sqrt(&self) -> CtOption<Self::Output>;
    fn checked_sqrt_vartime(&self) -> Option<Self::Output>;
}
Expand description

Support for calculating checked square roots.

Required Associated Types§

Source

type Output

Output of the square root operation.

Required Methods§

Source

fn checked_sqrt(&self) -> CtOption<Self::Output>

Computes sqrt(self), returning none if no root exists.

Source

fn checked_sqrt_vartime(&self) -> Option<Self::Output>

Computes sqrt(self), returning none if no root exists.

Variable time with respect to self.

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 CheckedSquareRoot for BoxedUint

Available on crate feature alloc only.
Source§

impl CheckedSquareRoot for Limb

Source§

impl<const LIMBS: usize> CheckedSquareRoot for Int<LIMBS>

Source§

type Output = Int<LIMBS>

Source§

impl<const LIMBS: usize> CheckedSquareRoot for NonZero<Uint<LIMBS>>

Source§

type Output = NonZero<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> CheckedSquareRoot for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>