oln::utils::MD5 Class Reference

Class used to compute a MD5 digest. More...

#include <md5.hh>

Collaboration diagram for oln::utils::MD5:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ntg::int_u32 value_type
 Value to work on.

typedef ntg::type_traits<
value_type >::storage_type 
storage_type
 Representation type of value type.


Public Member Functions

 MD5 (buffer b)
 Constructor.

key execute ()
 Compute the digest.

key gen_key ()
 Generate the key.


Protected Member Functions

void sav ()
 initialization of a MD5 algorithm step.

void round1 ()
 Round 1 of the algorithm.

void round2 ()
 Round 2 of the algorithm.

void round3 ()
 Round 3 of the algorithm.

void round4 ()
 Round 4 of the algorithm.

void step ()
 A step of the algorithm.

template<class Fun> void sub_step (const Fun &fun, storage_type &a, const storage_type &b, const storage_type &c, const storage_type &d, unsigned k, unsigned s, unsigned i)
 Sub step to update a register value.

void gen_sub_key (std::vector< key::value_type > &v, storage_type x, unsigned base)
 Generate a sub part of the key.


Protected Attributes

buffer buffer_
 The buffer to process.

std::vector< storage_typeX
 Vector of 16 words.

std::vector< storage_typeT
 Vector of 64 words.

unsigned current_
 Current position in the buffer.

storage_type aa
 Save of a.

storage_type bb
 Save of b.

storage_type cc
 Save of c.

storage_type dd
 Save of d.

storage_type a
 A register.

storage_type b
 B register.

storage_type c
 C register.

storage_type d
 D register.

struct {
storage_type operator() (const storage_type &x, const storage_type &y, const storage_type &z) const
F
 Functor for bit operations.

struct {
storage_type operator() (const storage_type &x, const storage_type &y, const storage_type &z) const
G
 Functor for bit operations.

struct {
storage_type operator() (const storage_type &x, const storage_type &y, const storage_type &z) const
H
 Functor for bit operations.

struct {
storage_type operator() (const storage_type &x, const storage_type &y, const storage_type &z) const
I
 Functor for bit operations.


Detailed Description

Class used to compute a MD5 digest.

Definition at line 44 of file md5.hh.


Constructor & Destructor Documentation

oln::utils::MD5::MD5 buffer  b  )  [inline, explicit]
 

Constructor.

Initialization from a buffer.

  • The buffer to use.

Definition at line 234 of file md5.hh.


Member Function Documentation

key oln::utils::MD5::gen_key  )  [inline]
 

Generate the key.

Precondition:
To avoid meaningless result, you should call execute before.

Definition at line 465 of file md5.hh.

void oln::utils::MD5::gen_sub_key std::vector< key::value_type > &  v,
storage_type  x,
unsigned  base
[inline, protected]
 

Generate a sub part of the key.

  • v Vector of values (output).
  • x Data to put in v.
  • base Where to put x in v.

Definition at line 452 of file md5.hh.


Member Data Documentation

struct { ... } oln::utils::MD5::F [protected]
 

Functor for bit operations.

F(X,Y,Z) = XY v not(X) Z

struct { ... } oln::utils::MD5::G [protected]
 

Functor for bit operations.

G(X,Y,Z) = XZ v Y not(Z)

struct { ... } oln::utils::MD5::H [protected]
 

Functor for bit operations.

H(X,Y,Z) = X xor Y xor Z

struct { ... } oln::utils::MD5::I [protected]
 

Functor for bit operations.

I(X,Y,Z) = Y xor (X v not(Z))


The documentation for this class was generated from the following file:
Generated on Thu Apr 15 20:17:25 2004 for Olena by doxygen 1.3.6-20040222