diff options
author | lloyd <[email protected]> | 2009-01-28 01:16:43 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-01-28 01:16:43 +0000 |
commit | 155c64f3a99c20ea6481e60ac92c37586affcf5a (patch) | |
tree | bb09875d7829a183bcba05750ad407f159a1c93c | |
parent | d655cd14d718bb8e1af4a2986b10a4d4617dbadc (diff) |
Go back to entropy bits per byte, instead of total estimated entropy of
the buffer.
-rw-r--r-- | src/entropy/entropy_src.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/entropy/entropy_src.h b/src/entropy/entropy_src.h index aea6ad8f2..96ffcad0b 100644 --- a/src/entropy/entropy_src.h +++ b/src/entropy/entropy_src.h @@ -37,16 +37,16 @@ class Entropy_Accumulator return (collected_bits >= entropy_goal) ? 0 : (entropy_goal - collected_bits); } - void add(const void* bytes, u32bit length, u32bit estimated_entropy) + void add(const void* bytes, u32bit length, double entropy_bits_per_byte) { entropy_sink.update(reinterpret_cast<const byte*>(bytes), length); - collected_bits += std::min(estimated_entropy, length * 8); + collected_bits += std::min<u32bit>(8, entropy_bits_per_byte) * length; } template<typename T> - void add(const T& v, u32bit estimated_entropy) + void add(const T& v, double entropy_bits_per_byte) { - add(&v, sizeof(T), estimated_entropy); + add(&v, sizeof(T), entropy_bits_per_byte); } private: BufferedComputation& entropy_sink; |