SNAP Library, Developer 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 |
Referenced by TVec< TVal >::AddBackSorted(), TLocClustStat::AddCut(), TVec< TVal >::AddSorted(), TVec< TVal >::AddUnique(), TVec< TVal >::AddV(), Def(), T8BitCodec< TEncoding_ISO8859_3 >::FromUnicode(), TVec< TVal >::Ins(), TVec< TVal >::LoadXml(), TVec< TVal >::Merge(), TUniChDb::TestWbFindNonIgnored(), TMd5(), and TMom().
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.
References Add(), buffer, count, DefP, Encode(), IAssert, MemSet(), Sig, and state.
Referenced by TMd5(), and TMom().
{ 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] |
Definition at line 129 of file md5.cpp.
Referenced by Def().
{ for (uint4 i=0, j=0; j<len; i++, j+=4){ output[j]=uint1(input[i] & 0xff); output[j+1]=uint1((input[i]>>8) & 0xff); output[j+2]=uint1((input[i]>>16) & 0xff); output[j+3]=uint1((input[i]>>24) & 0xff); } }
static uint4 F | ( | uint4 | x, |
uint4 | y, | ||
uint4 | z | ||
) | [static] |
Definition at line 30 of file md5.h.
Referenced by FF(), TAGM::GVizComGraph(), TTimeNet::LoadAmazon(), TTimeNet::PlotMedianDegOverTm(), TLocClustStat::PlotPhiInOut(), TSnap::PrintInfo(), TGHash< TDat >::SaveDetailTxt(), TSnap::SaveEdgeList(), TTimeNENet::SaveEdgeTm(), TSnap::SaveGViz(), TGraphKey::SaveGViz(), TSnap::SaveMatlabSparseMtx(), TSnap::SavePajek(), TLocClust::SavePajek(), TGnuPlot::SaveTs(), TKronMtx::SaveTxt(), TCnCom::SaveTxt(), TGStatVec::SaveTxt(), TNcpGraphsBase::SaveTxt(), TGHash< TDat >::SaveTxt(), TLocClustStat::SaveTxtInfo(), TNcpGraphsBase::SaveTxtNcpMin(), TUniChDb::TestCaseConversions(), TSparseRowMatrix::TSparseRowMatrix(), and TMAGFitBern::UpdateApxPhiMI().
{return (x&y)|(~x&z);}
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.
References F(), and RotateLeft().
Referenced by TFfGGen::GenFFGraphs().
{ a+=F(b, c, d)+x+ac; a=RotateLeft(a, s)+b;}
static uint4 G | ( | uint4 | x, |
uint4 | y, | ||
uint4 | z | ||
) | [static] |
Definition at line 31 of file md5.h.
Referenced by TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TUndirFFire::BurnGeoFire(), TAGM::GenAGM(), TSnap::GenGeoPrefAttach(), TSnap::GenRndBipart(), TSnap::GenRndDegK(), TSnap::GenRndPowerLaw(), TD34GraphCounter::GetGraph(), TCliqueOverlap::GetMaximalCliques(), TGraphKey::GetNGraph(), TNGraph::GetSmallGraph(), GG(), TSnap::LoadDyNet(), TSnap::LoadDyNetGraphV(), TGStatVec::SaveTxt(), TKronMomentsFit::Test(), and TNetConstraint< PGraph >::Test().
{return (x&z)|(y&~z);}
static TStr GetMd5SigStr | ( | const PSIn & | SIn | ) | [static] |
Definition at line 64 of file md5.h.
References New().
Referenced by GetMd5SigStr().
{ PMd5 Md5=TMd5::New(SIn); return Md5->GetSigStr();}
static TStr GetMd5SigStr | ( | const TStr & | Str | ) | [static] |
Definition at line 66 of file md5.h.
References GetMd5SigStr(), and TStrIn::New().
{ return GetMd5SigStr(TStrIn::New(Str));}
static TStr GetMd5SigStr | ( | const TMem & | Mem | ) | [static] |
Definition at line 68 of file md5.h.
References GetMd5SigStr(), and TMemIn::New().
{ return GetMd5SigStr(TMemIn::New(Mem));}
void TMd5::GetSigMem | ( | TMem & | Mem | ) | const |
TStr TMd5::GetSigStr | ( | ) | const |
Definition at line 214 of file md5.cpp.
References DefP, TCh::GetHexCh(), IAssert, and Sig.
{ 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.
References G(), and RotateLeft().
{ a+=G(b, c, d)+x+ac; a=RotateLeft(a, s)+b;}
static uint4 H | ( | uint4 | x, |
uint4 | y, | ||
uint4 | z | ||
) | [static] |
Definition at line 32 of file md5.h.
Referenced by TSpecFunc::EntropyBias(), TSecTm::GetDtTmFromStr(), and HH().
{return x^y^z;}
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.
References H(), and RotateLeft().
{ a+=H(b, c, d)+x+ac; a=RotateLeft(a, s)+b;}
static uint4 I | ( | uint4 | x, |
uint4 | y, | ||
uint4 | z | ||
) | [static] |
Definition at line 33 of file md5.h.
Referenced by TSnap::GetFarnessCentr(), TSparseSet< TKey, GroupSize >::GetKeyV(), TBigNet< TNodeData, IsDir >::GetNIdV(), II(), TBigNet< TNodeData, IsDir >::InvertFromSources(), TSnap::TSnapDetail::TCNMQMatrix::MergeBestQ(), TBigNet< TNodeData, IsDir >::SaveToDisk(), and TUniChDb::TestCaseConversions().
{return y^(x|~z);}
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.
References I(), and RotateLeft().
{ a+=I(b, c, d)+x+ac; a=RotateLeft(a, s)+b;}
void Init | ( | ) |
static PMd5 New | ( | ) | [static] |
static uint4 RotateLeft | ( | uint4 | x, |
uint4 | n | ||
) | [static] |
TMd5 | ( | ) |
UndefCopyAssign | ( | TMd5 | ) |
uint4 count[2] |
Definition at line 12 of file md5.h.
Referenced by TMAGFitBern::ComputeJointLL(), Def(), TInt::LoadFrugalIntV(), TInt::SaveFrugalIntV(), and TKroneckerLL::SetRandomEdges().
bool DefP |
Definition at line 15 of file md5.h.
Referenced by Add(), Def(), GetDecile(), GetExtent(), GetMean(), GetMedian(), GetMn(), GetMx(), GetPercentile(), GetQuart1(), GetQuart3(), GetSDev(), GetSErr(), GetSigMem(), GetSigStr(), GetVari(), IsDef(), IsUsable(), operator=(), and Save().
Definition at line 14 of file md5.h.
Referenced by Def(), TKronMtx::GetNodeSig(), GetSigMem(), and GetSigStr().