110 enum Permutation { ABCD , DABC , CDAB , BCDA } ;
120 void calculate(
const block & ) ;
122 static big_t rot32(
small_t places , big_t n ) ;
125 void round1(
const block & ) ;
126 void round2(
const block & ) ;
127 void round3(
const block & ) ;
128 void round4(
const block & ) ;
129 static big_t F( big_t x , big_t y , big_t z ) ;
130 static big_t
G( big_t x , big_t y , big_t z ) ;
131 static big_t H( big_t x , big_t y , big_t z ) ;
132 static big_t I( big_t x , big_t y , big_t z ) ;
203 void operator=(
const block & ) ;
void add(const string_type &)
Adds more message data.
A class that calculates an md5 digest from a data stream using the algorithm described by RFC 1321...
size_type big_t
To hold at least 32 bits, maybe more. Try unsigned long on small systems.
void close()
Called after the last add().
size_type small_t
To hold at least a size_t. Must fit in a big_t.
std::string::size_type size_type
A std::size_t type.
big_t X(small_t) const
Returns a value from within the block. See RFC 1321.
block(const string_type &s, small_t block_offset, big_t end_value)
Constructor.
digest()
Default constructor.
Holds the md5 algorithm state. Used by md5::digest.
A helper class used by the md5::digest implementation to represent a 64-character data block...
std::string string_type
A string type.
static small_t blocks(small_t data_length)
Takes the total number of bytes in the input message and returns the number of 64-byte blocks...
char assert_small_t_is_big_enough[sizeof(small_t)>=sizeof(size_type)?1:-1]
A static assertion check.
A class that calculates an md5 digest from one or more 64-byte blocks of data using the algorithm des...
small_t size() const
Returns how many data bytes have been accumulated so far.
A standalone implementation of the MD5 hashing algorithm.
state_type state() const
Returns the internal state.
state_type state() const
Returns the current state.
static big_t end(small_t data_length)
Takes the total number of bytes in the input message and returns a value which can be passed to the c...
digest_stream()
Default constructor.
char assert_big_t_is_big_enough[sizeof(big_t)>=4U?1:-1]
A static assertion check.
void add(const block &)
Adds a 64-byte block of the message.
< Holds the state of an md5 digest stream. Used by md5::digest_stream.