Skip to content

Commit bc1cf8e

Browse files
committed
no_std works now I think
Fixes #31
1 parent 408d1ce commit bc1cf8e

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

src/lib.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,13 @@
253253
#![warn(rust_2018_idioms)]
254254
#![deny(missing_docs)] // refuse to compile if documentation is missing
255255

256+
#[cfg(any(feature = "std", test))]
257+
#[macro_use]
258+
extern crate std;
259+
260+
#[cfg(feature = "alloc")]
261+
#[macro_use]
262+
extern crate alloc;
256263

257264
extern crate curve25519_dalek;
258265
extern crate merlin;
@@ -264,16 +271,11 @@ extern crate rand_chacha;
264271

265272
extern crate failure;
266273

274+
extern crate ed25519_dalek;
267275

268276
#[cfg(test)]
269277
extern crate sha3;
270278

271-
extern crate ed25519_dalek;
272-
273-
#[cfg(any(feature = "std", test))]
274-
#[macro_use]
275-
extern crate std;
276-
277279
extern crate sha2;
278280

279281
// #[cfg(test)]

src/musig.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@
3434
use core::borrow::{Borrow}; // BorrowMut
3535

3636
#[cfg(feature = "alloc")]
37-
use alloc::collections::{BTreeMap, btree_map::Entry};
37+
use alloc::{collections::btree_map::{BTreeMap, Entry}};
3838
#[cfg(feature = "std")]
39-
use std::collections::{BTreeMap, btree_map::Entry};
40-
39+
use std::{collections::btree_map::{BTreeMap, Entry}};
4140

4241
use merlin::Transcript;
4342
use clear_on_drop::clear::Clear;

src/sign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ where
265265
T: SigningTranscript,
266266
I: IntoIterator<Item=T>,
267267
{
268-
const ASSERT_MESSAGE: &'static [u8] = b"The number of messages/transcripts, signatures, and public keys must be equal.";
268+
const ASSERT_MESSAGE: &'static str = "The number of messages/transcripts, signatures, and public keys must be equal.";
269269
assert!(signatures.len() == public_keys.len(), ASSERT_MESSAGE); // Check transcripts length below
270270

271271
#[cfg(feature = "alloc")]

src/vrf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ pub fn dleq_verify_batch(
801801
) -> bool {
802802
use curve25519_dalek::traits::IsIdentity;
803803

804-
const ASSERT_MESSAGE: &'static [u8] = b"The number of messages/transcripts / input points, output points, proofs, and public keys must be equal.";
804+
const ASSERT_MESSAGE: &'static str = "The number of messages/transcripts / input points, output points, proofs, and public keys must be equal.";
805805
assert!(ps.len() == proofs.len(), ASSERT_MESSAGE);
806806
assert!(proofs.len() == public_keys.len(), ASSERT_MESSAGE);
807807

0 commit comments

Comments
 (0)