use super::NistP384;
use crate::ProjectivePoint;
use primeorder::PrimeCurveWithBasepointTable;
pub(super) const WINDOW_SIZE: usize = 49;
pub(super) type BasepointTable = primeorder::BasepointTable<ProjectivePoint, WINDOW_SIZE>;
pub(super) static BASEPOINT_TABLE: BasepointTable = BasepointTable::new();
impl PrimeCurveWithBasepointTable<WINDOW_SIZE> for NistP384 {
const BASEPOINT_TABLE: &'static BasepointTable = &BASEPOINT_TABLE;
}
pub(crate) mod backend {
use super::BASEPOINT_TABLE;
use crate::{NistP384, ProjectivePoint, Scalar};
use primeorder::MulBackend;
pub struct PrecomputedTables;
impl MulBackend<NistP384> for PrecomputedTables {
#[inline]
fn mul_by_generator(k: &Scalar) -> ProjectivePoint {
BASEPOINT_TABLE.mul(k)
}
#[inline]
fn mul_by_generator_vartime(k: &Scalar) -> ProjectivePoint {
BASEPOINT_TABLE.mul_vartime(k)
}
}
}