aboutsummaryrefslogtreecommitdiff
path: root/spake2/src/lib.rs
diff options
context:
space:
mode:
authorTony Arcieri <bascule@gmail.com>2022-01-22 15:03:05 -0700
committerGitHub <noreply@github.com>2022-01-22 15:03:05 -0700
commite02188cfaed91927083cbecac9f878a6d8d71958 (patch)
treee73b0bda359c79ac778c1f17057a73d3ada1e0a3 /spake2/src/lib.rs
parent0e89af61822595b0e110d399a1de3ce018157cf5 (diff)
downloadPAKEs-e02188cfaed91927083cbecac9f878a6d8d71958.tar.xz
spake2: initial `no_std` support (#87)
Still has a hard dependency on `alloc`, and with the current hard dependency on `getrandom` also limited platform support
Diffstat (limited to 'spake2/src/lib.rs')
-rw-r--r--spake2/src/lib.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/spake2/src/lib.rs b/spake2/src/lib.rs
index 1c87a5c..61f7973 100644
--- a/spake2/src/lib.rs
+++ b/spake2/src/lib.rs
@@ -1,7 +1,8 @@
-#![forbid(unsafe_code)]
-#![warn(rust_2018_idioms, unused_qualifications)]
+#![no_std]
#![doc(html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png")]
#![doc = include_str!("../README.md")]
+#![forbid(unsafe_code)]
+#![warn(rust_2018_idioms, unused_qualifications)]
//! # Usage
//!
@@ -217,6 +218,15 @@
//! [6]: http://eprint.iacr.org/2003/038.pdf "Pretty-Simple Password-Authenticated Key-Exchange Under Standard Assumptions"
//! [7]: https://moderncrypto.org/mail-archive/curves/2015/000419.html "PAKE questions"
+#[allow(unused_imports)]
+#[macro_use]
+extern crate alloc;
+
+#[cfg(feature = "std")]
+#[cfg_attr(test, macro_use)]
+extern crate std;
+
+use alloc::vec::Vec;
use core::{fmt, ops::Deref, str};
use curve25519_dalek::{
constants::ED25519_BASEPOINT_POINT,