Skip to content

Commit

Permalink
Remove format
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Dec 21, 2023
1 parent bc2b5b5 commit 72dab3f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ version = "1.5.0"
authors = ["Lovesh Harchandani <lovesh.bond@gmail.com>", "Kirk Baird <kirk@sigmaprime.io>", "Paul Hauner <paul@sigmaprime.io>"]
description = "BLS12-381 signatures using the Apache Milagro curve library, targeting Ethereum 2.0"
license = "Apache-2.0"
edition = "2021"

[[bench]]
name = "bls381_benches"
harness = false

[dependencies]
amcl = { path = "./incubator-milagro-crypto-rust", default-features = false, features = ["bls381"]}
amcl = { path = "./incubator-milagro-crypto-rust", default-features = false, features = ["bls381"] }
hex = { version = "0.4.0", optional = true }
lazy_static = { version = "1.4.0", optional = true }
rand = { version = "0.8.5", default-features = false }
zeroize = "1.0.0"
codec = { version = "3.6.1", package = "parity-scale-codec", default-features = false, features = ["derive", "max-encoded-len"] }
scale-info = { version = "2.9.0", default-features = false, features = ["derive"] }

# This cannot be specified as dev-dependencies. Otherwise a cargo bug will always resolve `rand` with `std` feature, which breaks `no_std` builds.
criterion = { version = "0.3.0", optional = true }
criterion = { version = "0.4.0", optional = true }

[features]
default = ["std"]
Expand All @@ -27,4 +30,7 @@ std = [
"rand/std_rng",
"lazy_static",
"hex",
"codec/std",
"scale-info/std",
"amcl/std",
]
2 changes: 1 addition & 1 deletion incubator-milagro-crypto-rust
2 changes: 1 addition & 1 deletion src/amcl_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extern crate amcl;
#[cfg(feature = "std")]
extern crate hex;
extern crate rand;

use crate::BLSCurve;
use BLSCurve::bls381::proof_of_possession::DST_G2;
use BLSCurve::ecp::ECP;
use BLSCurve::ecp2::ECP2;
Expand Down
6 changes: 4 additions & 2 deletions src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ use std::fmt;
use BLSCurve::bls381::utils::{
deserialize_g1, secret_key_from_bytes, secret_key_to_bytes, serialize_uncompressed_g1,
};
use crate::BLSCurve;
use codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;

// Key Generation Constants
/// Domain for key generation.
Expand Down Expand Up @@ -112,8 +115,7 @@ impl Drop for SecretKey {
}

/// A BLS public key.
#[derive(Clone, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Debug))]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Encode, Decode, TypeInfo, MaxEncodedLen)]
pub struct PublicKey {
pub point: GroupG1,
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mod amcl_utils;
mod keys;
mod signature;

use self::amcl::bls381 as BLSCurve;
pub use self::amcl::bls381 as BLSCurve;

pub use aggregates::{AggregatePublicKey, AggregateSignature};
pub use amcl_utils::{AmclError, G1_BYTES, G2_BYTES, SECRET_KEY_BYTES};
Expand Down

0 comments on commit 72dab3f

Please sign in to comment.