Skip to content

Commit

Permalink
Update proofs-api to 4.0.1 (#523)
Browse files Browse the repository at this point in the history
* Update proofs-api to released version

* chacha lmao

* fmt
  • Loading branch information
austinabell authored Jun 26, 2020
1 parent 6e33c23 commit 95a2fcc
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 126 deletions.
252 changes: 135 additions & 117 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion blockchain/chain_sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ futures = "0.3.5"
lru = "0.5.1"
thiserror = "1.0"
num-traits = "0.2"
filecoin-proofs-api = { git = "https://github.com/filecoin-project/rust-filecoin-proofs-api", rev = "e06075834b7df8b3618b13122176fa9a40c2b380" }
filecoin-proofs-api = "4.0.1"
fil_types = { path = "../../types" }
commcid = { path = "../../utils/commcid" }

Expand Down
2 changes: 1 addition & 1 deletion blockchain/state_manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ chain = { path = "../chain" }
async-std = "1.5.0"
async-log = "2.0.0"
log = "0.4.8"
filecoin-proofs-api = { git = "https://github.com/filecoin-project/rust-filecoin-proofs-api", rev = "e06075834b7df8b3618b13122176fa9a40c2b380" }
filecoin-proofs-api = "4.0.1"
fil_types = { path = "../../types" }
1 change: 1 addition & 0 deletions crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ base64 = { version = "0.12.1", optional = true }

[dev-dependencies]
rand = "0.7.3"
rand_chacha = "0.2.2"

[features]
json = ["base64"]
8 changes: 4 additions & 4 deletions crypto/src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,16 @@ pub fn ecrecover(hash: &[u8; 32], signature: &[u8; 65]) -> Result<Address, Error
mod tests {
use super::*;
use bls_signatures::{PrivateKey, Serialize, Signature as BlsSignature};
use rand::rngs::mock::StepRng;
use rand::Rng;
use rand::{Rng, SeedableRng};
use rand_chacha::ChaCha8Rng;

#[test]
fn bls_agg_verify() {
// The number of signatures in aggregate
let num_sigs = 10;
let message_length = num_sigs * 64;

let rng = &mut StepRng::new(8, 3);
let rng = &mut ChaCha8Rng::seed_from_u64(11);

let msg = (0..message_length).map(|_| rng.gen()).collect::<Vec<u8>>();
let data: Vec<&[u8]> = (0..num_sigs).map(|x| &msg[x * 64..(x + 1) * 64]).collect();
Expand All @@ -231,7 +231,7 @@ mod tests {
}

let calculated_bls_agg =
Signature::new_bls(bls_signatures::aggregate(&signatures).as_bytes());
Signature::new_bls(bls_signatures::aggregate(&signatures).unwrap().as_bytes());
assert_eq!(
verify_bls_aggregate(&data, &public_keys_slice, &calculated_bls_agg),
true
Expand Down
2 changes: 1 addition & 1 deletion types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ features = ["json"]
[dependencies]
serde = { version = "1.0", features = ["derive"] }
commcid = { path = "../utils/commcid" }
filecoin-proofs-api = { git = "https://github.com/filecoin-project/rust-filecoin-proofs-api", rev = "e06075834b7df8b3618b13122176fa9a40c2b380" }
filecoin-proofs-api = "4.0.1"
vm = { package = "forest_vm", path = "../vm" }
cid = { package = "forest_cid", path = "../ipld/cid", features = ["cbor"] }
num-bigint = { path = "../utils/bigint", package = "forest_bigint" }
Expand Down
2 changes: 1 addition & 1 deletion utils/commcid/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2018"
num-traits = "0.2"
num-derive = "0.3"
cid = { package = "forest_cid", path = "../../ipld/cid" }
filecoin-proofs-api = { git = "https://github.com/filecoin-project/rust-filecoin-proofs-api", rev = "e06075834b7df8b3618b13122176fa9a40c2b380" }
filecoin-proofs-api = "4.0.1"

[dev-dependencies]
rand = "0.7.3"
2 changes: 1 addition & 1 deletion vm/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ipld_blockstore = { path = "../../ipld/blockstore" }
clock = { path = "../../node/clock" }
forest_encoding = { path = "../../encoding" }
commcid = { path = "../../utils/commcid" }
filecoin-proofs-api = { git = "https://github.com/filecoin-project/rust-filecoin-proofs-api", rev = "e06075834b7df8b3618b13122176fa9a40c2b380" }
filecoin-proofs-api = "4.0.1"
base64 = "0.12.1"
fil_types = { path = "../../types" }
log = "0.4.8"
Expand Down

0 comments on commit 95a2fcc

Please sign in to comment.