hash: use new view casting api

This commit is contained in:
Danny Robson 2018-06-01 15:59:01 +10:00
parent 2b8b733bfd
commit 974f5a50e7
4 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ using cruft::crypto::hash::HOTP;
///////////////////////////////////////////////////////////////////////////////
HOTP::HOTP (util::view<const char*> _key, uint64_t _counter):
m_counter (_counter),
m_hash (_key.template cast<const uint8_t> ())
m_hash (_key.template cast<const uint8_t*> ())
{ ; }

View File

@ -48,7 +48,7 @@ main (int, char **) {
const MD2 h;
for (const auto &i: TESTS) {
if (h (util::view{i.input}.cast<const uint8_t> ()) != i.output) {
if (h (util::view{i.input}.cast<const uint8_t*> ()) != i.output) {
std::cerr << "Failed on " << i.input << "\n";
success = false;
}

View File

@ -56,7 +56,7 @@ main (int, char**) {
MD4 h;
for (auto i: TESTS) {
if (h (util::view{i.input}.cast <const uint8_t> ()) != i.output) {
if (h (util::view{i.input}.cast <const uint8_t*> ()) != i.output) {
std::cerr << "Failed on '" << i.input << "'\n";
success = false;
}

View File

@ -56,7 +56,7 @@ main (int, char **) {
for (const auto &i: TESTS) {
SHA256 obj;
tap.expect_eq (obj (util::view{i.input}.cast<const uint8_t> ()), i.output, "%s", i.msg);
tap.expect_eq (obj (util::view{i.input}.cast<const uint8_t*> ()), i.output, "%s", i.msg);
}
return tap.status ();