[][src]Struct salty::scalar::TweetNaclScalar

pub(crate) struct TweetNaclScalar(pub(crate) [i64; 64]);

NB: The buffer is assumed to be zero from byte 32 onward - each operation should call clear_upper_half to ensure this.

Technically, in TweetNaCl, there's an operation (a, b, c) -> a*b + c, which needs only one call to clear upper half, but I think we can live with this slight inefficiency - if scalar ring operations become a bottleneck, there should be bigger improvements achievable by other means.

Methods

impl TweetNaclScalar[src]

pub(crate) fn clear_upper_half(&mut self)[src]

pub(crate) fn reduce_modulo_ell(&mut self) -> Scalar[src]

Trait Implementations

impl<'_> From<&'_ [u8; 64]> for TweetNaclScalar[src]

impl From<Scalar> for TweetNaclScalar[src]

impl<'_> From<&'_ Scalar> for TweetNaclScalar[src]

impl<'a, 'b> Add<&'b TweetNaclScalar> for &'a TweetNaclScalar[src]

type Output = TweetNaclScalar

The resulting type after applying the + operator.

impl<'a, 'b> Mul<&'b TweetNaclScalar> for &'a TweetNaclScalar[src]

type Output = TweetNaclScalar

The resulting type after applying the * operator.

Auto Trait Implementations

impl Unpin for TweetNaclScalar

impl Send for TweetNaclScalar

impl Sync for TweetNaclScalar

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]