chromium/third_party/unrar/src/hash.cpp

#include "rar.hpp"

void HashValue::Init(HASH_TYPE Type)
{}


bool HashValue::operator == (const HashValue &cmp) const
{}


DataHash::DataHash()
{}


DataHash::~DataHash()
{}


void DataHash::Init(HASH_TYPE Type,uint MaxThreads)
{}


void DataHash::Update(const void *Data,size_t DataSize)
{}


#ifdef RAR_SMP
THREAD_PROC(BuildCRC32Thread)
{}


// CRC is linear and distributive over addition, so CRC(a+b)=CRC(a)+CRC(b).
// Since addition in finite field is XOR, we have CRC(a^b)=CRC(a)^CRC(b).
// So CRC(aaabbb) = CRC(aaa000) ^ CRC(000bbb) = CRC(aaa000) ^ CRC(bbb),
// because CRC ignores leading zeroes. Thus to split CRC calculations
// to "aaa" and "bbb" blocks and then to threads we need to be able to
// find CRC(aaa000) knowing "aaa" quickly. We use Galois finite field to
// calculate the power of 2 to get "1000" and multiply it by "aaa".
void DataHash::UpdateCRC32MT(const void *Data,size_t DataSize)
{}
#endif


uint DataHash::BitReverse32(uint N)
{}


// Galois field multiplication modulo POLY.
uint DataHash::gfMulCRC(uint A, uint B)
{}


// Calculate 2 power N with square-and-multiply algorithm.
uint DataHash::gfExpCRC(uint N)
{}


void DataHash::Result(HashValue *Result)
{}


uint DataHash::GetCRC32()
{}


bool DataHash::Cmp(HashValue *CmpValue,byte *Key)
{}