| 253 | |
| 254 | |
| 255 | void CAICHHashTree::SetBlockHash(uint64 nSize, uint64 nStartPos, CAICHHashAlgo* pHashAlg) |
| 256 | { |
| 257 | wxASSERT ( nSize <= EMBLOCKSIZE ); |
| 258 | CAICHHashTree* pToInsert = FindHash(nStartPos, nSize); |
| 259 | if (pToInsert == NULL) { // sanity |
| 260 | wxFAIL; |
| 261 | AddDebugLogLineN(logSHAHashSet, "Critical Error: Failed to Insert SHA-HashBlock, FindHash() failed!"); |
| 262 | return; |
| 263 | } |
| 264 | |
| 265 | //sanity |
| 266 | if (pToInsert->m_nBaseSize != EMBLOCKSIZE || pToInsert->m_nDataSize != nSize) { |
| 267 | wxFAIL; |
| 268 | AddDebugLogLineN(logSHAHashSet, "Critical Error: Logical error on values in SetBlockHashFromData"); |
| 269 | return; |
| 270 | } |
| 271 | |
| 272 | pHashAlg->Finish(pToInsert->m_Hash); |
| 273 | pToInsert->m_bHashValid = true; |
| 274 | } |
| 275 | |
| 276 | |
| 277 | bool CAICHHashTree::CreatePartRecoveryData(uint64 nStartPos, uint64 nSize, CFileDataIO* fileDataOut, uint32 wHashIdent, bool b32BitIdent) |
no test coverage detected