2017-08-15 05:09:20 +00:00
|
|
|
// -*- mode: rust; -*-
|
2016-12-08 05:12:00 +00:00
|
|
|
//
|
2017-08-15 05:09:20 +00:00
|
|
|
// 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
|
2017-08-15 05:09:20 +00:00
|
|
|
// See LICENSE for licensing information.
|
2016-12-08 05:12:00 +00:00
|
|
|
//
|
|
|
|
|
// Authors:
|
2021-03-25 04:10:55 +00:00
|
|
|
// - isis agora lovecruft <isis@patternsinthevoid.net>
|
2017-08-15 05:09:20 +00:00
|
|
|
// - Henry de Valence <hdevalence@hdevalence.ca>
|
2016-12-08 05:12:00 +00:00
|
|
|
|
2018-07-20 21:43:31 +00:00
|
|
|
#![no_std]
|
2022-11-26 10:54:22 +00:00
|
|
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
2022-11-26 10:58:29 +00:00
|
|
|
#![cfg_attr(feature = "simd_backend", feature(stdsimd))]
|
2022-11-11 11:24:25 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
// Documentation:
|
|
|
|
|
//------------------------------------------------------------------------
|
2021-07-13 05:40:28 +00:00
|
|
|
#![deny(missing_docs)]
|
2022-11-24 23:14:25 +00:00
|
|
|
#![doc(
|
|
|
|
|
html_logo_url = "https://cdn.jsdelivr.net/gh/dalek-cryptography/curve25519-dalek/docs/assets/dalek-logo-clear.png"
|
|
|
|
|
)]
|
2022-02-16 21:26:01 +00:00
|
|
|
#![doc(html_root_url = "https://docs.rs/curve25519-dalek/4.0.0-pre.2")]
|
2022-11-11 11:24:25 +00:00
|
|
|
#![doc = include_str!("../README.md")]
|
2018-03-27 21:24:06 +00:00
|
|
|
|
2017-11-17 00:07:55 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
// External dependencies:
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
|
2022-11-14 05:11:23 +00:00
|
|
|
#[cfg(feature = "alloc")]
|
|
|
|
|
#[allow(unused_imports)]
|
2018-07-20 21:43:31 +00:00
|
|
|
#[macro_use]
|
2017-11-17 00:07:55 +00:00
|
|
|
extern crate alloc;
|
|
|
|
|
|
2018-07-20 21:43:31 +00:00
|
|
|
#[cfg(feature = "std")]
|
|
|
|
|
#[macro_use]
|
|
|
|
|
extern crate std;
|
|
|
|
|
|
2022-10-18 17:45:59 +00:00
|
|
|
pub use digest;
|
2017-05-14 05:40:51 +00:00
|
|
|
|
2018-01-24 18:58:22 +00:00
|
|
|
// Internal macros. Must come first!
|
|
|
|
|
#[macro_use]
|
|
|
|
|
pub(crate) mod macros;
|
|
|
|
|
|
2017-11-17 00:07:55 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
// curve25519-dalek public modules
|
|
|
|
|
//------------------------------------------------------------------------
|
2017-07-30 21:35:12 +00:00
|
|
|
|
2017-11-17 00:07:55 +00:00
|
|
|
// Scalar arithmetic mod l = 2^252 + ..., the order of the Ristretto group
|
2016-12-08 05:12:00 +00:00
|
|
|
pub mod scalar;
|
2018-03-20 19:10:39 +00:00
|
|
|
|
2017-11-17 00:07:55 +00:00
|
|
|
// Point operations on the Montgomery form of Curve25519
|
2017-08-03 05:58:15 +00:00
|
|
|
pub mod montgomery;
|
2018-03-20 19:10:39 +00:00
|
|
|
|
2017-11-17 00:07:55 +00:00
|
|
|
// Point operations on the Edwards form of Curve25519
|
|
|
|
|
pub mod edwards;
|
2018-03-20 19:10:39 +00:00
|
|
|
|
2017-11-17 00:07:55 +00:00
|
|
|
// Group operations on the Ristretto group
|
2017-07-09 01:22:28 +00:00
|
|
|
pub mod ristretto;
|
2018-03-20 19:10:39 +00:00
|
|
|
|
2017-11-17 00:07:55 +00:00
|
|
|
// Useful constants, like the Ed25519 basepoint
|
|
|
|
|
pub mod constants;
|
2018-03-20 19:10:39 +00:00
|
|
|
|
2017-11-17 01:34:28 +00:00
|
|
|
// External (and internal) traits.
|
|
|
|
|
pub mod traits;
|
2016-12-08 05:12:00 +00:00
|
|
|
|
2017-11-17 00:07:55 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
// curve25519-dalek internal modules
|
|
|
|
|
//------------------------------------------------------------------------
|
2016-12-08 05:12:00 +00:00
|
|
|
|
2017-11-17 00:07:55 +00:00
|
|
|
// Finite field arithmetic mod p = 2^255 - 19
|
|
|
|
|
pub(crate) mod field;
|
|
|
|
|
|
|
|
|
|
// Arithmetic backends (using u32, u64, etc) live here
|
2022-11-24 23:14:25 +00:00
|
|
|
#[cfg(docsrs)]
|
|
|
|
|
pub mod backend;
|
|
|
|
|
#[cfg(not(docsrs))]
|
2017-11-17 00:07:55 +00:00
|
|
|
pub(crate) mod backend;
|
|
|
|
|
|
2018-07-20 21:43:31 +00:00
|
|
|
// Crate-local prelude (for alloc-dependent features like `Vec`)
|
2022-11-24 23:14:25 +00:00
|
|
|
|
2018-07-20 21:43:31 +00:00
|
|
|
pub(crate) mod prelude;
|
|
|
|
|
|
2018-11-09 06:37:35 +00:00
|
|
|
// Generic code for window lookups
|
|
|
|
|
pub(crate) mod window;
|