hash: use new iterator namespace

This commit is contained in:
Danny Robson 2019-03-19 21:32:13 +11:00
parent 777c4ef2d8
commit bf27d731e4
2 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@
#include "md5.hpp" #include "md5.hpp"
#include <cruft/util/std.hpp> #include <cruft/util/std.hpp>
#include <cruft/util/iterator.hpp> #include <cruft/util/iterator/transform.hpp>
#include <cruft/util/bitwise.hpp> #include <cruft/util/bitwise.hpp>
#include <cruft/util/debug.hpp> #include <cruft/util/debug.hpp>
@ -109,7 +109,7 @@ MD5::operator() (
// note we pass in a windowed view of the state block, not the whole // note we pass in a windowed view of the state block, not the whole
// thing. // thing.
cruft::transform_by_block ( cruft::iterator::transform_by_block (
cruft::view {X.b}, cruft::view {X.b},
[&,this] (auto) { ABCD = transform (ABCD, X.w); }, [&,this] (auto) { ABCD = transform (ABCD, X.w); },
data_a, data_b, data_c data_a, data_b, data_c

View File

@ -8,11 +8,11 @@
#include "sha1.hpp" #include "sha1.hpp"
#include <cruft/util/iterator.hpp>
#include <cruft/util/bitwise.hpp> #include <cruft/util/bitwise.hpp>
#include <cruft/util/cast.hpp>
#include <cruft/util/debug.hpp> #include <cruft/util/debug.hpp>
#include <cruft/util/endian.hpp> #include <cruft/util/endian.hpp>
#include <cruft/util/cast.hpp> #include <cruft/util/iterator/transform.hpp>
#include <algorithm> #include <algorithm>
#include <cstdint> #include <cstdint>
@ -130,7 +130,7 @@ SHA1::operator() (
H.w = INITIAL_H; H.w = INITIAL_H;
/* UPDATE */ /* UPDATE */
transform_by_block ( cruft::iterator::transform_by_block (
cruft::view {state.c.data (), BLOCK_BYTES }, cruft::view {state.c.data (), BLOCK_BYTES },
[&] (auto) { process (H.w, state.W); }, [&] (auto) { process (H.w, state.W); },
data_a, data_b data_a, data_b