Skip to content

Commit

Permalink
Merge pull request #1150 from filecoin-project/fix/finish-propagating…
Browse files Browse the repository at this point in the history
…-porep_id

fix: finish propagating porep_id.
  • Loading branch information
porcuquine authored Jun 4, 2020
2 parents b9126bf + 4a07a07 commit b6bf96f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
6 changes: 1 addition & 5 deletions storage-proofs/core/src/drgraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::marker::PhantomData;

use anyhow::ensure;
use generic_array::typenum;
use rand::{rngs::OsRng, Rng, SeedableRng};
use rand::{Rng, SeedableRng};
use rand_chacha::ChaCha8Rng;
use sha2::{Digest, Sha256};

Expand Down Expand Up @@ -230,10 +230,6 @@ impl<H: Hasher> Graph<H> for BucketGraph<H> {
}
}

pub fn new_seed() -> [u8; 28] {
OsRng.gen()
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
1 change: 0 additions & 1 deletion storage-proofs/porep/benches/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion, Throughpu
use ff::Field;
use paired::bls12_381::Fr;
use rand::thread_rng;
use storage_proofs_core::drgraph::new_seed;
use storage_proofs_core::fr32::fr_into_bytes;
use storage_proofs_core::hasher::sha256::Sha256Hasher;
use storage_proofs_core::hasher::{Domain, Hasher};
Expand Down
2 changes: 1 addition & 1 deletion storage-proofs/porep/src/drg/vanilla.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ mod tests {
use rand_xorshift::XorShiftRng;
use storage_proofs_core::{
cache_key::CacheKey,
drgraph::{new_seed, BucketGraph, BASE_DEGREE},
drgraph::{BucketGraph, BASE_DEGREE},
fr32::fr_into_bytes,
hasher::{Blake2sHasher, PedersenHasher, Sha256Hasher},
merkle::{BinaryMerkleTree, MerkleTreeTrait},
Expand Down
3 changes: 1 addition & 2 deletions storage-proofs/porep/src/stacked/vanilla/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ use storage_proofs_core::{

/// The expansion degree used for Stacked Graphs.
pub const EXP_DEGREE: usize = 8;
const FEISTEL_KEYS: [feistel::Index; 4] = [1, 2, 3, 4];

const DEGREE: usize = BASE_DEGREE + EXP_DEGREE;

Expand Down Expand Up @@ -437,7 +436,7 @@ where
let transformed = feistel::permute(
self.size() as feistel::Index * self.expansion_degree as feistel::Index,
a,
&FEISTEL_KEYS,
&self.feistel_keys,
self.feistel_precomputed,
);
transformed as u32 / self.expansion_degree as u32
Expand Down

0 comments on commit b6bf96f

Please sign in to comment.