# [−][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> 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?

## Blanket Implementations

### 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> Same for T

#### type Output = T

Should always be Self