2018-11-09 06:37:35 +00:00
|
|
|
// -*- mode: rust; -*-
|
|
|
|
|
//
|
|
|
|
|
// This file is part of curve25519-dalek.
|
|
|
|
|
// Copyright (c) 2016-2018 Isis Lovecruft, Henry de Valence
|
|
|
|
|
// See LICENSE for licensing information.
|
|
|
|
|
//
|
|
|
|
|
// Authors:
|
|
|
|
|
// - Isis Agora Lovecruft <isis@patternsinthevoid.net>
|
|
|
|
|
// - Henry de Valence <hdevalence@hdevalence.ca>
|
|
|
|
|
|
2018-11-30 21:18:55 +00:00
|
|
|
// Conditionally include the notes if:
|
|
|
|
|
// - we're on nightly (so we can include docs at all)
|
|
|
|
|
// - we're in stage 2 of the build.
|
|
|
|
|
// The latter point prevents a really silly and annoying problem,
|
|
|
|
|
// where the location of ".." is different depending on whether we're
|
|
|
|
|
// building the crate for real, or whether we're in build.rs
|
|
|
|
|
// generating the lookup tables (in which case we're relative to the
|
|
|
|
|
// location of build.rs, not lib.rs, so the markdown file appears
|
|
|
|
|
// missing).
|
|
|
|
|
#![cfg_attr(
|
|
|
|
|
all(feature = "nightly", feature = "stage2_build"),
|
2019-08-06 19:22:59 +00:00
|
|
|
doc(include = "../../../docs/parallel-formulas.md")
|
2018-11-30 21:18:55 +00:00
|
|
|
)]
|
2018-11-09 06:37:35 +00:00
|
|
|
|
2019-02-15 19:18:25 +00:00
|
|
|
#[cfg(not(any(target_feature = "avx2", target_feature = "avx512ifma", rustdoc)))]
|
2018-11-24 21:12:20 +00:00
|
|
|
compile_error!("simd_backend selected without target_feature=+avx2 or +avx512ifma");
|
|
|
|
|
|
2019-02-15 19:18:25 +00:00
|
|
|
#[cfg(any(
|
|
|
|
|
all(target_feature = "avx2", not(target_feature = "avx512ifma")),
|
|
|
|
|
rustdoc
|
|
|
|
|
))]
|
2018-11-30 21:18:55 +00:00
|
|
|
#[doc(cfg(all(target_feature = "avx2", not(target_feature = "avx512ifma"))))]
|
2018-11-09 06:37:35 +00:00
|
|
|
pub mod avx2;
|
2019-02-15 19:18:25 +00:00
|
|
|
#[cfg(any(
|
|
|
|
|
all(target_feature = "avx2", not(target_feature = "avx512ifma")),
|
|
|
|
|
rustdoc
|
|
|
|
|
))]
|
2018-11-09 06:37:35 +00:00
|
|
|
pub(crate) use self::avx2::{
|
|
|
|
|
constants::BASEPOINT_ODD_LOOKUP_TABLE, edwards::CachedPoint, edwards::ExtendedPoint,
|
|
|
|
|
};
|
|
|
|
|
|
2018-11-30 21:18:55 +00:00
|
|
|
#[cfg(any(target_feature = "avx512ifma", rustdoc))]
|
|
|
|
|
#[doc(cfg(target_feature = "avx512ifma"))]
|
2018-11-12 01:38:28 +00:00
|
|
|
pub mod ifma;
|
2018-11-30 21:18:55 +00:00
|
|
|
#[cfg(target_feature = "avx512ifma")]
|
2019-01-18 09:47:58 +00:00
|
|
|
pub(crate) use self::ifma::{
|
|
|
|
|
constants::BASEPOINT_ODD_LOOKUP_TABLE, edwards::CachedPoint, edwards::ExtendedPoint,
|
|
|
|
|
};
|
2018-11-12 01:38:28 +00:00
|
|
|
|
2018-11-09 06:37:35 +00:00
|
|
|
pub mod scalar_mul;
|