Skip to content

Commit

Permalink
no_std works now I think
Browse files Browse the repository at this point in the history
Fixes #31
  • Loading branch information
burdges committed Apr 30, 2019
1 parent 408d1ce commit bc1cf8e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
14 changes: 8 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,13 @@
#![warn(rust_2018_idioms)]
#![deny(missing_docs)] // refuse to compile if documentation is missing

#[cfg(any(feature = "std", test))]
#[macro_use]
extern crate std;

#[cfg(feature = "alloc")]
#[macro_use]
extern crate alloc;

extern crate curve25519_dalek;
extern crate merlin;
Expand All @@ -264,16 +271,11 @@ extern crate rand_chacha;

extern crate failure;

extern crate ed25519_dalek;

#[cfg(test)]
extern crate sha3;

extern crate ed25519_dalek;

#[cfg(any(feature = "std", test))]
#[macro_use]
extern crate std;

extern crate sha2;

// #[cfg(test)]
Expand Down
5 changes: 2 additions & 3 deletions src/musig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@
use core::borrow::{Borrow}; // BorrowMut

#[cfg(feature = "alloc")]
use alloc::collections::{BTreeMap, btree_map::Entry};
use alloc::{collections::btree_map::{BTreeMap, Entry}};
#[cfg(feature = "std")]
use std::collections::{BTreeMap, btree_map::Entry};

use std::{collections::btree_map::{BTreeMap, Entry}};

use merlin::Transcript;
use clear_on_drop::clear::Clear;
Expand Down
2 changes: 1 addition & 1 deletion src/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ where
T: SigningTranscript,
I: IntoIterator<Item=T>,
{
const ASSERT_MESSAGE: &'static [u8] = b"The number of messages/transcripts, signatures, and public keys must be equal.";
const ASSERT_MESSAGE: &'static str = "The number of messages/transcripts, signatures, and public keys must be equal.";
assert!(signatures.len() == public_keys.len(), ASSERT_MESSAGE); // Check transcripts length below

#[cfg(feature = "alloc")]
Expand Down
2 changes: 1 addition & 1 deletion src/vrf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ pub fn dleq_verify_batch(
) -> bool {
use curve25519_dalek::traits::IsIdentity;

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

Expand Down

0 comments on commit bc1cf8e

Please sign in to comment.