Skip to content

Commit 004e1ae

Browse files
committed
do not creep in std
1 parent 85c4f76 commit 004e1ae

File tree

3 files changed

+12
-23
lines changed

3 files changed

+12
-23
lines changed

Cargo.toml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ homepage = "https://github.com/w3f/bls"
66
license = "MIT/Apache-2.0"
77
name = "w3f-bls"
88
repository = "https://github.com/w3f/bls"
9-
version = "0.1.8"
9+
version = "0.1.9"
1010
edition = "2018"
1111

1212
[dependencies]
@@ -27,9 +27,6 @@ ark-bls12-381 = { version = "0.4.0", default-features = false, features = [ "cur
2727
ark-bls12-377 = { version = "0.4.0", default-features = false, features = [ "curve" ] }
2828

2929
zeroize = { version = "1.0", default-features = false, features = [ "zeroize_derive" ] }
30-
serde = { version = "1.0", default-features = false, optional = true }
31-
thiserror = { version = "1.0", default-features = false }
32-
constcat = "0.3.0"
3330

3431
[dev-dependencies]
3532
hex-literal = "0.3.4"
@@ -38,12 +35,3 @@ hex-literal = "0.3.4"
3835
default = ["std"]
3936
std = ["rand/std"]
4037
experimental = []
41-
42-
[patch.crates-io]
43-
# ark-ec = { git = "https://github.com/w3f/arkworks-algebra", branch = 'master'}
44-
# ark-ff = { git = "https://github.com/w3f/arkworks-algebra", branch = 'master'}
45-
# ark-serialize = { git = "https://github.com/w3f/arkworks-algebra", branch = 'master'}
46-
# ark-serialize-derive = { git = "https://github.com/w3f/arkworks-algebra", branch = 'master'}
47-
# ark-bls12-381 = { git = "https://github.com/w3f/arkworks-curves", branch = 'skalman-bls12-377-wb-hash2curve'}
48-
# ark-bls12-377 = { git = "https://github.com/w3f/arkworks-curves", branch = 'skalman-bls12-377-wb-hash2curve'}
49-
# ark-std = { git = "https://github.com/arkworks-rs/std"}

src/double_pop.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,17 @@ impl<E: EngineBLS, H: DynDigest + Default + Clone> ProofOfPossession<E, H, Doubl
6161
Message::new_pop_message(b"", &public_key_as_bytes).hash_to_signature_curve::<E>();
6262
let public_key_hashed_to_signature_group_as_bytes =
6363
E::signature_point_to_byte(&public_key_hashed_to_signature_group);
64-
let random_oracle_seed = [
65-
public_key_hashed_to_signature_group_as_bytes,
66-
public_key_as_bytes,
67-
public_key_in_signature_group_as_bytes,
68-
E::signature_point_to_byte(&self.0),
69-
]
70-
.concat();
64+
let mut random_oracle_seed = Vec::with_capacity(
65+
public_key_hashed_to_signature_group_as_bytes.len()
66+
+ public_key_as_bytes.len()
67+
+ public_key_in_signature_group_as_bytes.len()
68+
+ E::SIGNATURE_SERIALIZED_SIZE,
69+
);
70+
71+
random_oracle_seed.extend_from_slice(&public_key_hashed_to_signature_group_as_bytes);
72+
random_oracle_seed.extend_from_slice(&public_key_as_bytes);
73+
random_oracle_seed.extend_from_slice(&public_key_in_signature_group_as_bytes);
74+
random_oracle_seed.extend_from_slice(&E::signature_point_to_byte(&self.0));
7175

7276
let hasher = <DefaultFieldHasher<H> as HashToField<
7377
<<E as EngineBLS>::PublicKeyGroup as Group>::ScalarField,

src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ extern crate sha3;
9999

100100
extern crate alloc;
101101

102-
#[cfg(feature = "serde")]
103-
extern crate serde;
104-
105102
use core::borrow::Borrow;
106103
use digest::DynDigest;
107104

0 commit comments

Comments
 (0)