Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/curve25519-dalek/src/lib.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / curve25519-dalek / src / lib.rs` 113 lines ยท 3245 bytes Raw Blame History 1 // -*- mode: rust; -*- 2 // 3 // This file is part of curve25519-dalek. 4 // Copyright (c) 2016-2021 isis lovecruft 5 // Copyright (c) 2016-2019 Henry de Valence 6 // See LICENSE for licensing information. 7 // 8 // Authors: 9 // - isis agora lovecruft 10 // - Henry de Valence 11 12 #![no_std] 13 #![cfg_attr( 14 all( 15 curve25519_dalek_backend = "simd", 16 nightly, 17 any(target_arch = "x86", target_arch = "x86_64") 18 ), 19 feature(stdarch_x86_avx512) 20 )] 21 #![cfg_attr( 22 all(curve25519_dalek_backend = "simd", nightly), 23 feature(avx512_target_feature) 24 )] 25 #![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg, doc_cfg_hide))] 26 #![cfg_attr(docsrs, doc(cfg_hide(docsrs)))] 27 //------------------------------------------------------------------------ 28 // Documentation: 29 //------------------------------------------------------------------------ 30 #![doc( 31 html_logo_url = "https://cdn.jsdelivr.net/gh/dalek-cryptography/curve25519-dalek/docs/assets/dalek-logo-clear.png" 32 )] 33 #![doc = include_str!("../README.md")] 34 //------------------------------------------------------------------------ 35 // Linting: 36 //------------------------------------------------------------------------ 37 #![cfg_attr(allow_unused_unsafe, allow(unused_unsafe))] 38 #![warn( 39 clippy::unwrap_used, 40 missing_docs, 41 rust_2018_idioms, 42 unused_lifetimes, 43 unused_qualifications 44 )] 45 // Requires MSRV 1.77 as it does not allow build.rs gating 46 #![allow(unexpected_cfgs)] 47 48 //------------------------------------------------------------------------ 49 // External dependencies: 50 //------------------------------------------------------------------------ 51 52 #[cfg(feature = "alloc")] 53 #[allow(unused_imports)] 54 #[macro_use] 55 extern crate alloc; 56 57 // TODO: move std-dependent tests to `tests/` 58 #[cfg(test)] 59 #[macro_use] 60 extern crate std; 61 62 #[cfg(feature = "digest")] 63 pub use digest; 64 65 // Internal macros. Must come first! 66 #[macro_use] 67 pub(crate) mod macros; 68 69 //------------------------------------------------------------------------ 70 // curve25519-dalek public modules 71 //------------------------------------------------------------------------ 72 73 // Scalar arithmetic mod l = 2^252 + ..., the order of the Ristretto group 74 pub mod scalar; 75 76 // Point operations on the Montgomery form of Curve25519 77 pub mod montgomery; 78 79 // Point operations on the Edwards form of Curve25519 80 pub mod edwards; 81 82 // Group operations on the Ristretto group 83 pub mod ristretto; 84 85 // Useful constants, like the Ed25519 basepoint 86 pub mod constants; 87 88 // External (and internal) traits. 89 pub mod traits; 90 91 //------------------------------------------------------------------------ 92 // curve25519-dalek internal modules 93 //------------------------------------------------------------------------ 94 95 // Finite field arithmetic mod p = 2^255 - 19 96 pub(crate) mod field; 97 98 // Arithmetic backends (using u32, u64, etc) live here 99 #[cfg(docsrs)] 100 pub mod backend; 101 #[cfg(not(docsrs))] 102 pub(crate) mod backend; 103 104 // Generic code for window lookups 105 pub(crate) mod window; 106 107 pub use crate::{ 108 edwards::EdwardsPoint, montgomery::MontgomeryPoint, ristretto::RistrettoPoint, scalar::Scalar, 109 }; 110 111 // Build time diagnostics for validation 112 #[cfg(curve25519_dalek_diagnostics = "build")] 113 mod diagnostics;