| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

MD5.cpp File Reference

#include "LHCbMath/MD5.h"
#include <cassert>

Include dependency graph for MD5.cpp:

Go to the source code of this file.


Classes

class  Gaudi::Math::MD5::md5_engine

Functions

boost::uint8_t unhex (unsigned char C)
ostream & operator<< (ostream &os, const Gaudi::Math::MD5 &x)
void pack (boost::uint8_t *dst, const boost::uint32_t *src, boost::uint32_t size)
void unpack (boost::uint32_t *dst, const boost::uint8_t *src, boost::uint32_t size)
const boost::uint32_t S11 (7)
const boost::uint32_t S12 (12)
const boost::uint32_t S13 (17)
const boost::uint32_t S14 (22)
const boost::uint32_t S21 (5)
const boost::uint32_t S22 (9)
const boost::uint32_t S23 (14)
const boost::uint32_t S24 (20)
const boost::uint32_t S31 (4)
const boost::uint32_t S32 (11)
const boost::uint32_t S33 (16)
const boost::uint32_t S34 (23)
const boost::uint32_t S41 (6)
const boost::uint32_t S42 (10)
const boost::uint32_t S43 (15)
const boost::uint32_t S44 (21)
boost::uint32_t rol (boost::uint32_t x, boost::uint32_t n_bits)
boost::uint32_t F (boost::uint32_t x, boost::uint32_t y, boost::uint32_t z)
boost::uint32_t G (boost::uint32_t x, boost::uint32_t y, boost::uint32_t z)
boost::uint32_t H (boost::uint32_t x, boost::uint32_t y, boost::uint32_t z)
boost::uint32_t I (boost::uint32_t x, boost::uint32_t y, boost::uint32_t z)
void FF (boost::uint32_t &a, boost::uint32_t b, boost::uint32_t c, boost::uint32_t d, boost::uint32_t x, boost::uint32_t s, boost::uint32_t ac)
void GG (boost::uint32_t &a, boost::uint32_t b, boost::uint32_t c, boost::uint32_t d, boost::uint32_t x, boost::uint32_t s, boost::uint32_t ac)
void HH (boost::uint32_t &a, boost::uint32_t b, boost::uint32_t c, boost::uint32_t d, boost::uint32_t x, boost::uint32_t s, boost::uint32_t ac)
void II (boost::uint32_t &a, boost::uint32_t b, boost::uint32_t c, boost::uint32_t d, boost::uint32_t x, boost::uint32_t s, boost::uint32_t ac)

Function Documentation

boost::uint8_t @1::unhex ( unsigned char  C  )  [static]

Definition at line 82 of file MD5.cpp.

00082                                         {
00083             unsigned char c=tolower(C);
00084             boost::uint8_t x = ( c >= '0' && c <= '9' ? c-'0' :
00085                                ( c >= 'a' && c <='f'  ? 10+(c-'a') 
00086                                                       : 255 ) );
00087             if ( x&0xF0 ) {  /* whoah: C is not in [0-9a-fA-F] */ }
00088             return x;
00089     };

ostream& operator<< ( ostream &  os,
const Gaudi::Math::MD5 x 
)

Definition at line 102 of file MD5.cpp.

00102                                                         {
00103    return os << x.str(); 
00104 }

void @2::pack ( boost::uint8_t *  dst,
const boost::uint32_t *  src,
boost::uint32_t  size 
) [static]

Definition at line 144 of file MD5.cpp.

00144                                                                                {
00145         boost::uint32_t i(0);
00146         boost::uint32_t j(0);
00147 
00148         while (j < size) {
00149             dst[j+0] = static_cast<boost::uint8_t>((src[i] >>  0) & 0xff);
00150             dst[j+1] = static_cast<boost::uint8_t>((src[i] >>  8) & 0xff);
00151             dst[j+2] = static_cast<boost::uint8_t>((src[i] >> 16) & 0xff);
00152             dst[j+3] = static_cast<boost::uint8_t>((src[i] >> 24) & 0xff);
00153             ++i;
00154             j += 4;
00155         }
00156     }

void @2::unpack ( boost::uint32_t *  dst,
const boost::uint8_t *  src,
boost::uint32_t  size 
) [static]

Definition at line 158 of file MD5.cpp.

00158                                                                                  {
00159         boost::uint32_t i(0);
00160         boost::uint32_t j(0);
00161 
00162         while (j < size) {
00163             dst[i] =
00164                 (static_cast<boost::uint32_t>(src[j+0]) <<  0) |
00165                 (static_cast<boost::uint32_t>(src[j+1]) <<  8) |
00166                 (static_cast<boost::uint32_t>(src[j+2]) << 16) |
00167                 (static_cast<boost::uint32_t>(src[j+3]) << 24);
00168             ++i;
00169             j += 4;
00170         }
00171     }

const boost::uint32_t @2::S11 (  )  [static]

const boost::uint32_t @2::S12 ( 12   )  [static]

const boost::uint32_t @2::S13 ( 17   )  [static]

const boost::uint32_t @2::S14 ( 22   )  [static]

const boost::uint32_t @2::S21 (  )  [static]

const boost::uint32_t @2::S22 (  )  [static]

const boost::uint32_t @2::S23 ( 14   )  [static]

const boost::uint32_t @2::S24 ( 20   )  [static]

const boost::uint32_t @2::S31 (  )  [static]

const boost::uint32_t @2::S32 ( 11   )  [static]

const boost::uint32_t @2::S33 ( 16   )  [static]

const boost::uint32_t @2::S34 ( 23   )  [static]

const boost::uint32_t @2::S41 (  )  [static]

const boost::uint32_t @2::S42 ( 10   )  [static]

const boost::uint32_t @2::S43 ( 15   )  [static]

const boost::uint32_t @2::S44 ( 21   )  [static]

boost::uint32_t @2::rol ( boost::uint32_t  x,
boost::uint32_t  n_bits 
) [inline, static]

Definition at line 191 of file MD5.cpp.

00191 { return (x << n_bits) | (x >> (32-n_bits)); }

boost::uint32_t @2::F ( boost::uint32_t  x,
boost::uint32_t  y,
boost::uint32_t  z 
) [inline, static]

Definition at line 197 of file MD5.cpp.

00197 { return (x & y) | (~x & z); }

boost::uint32_t @2::G ( boost::uint32_t  x,
boost::uint32_t  y,
boost::uint32_t  z 
) [inline, static]

Definition at line 198 of file MD5.cpp.

00198 { return (x & z) | (y & ~z); }

boost::uint32_t @2::H ( boost::uint32_t  x,
boost::uint32_t  y,
boost::uint32_t  z 
) [inline, static]

Definition at line 199 of file MD5.cpp.

00199 { return x ^ y ^ z; }

boost::uint32_t @2::I ( boost::uint32_t  x,
boost::uint32_t  y,
boost::uint32_t  z 
) [inline, static]

Definition at line 200 of file MD5.cpp.

00200 { return y ^ (x | ~z); }

void @2::FF ( boost::uint32_t &  a,
boost::uint32_t  b,
boost::uint32_t  c,
boost::uint32_t  d,
boost::uint32_t  x,
boost::uint32_t  s,
boost::uint32_t  ac 
) [inline, static]

Definition at line 206 of file MD5.cpp.

00207     {
00208         a += F(b, c, d) + x + ac;
00209         a = rol(a, s) + b;
00210     }

void @2::GG ( boost::uint32_t &  a,
boost::uint32_t  b,
boost::uint32_t  c,
boost::uint32_t  d,
boost::uint32_t  x,
boost::uint32_t  s,
boost::uint32_t  ac 
) [inline, static]

Definition at line 212 of file MD5.cpp.

00213     {
00214         a += G(b, c, d) + x + ac;
00215         a = rol(a, s) + b;
00216     }

void @2::HH ( boost::uint32_t &  a,
boost::uint32_t  b,
boost::uint32_t  c,
boost::uint32_t  d,
boost::uint32_t  x,
boost::uint32_t  s,
boost::uint32_t  ac 
) [inline, static]

Definition at line 218 of file MD5.cpp.

00219     {
00220         a += H(b, c, d) + x + ac;
00221         a = rol(a, s) + b;
00222     }

void @2::II ( boost::uint32_t &  a,
boost::uint32_t  b,
boost::uint32_t  c,
boost::uint32_t  d,
boost::uint32_t  x,
boost::uint32_t  s,
boost::uint32_t  ac 
) [inline, static]

Definition at line 224 of file MD5.cpp.

00225     {
00226         a += I(b, c, d) + x + ac;
00227         a = rol(a, s) + b;
00228     }

| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:02:58 2011 for LHCbMath by doxygen 1.4.7