Skip to content

Commit

Permalink
Merge pull request #53 from webb-tools/master
Browse files Browse the repository at this point in the history
make it compile with no_std
  • Loading branch information
kirk-baird authored Oct 20, 2022
2 parents 421aa3a + 583bdf8 commit e8c48ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
3 changes: 3 additions & 0 deletions src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ extern crate amcl;
extern crate rand;
extern crate zeroize;

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use self::zeroize::Zeroize;
use super::amcl_utils::{
self, compress_g1, decompress_g1, g1mul, subgroup_check_g1, AmclError, Big, GroupG1,
Expand Down
20 changes: 1 addition & 19 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
#![cfg_attr(
not(feature = "std"),
no_std,
feature(alloc),
feature(alloc_prelude),
feature(prelude_import)
)]
#![cfg_attr(not(feature = "std"), no_std)]

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

#[cfg(not(feature = "std"))]
pub(crate) mod prelude {
pub use alloc::prelude::v1::*;
pub use core::prelude::v1::*;
}

#[cfg(not(feature = "std"))]
#[allow(unused)]
#[prelude_import]
use crate::prelude::*;

extern crate amcl;
#[cfg(feature = "std")]
#[macro_use]
Expand Down

0 comments on commit e8c48ea

Please sign in to comment.