use super::NistP521;
use crate::ProjectivePoint;
use primeorder::PrimeCurveWithBasepointTable;
pub(super) const WINDOW_SIZE: usize = 67;
pub(super) type BasepointTable = primeorder::BasepointTable<ProjectivePoint, WINDOW_SIZE>;
pub(super) static BASEPOINT_TABLE: BasepointTable = BasepointTable::new();
impl PrimeCurveWithBasepointTable<WINDOW_SIZE> for NistP521 {
const BASEPOINT_TABLE: &'static BasepointTable = &BASEPOINT_TABLE;
}
pub(crate) mod backend {
use super::BASEPOINT_TABLE;
use crate::{NistP521, ProjectivePoint, Scalar};
use primeorder::Backend;
pub struct PrecomputedTables;
impl Backend<NistP521> 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)
}
}
}