Skip to content

Commit

Permalink
Merge pull request #426 from filecoin-project/optimization/reduce-fei…
Browse files Browse the repository at this point in the history
…stel-rounds

Reduce feistel rounds from 4 to 3.
  • Loading branch information
porcuquine authored Jan 3, 2019
2 parents 3381400 + 7c53bf4 commit 33d5640
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage-proofs/src/crypto/feistel.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use blake2::{Blake2s, Digest};

pub const FEISTEL_ROUNDS: usize = 3;
pub type FeistelPrecomputed = (u32, u32, u32);

pub fn precompute(num_elements: u32) -> FeistelPrecomputed {
Expand Down Expand Up @@ -55,7 +56,6 @@ fn common_setup(index: u32, precomputed: FeistelPrecomputed) -> (u32, u32, u32,

(left, right, right_mask, half_bits)
}
pub const FEISTEL_ROUNDS: usize = 4;

fn encode(index: u32, keys: &[u32], precomputed: FeistelPrecomputed) -> u32 {
let (mut left, mut right, right_mask, half_bits) = common_setup(index, precomputed);
Expand Down

0 comments on commit 33d5640

Please sign in to comment.