From 5d2ea73ab4a35c8136eaff86df02b1c23131976b Mon Sep 17 00:00:00 2001 From: lloyd Date: Sun, 23 Nov 2008 21:43:28 +0000 Subject: Modify es_ftw to use xor_into_buf --- src/entropy/proc_walk/es_ftw.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/entropy/proc_walk/es_ftw.cpp b/src/entropy/proc_walk/es_ftw.cpp index 013bb922b..f92a0cf82 100644 --- a/src/entropy/proc_walk/es_ftw.cpp +++ b/src/entropy/proc_walk/es_ftw.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include @@ -118,12 +118,13 @@ u32bit FTW_EntropySource::slow_poll(byte buf[], u32bit length) SecureVector read_buf(4096); u32bit bytes_read = 0; + u32bit buf_i = 0; while(bytes_read < length * 32) { int fd = dir->next_fd(); - if(fd == -1) + if(fd == -1) // re-walk { delete dir; dir = new Directory_Walker(path); @@ -137,8 +138,7 @@ u32bit FTW_EntropySource::slow_poll(byte buf[], u32bit length) if(got > 0 && got <= read_buf.size()) { - for(ssize_t i = 0; i != got; ++i) - buf[i % length] ^= read_buf[i]; + buf_i = xor_into_buf(buf, buf_i, length, read_buf, got); // never count any one file for more than 128 bytes bytes_read += std::min(got, 128); -- cgit v1.2.3