5#ifndef DIGESTPP_PROVIDERS_MD5_HPP
6#define DIGESTPP_PROVIDERS_MD5_HPP
19namespace md5_functions
21 static inline void roundf(
int round, uint32_t& a, uint32_t& b, uint32_t& c, uint32_t& d,
const uint32_t* M)
27 static inline void roundg(
int round, uint32_t& a, uint32_t& b, uint32_t& c, uint32_t& d,
const uint32_t* M)
33 static inline void roundh(
int round, uint32_t& a, uint32_t& b, uint32_t& c, uint32_t& d,
const uint32_t* M)
39 static inline void roundi(
int round, uint32_t& a, uint32_t& b, uint32_t& c, uint32_t& d,
const uint32_t* M)
71 inline void update(
const unsigned char* data,
size_t len)
74 [
this](
const unsigned char* data,
size_t len) { transform(data, len); });
77 inline void final(
unsigned char*
hash)
84 memset(&m[pos], 0, 64 - pos);
88 memset(&m[0] + pos, 0, 56 - pos);
89 memcpy(&m[0] + (64 - 8), &total, 64 / 8);
91 memcpy(
hash, H.data(), 16);
103 inline void transform(
const unsigned char* data,
size_t num_blks)
105 const uint32_t* M =
reinterpret_cast<const uint32_t*
>(data);
106 for (uint64_t blk = 0; blk < num_blks; blk++, M += 16)
188 std::array<uint32_t, 4> H;
189 std::array<unsigned char, 64> m;
Definition md5_provider.hpp:48
size_t hash_size() const
Definition md5_provider.hpp:100
void clear()
Definition md5_provider.hpp:94
void update(const unsigned char *data, size_t len)
Definition md5_provider.hpp:71
~md5_provider()
Definition md5_provider.hpp:56
void init()
Definition md5_provider.hpp:61
md5_provider()
Definition md5_provider.hpp:52
static void roundh(int round, uint32_t &a, uint32_t &b, uint32_t &c, uint32_t &d, const uint32_t *M)
Definition md5_provider.hpp:33
static void roundf(int round, uint32_t &a, uint32_t &b, uint32_t &c, uint32_t &d, const uint32_t *M)
Definition md5_provider.hpp:21
static void roundg(int round, uint32_t &a, uint32_t &b, uint32_t &c, uint32_t &d, const uint32_t *M)
Definition md5_provider.hpp:27
static void roundi(int round, uint32_t &a, uint32_t &b, uint32_t &c, uint32_t &d, const uint32_t *M)
Definition md5_provider.hpp:39
uint32_t rotate_left(uint32_t x, unsigned n)
Definition functions.hpp:67
void zero_memory(void *v, size_t n)
Definition functions.hpp:85
void absorb_bytes(const unsigned char *data, size_t len, size_t bs, size_t bschk, unsigned char *m, size_t &pos, T &total, TF transform)
Definition absorb_data.hpp:16
digestpp namespace
Definition ascon.hpp:14
Definition md5_constants.hpp:16