From 59c6ed9512c21143cb55f6bfe7fb2ba8f925361c Mon Sep 17 00:00:00 2001 From: clemahieu Date: Sat, 12 Sep 2015 02:38:57 -0500 Subject: [PATCH] Entries needs to be a power of two. --- rai/node.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/rai/node.cpp b/rai/node.cpp index 2ef4b5d5..634d2dd2 100644 --- a/rai/node.cpp +++ b/rai/node.cpp @@ -1682,6 +1682,7 @@ rai::uint256_union rai::kdf::generate (std::string const & password_a, rai::uint blake2b_init (&hash, 32); auto entries_l (entries); auto mask (entries_l - 1); + assert ((mask & entries_l) == 0); // Seed our random sequence with the mixed input xorshift1024star rng; rng.s [0] = input.qwords [0];