[][src]Struct curve25519_dalek::window::LookupTable

pub struct LookupTable<T>(pub(crate) [T; 8]);

A lookup table of precomputed multiples of a point \(P\), used to compute \( xP \) for \( -8 \leq x \leq 8 \).

The computation of \( xP \) is done in constant time by the select function.

Since LookupTable does not implement Index, it's more difficult to accidentally use the table directly. Unfortunately the table is only pub(crate) so that we can write hardcoded constants, so it's still technically possible. It would be nice to prevent direct access to the table.

XXX make this generic with respect to table size

Methods

impl<T> LookupTable<T> where
    T: Identity + ConditionallySelectable + ConditionallyNegatable
[src]

pub fn select(&self, x: i8) -> T[src]

Given \(-8 \leq x \leq 8\), return \(xP\) in constant time.

Trait Implementations

impl<T: Clone> Clone for LookupTable<T>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for LookupTable<T>[src]

impl<'a> From<&'a EdwardsPoint> for LookupTable<CachedPoint>[src]

impl<'a> From<&'a EdwardsPoint> for LookupTable<CachedPoint>[src]

impl<'a> From<&'a EdwardsPoint> for LookupTable<ProjectiveNielsPoint>[src]

impl<'a> From<&'a EdwardsPoint> for LookupTable<AffineNielsPoint>[src]

impl<T: Copy> Copy for LookupTable<T>[src]

impl<T: Copy + Default> Default for LookupTable<T>[src]

impl<T> ZeroSafe for LookupTable<T>[src]

This type isn't actually zeroable (all zero bytes are not valid points), but we want to be able to use clear_on_drop to erase slices of LookupTable.

Since the ZeroSafe trait is only used by clear_on_drop, the only situation where this would be a problem is if code attempted to use a ClearOnDrop to erase a LookupTable and then used the table afterwards.

Normally this is not a problem, since the table's storage is usually dropped too.

XXX is this a good compromise?

Auto Trait Implementations

impl<T> Send for LookupTable<T> where
    T: Send

impl<T> Sync for LookupTable<T> where
    T: Sync

Blanket Implementations

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> FromCast for T

impl<T, U> Cast for T where
    U: FromCast<T>, 

impl<T, U> IntoBits for T where
    U: FromBits<T>, 

impl<T> FromBits for T

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T> Same for T

type Output = T

Should always be Self