|
SNAP Library, User Reference
2012-10-15 15:06:59
SNAP, a general purpose network analysis and graph mining library
|
Go to the source code of this file.
Classes | |
| class | TMd5Sig |
Typedefs | |
| typedef TB1Def::TB1 | uint1 |
| typedef TVec< TMd5Sig > | TMd5SigV |
Functions | |
| void | Init () |
| void | Transform (uint1 *buffer) |
| static void | Encode (uint1 *Dst, uint4 *Src, uint4 Len) |
| static void | Decode (uint4 *Dst, uint1 *Src, uint4 Len) |
| static void | MemCpy (uint1 *Dst, uint1 *Src, uint4 Len) |
| static void | MemSet (uint1 *Start, uint1 Val, uint4 Len) |
| static uint4 | RotateLeft (uint4 x, uint4 n) |
| static uint4 | F (uint4 x, uint4 y, uint4 z) |
| static uint4 | G (uint4 x, uint4 y, uint4 z) |
| static uint4 | H (uint4 x, uint4 y, uint4 z) |
| static uint4 | I (uint4 x, uint4 y, uint4 z) |
| static void | FF (uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) |
| static void | GG (uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) |
| static void | HH (uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) |
| static void | II (uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) |
| UndefCopyAssign (TMd5) | |
| TMd5 () | |
| static PMd5 | New () |
| TMd5 (const PSIn &SIn) | |
| static PMd5 | New (const PSIn &SIn) |
| TMd5 (TSIn &) | |
| static PMd5 | Load (TSIn &SIn) |
| void | Save (TSOut &) |
| void | Add (uchar *InBf, const int &InBfL) |
| void | Add (const PSIn &SIn) |
| void | Def () |
| void | GetSigMem (TMem &Mem) const |
| TStr | GetSigStr () const |
| static TStr | GetMd5SigStr (const PSIn &SIn) |
| static TStr | GetMd5SigStr (const TStr &Str) |
| static TStr | GetMd5SigStr (const TMem &Mem) |
| static bool | Check () |
Variables | |
| ClassTP(TMd5, PMd5) private typedef TB2Def::TB2 | uint2 |
| uint4 | state [4] |
| uint4 | count [2] |
| uint1 | buffer [64] |
| uint1 | Sig [16] |
| bool | DefP |
| typedef TB1Def::TB1 uint1 |
| static bool Check | ( | ) | [static] |
| void TMd5::Decode | ( | uint4 * | Dst, |
| uint1 * | Src, | ||
| uint4 | Len | ||
| ) | [static] |
| void TMom::Def | ( | ) |
Definition at line 187 of file md5.cpp.
{
unsigned char bits[8];
static uint1 PADDING[64]={
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
IAssert(!DefP);
Encode(bits, count, 8); // save number of bits
// Pad out to 56 mod 64.
uint index=uint4((count[0] >> 3) & 0x3f);
uint padLen=(index<56) ? (56-index) : (120-index);
Add(PADDING, padLen);
Add(bits, 8); // append length (before padding)
Encode(Sig, state, 16); // store state in digest
MemSet(buffer, 0, sizeof(*buffer)); // zeroize sensitive information
DefP=true;
}
| void TMd5::Encode | ( | uint1 * | Dst, |
| uint4 * | Src, | ||
| uint4 | Len | ||
| ) | [static] |
| static uint4 F | ( | uint4 | x, |
| uint4 | y, | ||
| uint4 | z | ||
| ) | [static] |
| static void FF | ( | uint4 & | a, |
| uint4 | b, | ||
| uint4 | c, | ||
| uint4 | d, | ||
| uint4 | x, | ||
| uint4 | s, | ||
| uint4 | ac | ||
| ) | [static] |
Definition at line 36 of file md5.h.
{
a+=F(b, c, d)+x+ac; a=RotateLeft(a, s)+b;}
| static uint4 G | ( | uint4 | x, |
| uint4 | y, | ||
| uint4 | z | ||
| ) | [static] |
| static TStr GetMd5SigStr | ( | const PSIn & | SIn | ) | [static] |
| static TStr GetMd5SigStr | ( | const TStr & | Str | ) | [static] |
Definition at line 66 of file md5.h.
{
return GetMd5SigStr(TStrIn::New(Str));}
| static TStr GetMd5SigStr | ( | const TMem & | Mem | ) | [static] |
Definition at line 68 of file md5.h.
{
return GetMd5SigStr(TMemIn::New(Mem));}
| void TMd5::GetSigMem | ( | TMem & | Mem | ) | const |
| TStr TMd5::GetSigStr | ( | ) | const |
Definition at line 214 of file md5.cpp.
{
IAssert(DefP);
TChA ChA(32);
for (int CdN=0; CdN<16; CdN++){
ChA+=TCh::GetHexCh(Sig[CdN]/16);
ChA+=TCh::GetHexCh(Sig[CdN]%16);
}
return ChA;
}
| static void GG | ( | uint4 & | a, |
| uint4 | b, | ||
| uint4 | c, | ||
| uint4 | d, | ||
| uint4 | x, | ||
| uint4 | s, | ||
| uint4 | ac | ||
| ) | [static] |
Definition at line 38 of file md5.h.
{
a+=G(b, c, d)+x+ac; a=RotateLeft(a, s)+b;}
| static uint4 H | ( | uint4 | x, |
| uint4 | y, | ||
| uint4 | z | ||
| ) | [static] |
| static void HH | ( | uint4 & | a, |
| uint4 | b, | ||
| uint4 | c, | ||
| uint4 | d, | ||
| uint4 | x, | ||
| uint4 | s, | ||
| uint4 | ac | ||
| ) | [static] |
Definition at line 40 of file md5.h.
{
a+=H(b, c, d)+x+ac; a=RotateLeft(a, s)+b;}
| static uint4 I | ( | uint4 | x, |
| uint4 | y, | ||
| uint4 | z | ||
| ) | [static] |
| static void II | ( | uint4 & | a, |
| uint4 | b, | ||
| uint4 | c, | ||
| uint4 | d, | ||
| uint4 | x, | ||
| uint4 | s, | ||
| uint4 | ac | ||
| ) | [static] |
Definition at line 42 of file md5.h.
{
a+=I(b, c, d)+x+ac; a=RotateLeft(a, s)+b;}
| void Init | ( | ) |
| static uint4 RotateLeft | ( | uint4 | x, |
| uint4 | n | ||
| ) | [static] |
| UndefCopyAssign | ( | TMd5 | ) |