[−][src]Trait zerocaf::traits::ops::InvSqrt
Associated Types
type Output
Required methods
#[must_use]
fn inv_sqrt(self) -> Self::Output
Performs the Inverse Square root of a given value.
This operation returns always the positive result of the modular sqrt, understanding positive as the definition that appears on the Decaf paper: 0 < result < (P - 1)/2.
Implementors
impl<'_> InvSqrt for &'_ FieldElement
[src]
type Output = (Choice, FieldElement)
fn inv_sqrt(self) -> (Choice, FieldElement)
[src]
This is a convenience wrapper function over the SqrtRatioI
trait
implementation when self = 1
:
Computes sqrt(1/self)
.
This function always returns the non-negative result of the sqrt.
Returns:
(Choice(1), +sqrt(1/self))
ifself
is a nonzero square;(Choice(0), zero)
ifself
is zero;(Choice(0), +sqrt(i/self))
ifself
is a nonzero nonsquare;