Public Member Functions | Static Public Member Functions | List of all members
md5::block Class Reference

A helper class used by the md5::digest implementation to represent a 64-character data block. More...

#include <md5.h>

Public Member Functions

 block (const string_type &s, small_t block_offset, big_t end_value)
 Constructor. More...
 
big_t X (small_t) const
 Returns a value from within the block. See RFC 1321. More...
 

Static Public Member Functions

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 constructor's third parameter. More...
 
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, allowing for padding. More...
 

Detailed Description

A helper class used by the md5::digest implementation to represent a 64-character data block.

Definition at line 167 of file md5.h.

Constructor & Destructor Documentation

md5::block::block ( const string_type s,
small_t  block_offset,
big_t  end_value 
)

Constructor.

Unusually, the string reference is kept, so beware of binding temporaries.

The 'block-offset' indicates, in units of 64-character blocks, how far down 's' the current block's data is.

The string must hold at least 64 bytes beyond the 'block-offset' point, except for the last block in a message sequence. Note that this is the number of blocks, not the number of bytes.

The 'end-value' is derived from the length of the full message (not just the current block). It is only used for the last block. See end().

Definition at line 315 of file md5.cpp.

Member Function Documentation

md5::small_t md5::block::blocks ( small_t  data_length)
static

Takes the total number of bytes in the input message and returns the number of 64-byte blocks, allowing for padding.

In practice 0..55 maps to 1, 56..119 maps to 2, etc.

Definition at line 335 of file md5.cpp.

Referenced by md5::digest::digest().

md5::big_t md5::block::end ( small_t  data_length)
static

Takes the total number of bytes in the input message and returns a value which can be passed to the constructor's third parameter.

This is used for the last block in the sequence of blocks that make up a complete message.

Definition at line 322 of file md5.cpp.

Referenced by md5::digest_stream::close(), and md5::digest::digest().

md5::big_t md5::block::X ( small_t  dword_index) const

Returns a value from within the block. See RFC 1321.

Definition at line 341 of file md5.cpp.


The documentation for this class was generated from the following files: