-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add nostd support #42
Changes from 16 commits
c74e2f6
9a4c220
25f0f78
27592d5
8f08d91
123b446
e482d75
860e841
16493a8
2481ab1
6512e9f
354346b
14da0b5
9414bba
abf29bd
92618c1
d6d5f87
d09b6d8
e13de3f
6c2a73a
6c520ab
1dc0037
49fcc7d
bc3b3fd
6e07e07
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 | ||
---|---|---|---|---|
|
@@ -18,11 +18,11 @@ exclude = [".travis.yml", ".gitignore"] | |||
features = ["nightly"] | ||||
|
||||
[dependencies] | ||||
keccak = "0.1.0" | ||||
byteorder = "1.2.4" | ||||
clear_on_drop = "0.2.3" | ||||
rand_core = "0.3" | ||||
hex = {version = "0.3", optional = true} | ||||
keccak = { version = "0.1.0", default-features = false } | ||||
byteorder = { version = "1.2.4", default-features = false } | ||||
clear_on_drop = { version = "0.2.3", default-features = false } | ||||
rand_core = { version = "0.3", default-features = false } | ||||
hex = {version = "0.3", default-features = false, optional = true} | ||||
|
||||
[dev-dependencies] | ||||
strobe-rs = "0.3" | ||||
|
@@ -31,5 +31,8 @@ rand_chacha = "0.1" | |||
rand = "0.6" | ||||
|
||||
[features] | ||||
default = ["std"] | ||||
nightly = ["clear_on_drop/nightly"] | ||||
debug-transcript = ["hex"] | ||||
std = ["rand_core/std", "byteorder/std"] | ||||
alloc = ["rand_core/alloc"] | ||||
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.
Suggested change
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,3 +1,5 @@ | ||||
#![cfg_attr(not(feature = "std"), no_std)] | ||||
#![cfg_attr(feature = "alloc", feature(alloc))] | ||||
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.
Suggested change
|
||||
#![cfg_attr(feature = "nightly", feature(external_doc))] | ||||
#![cfg_attr(feature = "nightly", doc(include = "../README.md"))] | ||||
#![doc(html_logo_url = "https://doc.dalek.rs/assets/dalek-logo-clear.png")] | ||||
|
@@ -16,10 +18,12 @@ please file an issue! | |||
|
||||
extern crate byteorder; | ||||
extern crate clear_on_drop; | ||||
extern crate core; | ||||
extern crate keccak; | ||||
extern crate rand_core; | ||||
|
||||
#[cfg(feature = "std")] | ||||
extern crate core; | ||||
|
||||
#[cfg(test)] | ||||
extern crate curve25519_dalek; | ||||
#[cfg(feature = "hex")] | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
//! Minimal implementation of (parts of) Strobe. | ||
|
||
use keccak; | ||
use std::ops::{Deref, DerefMut}; | ||
use ::core::ops::{Deref, DerefMut}; | ||
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. rustfmt seems to want this line above 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. Done @isislovecruft. I did this locally while on vacation, but failed to push it :O |
||
|
||
/// Strobe R value; security level 128 is hardcoded | ||
const STROBE_R: u8 = 166; | ||
|
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.
Does the
alloc
feature actually get used for anything? I don't think Merlin allocates, so if this feature is only being used to enable a corresponding feature inrand_core
, I'm not sure we need it -- since Cargo features are additive, anything else that needsrand_core/alloc
can enable it themselves.