2018-11-09 06:37:35 +00:00
|
|
|
// -*- mode: rust; -*-
|
|
|
|
|
//
|
|
|
|
|
// This file is part of curve25519-dalek.
|
2021-03-25 04:10:55 +00:00
|
|
|
// Copyright (c) 2016-2021 isis lovecruft
|
|
|
|
|
// Copyright (c) 2016-2019 Henry de Valence
|
2018-11-09 06:37:35 +00:00
|
|
|
// See LICENSE for licensing information.
|
|
|
|
|
//
|
|
|
|
|
// Authors:
|
2021-03-25 04:10:55 +00:00
|
|
|
// - isis agora lovecruft <isis@patternsinthevoid.net>
|
2018-11-09 06:37:35 +00:00
|
|
|
// - Henry de Valence <hdevalence@hdevalence.ca>
|
|
|
|
|
|
2018-11-30 21:18:55 +00:00
|
|
|
//! Serial implementations of field, scalar, point arithmetic.
|
2018-11-09 06:37:35 +00:00
|
|
|
//!
|
2022-10-22 23:51:54 +00:00
|
|
|
//! When the vector backend is disabled, the crate uses the mixed-model strategy
|
|
|
|
|
//! for implementing point operations and scalar multiplication; see the
|
|
|
|
|
//! [`curve_models`] and [`scalar_mul`] documentation for more information.
|
2018-11-09 06:37:35 +00:00
|
|
|
//!
|
2018-11-30 21:18:55 +00:00
|
|
|
//! When the vector backend is enabled, the field and scalar
|
|
|
|
|
//! implementations are still used for non-vectorized operations.
|
2018-11-09 06:37:35 +00:00
|
|
|
|
2022-11-13 17:17:42 +00:00
|
|
|
use cfg_if::cfg_if;
|
2018-11-09 06:37:35 +00:00
|
|
|
|
2022-11-13 17:17:42 +00:00
|
|
|
cfg_if! {
|
2022-12-09 08:42:52 +00:00
|
|
|
if #[cfg(curve25519_dalek_backend = "fiat")] {
|
2022-12-08 16:52:42 +00:00
|
|
|
|
|
|
|
|
#[cfg(curve25519_dalek_bits = "32")]
|
2023-08-28 06:38:11 +00:00
|
|
|
#[doc(hidden)]
|
2022-11-13 17:17:42 +00:00
|
|
|
pub mod fiat_u32;
|
2018-11-09 06:37:35 +00:00
|
|
|
|
2022-12-08 16:52:42 +00:00
|
|
|
#[cfg(curve25519_dalek_bits = "64")]
|
2023-08-28 06:38:11 +00:00
|
|
|
#[doc(hidden)]
|
2022-11-13 17:17:42 +00:00
|
|
|
pub mod fiat_u64;
|
2022-12-08 16:52:42 +00:00
|
|
|
|
2022-11-13 17:17:42 +00:00
|
|
|
} else {
|
2022-12-08 16:52:42 +00:00
|
|
|
|
|
|
|
|
#[cfg(curve25519_dalek_bits = "32")]
|
2023-08-28 06:38:11 +00:00
|
|
|
#[doc(hidden)]
|
2022-11-13 17:17:42 +00:00
|
|
|
pub mod u32;
|
2021-01-11 21:20:55 +00:00
|
|
|
|
2022-12-08 16:52:42 +00:00
|
|
|
#[cfg(curve25519_dalek_bits = "64")]
|
2023-08-28 06:38:11 +00:00
|
|
|
#[doc(hidden)]
|
2022-11-13 17:17:42 +00:00
|
|
|
pub mod u64;
|
2022-12-08 16:52:42 +00:00
|
|
|
|
2022-11-13 17:17:42 +00:00
|
|
|
}
|
|
|
|
|
}
|
2019-08-27 22:52:55 +00:00
|
|
|
|
2018-11-09 06:37:35 +00:00
|
|
|
pub mod curve_models;
|
|
|
|
|
|
|
|
|
|
pub mod scalar_mul;
|