-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make std
an optional dependency. Require alloc
instead.
#869
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,8 @@ | |
|
||
#[macro_use] | ||
pub mod constant; | ||
|
||
#[cfg(feature = "alloc")] | ||
pub mod bigint; | ||
|
||
pub mod montgomery; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,8 @@ | |
//! <table> | ||
//! <tr><th>Feature | ||
//! <th>Description | ||
//! <tr><td><code>alloc (default)</code> | ||
//! <td>Enable features that require use of the heap, RSA in particular. | ||
//! <tr><td><code>dev_urandom_fallback (default)</code> | ||
//! <td>This is only applicable to Linux. On Linux, by default, | ||
//! <code>ring::rand::SystemRandom</code> will fall back to reading | ||
|
@@ -30,8 +32,9 @@ | |
//! <code>dev_urandom_fallback</code> feature is disabled, such | ||
//! fallbacks will not occur. See the documentation for | ||
//! <code>rand::SystemRandom</code> for more details. | ||
//! <tr><td><code>use_heap (default)</code> | ||
//! <td>Enable features that require use of the heap, RSA in particular. | ||
//! <tr><td><code>std (default)</code> | ||
//! <td>Enable features that use libstd, in particular `std::error::Error` | ||
//! integration. | ||
//! </table> | ||
|
||
#![doc(html_root_url = "https://briansmith.org/rustdoc/")] | ||
|
@@ -62,13 +65,15 @@ | |
#![no_std] | ||
#![cfg_attr(feature = "internal_benches", allow(unstable_features), feature(test))] | ||
|
||
#[cfg(any(test, feature = "use_heap"))] | ||
#[cfg(feature = "alloc")] | ||
extern crate alloc; | ||
|
||
#[cfg(feature = "std")] | ||
extern crate std; | ||
|
||
#[macro_use] | ||
mod debug; | ||
|
||
#[cfg(any(test, feature = "use_heap"))] | ||
#[macro_use] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This still needs a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, |
||
pub mod test; | ||
|
||
|
@@ -103,7 +108,7 @@ pub mod pbkdf2; | |
pub mod pkcs8; | ||
pub mod rand; | ||
|
||
#[cfg(feature = "use_heap")] | ||
#[cfg(feature = "alloc")] | ||
mod rsa; | ||
|
||
pub mod signature; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feature = "std"