[][src]Trait zerocaf::traits::ops::Half

pub trait Half {
    type Output;
#[must_use]
    fn half(self) -> Self::Output;
}

Trait that represents the /2 operation for any kind of element on the library.

This is a more performant way of performing the division by 2 that dividing by 2 with the Div trait implementation.

This trait is implemented following the rules that mandate over the Type that is being implemented.

Associated Types

type Output

Loading content...

Required methods

#[must_use] fn half(self) -> Self::Output

Returns the half of the input: x/2.

Loading content...

Implementors

impl<'a> Half for &'a FieldElement[src]

type Output = FieldElement

fn half(self) -> FieldElement[src]

Give the half of the FieldElement value (mod l).

impl<'a> Half for &'a Scalar[src]

type Output = Scalar

fn half(self) -> Scalar[src]

Give the half of the Scalar value (mod l).

Loading content...