Delete CRC. Przywrucono xxHash z pakietu LZ4. Dodano wstępną funkcję henerowania pliku HPP z kluczem i nonce.
This commit is contained in:
parent
a0a2f3e1d6
commit
967e1e9c13
12 changed files with 66 additions and 83 deletions
|
|
@ -174,8 +174,8 @@ uint8_t CreateCargo::CheckFileOnTheList(const std::string& path, std::vector<cha
|
|||
}
|
||||
else
|
||||
{
|
||||
output = std::move(input);
|
||||
//output = crypt.encrypt(input);
|
||||
//output = std::move(input);
|
||||
output = crypt.encrypt(input);
|
||||
return RAW_FILE;
|
||||
}
|
||||
}
|
||||
|
|
@ -188,8 +188,8 @@ uint8_t CreateCargo::CheckFileOnTheList(const std::string& path, std::vector<cha
|
|||
return ZIP_FILE;
|
||||
}
|
||||
|
||||
output = std::move(input);
|
||||
//output = crypt.encrypt(input);
|
||||
//output = std::move(input);
|
||||
output = crypt.encrypt(input);
|
||||
return RAW_FILE;
|
||||
}
|
||||
|
||||
|
|
@ -226,7 +226,7 @@ std::vector<FilesTable> CreateCargo::ComputingHeadFiles()
|
|||
f.close();
|
||||
|
||||
//Tworzenie hashu CRC
|
||||
uint32_t crc = crc32(buffor);
|
||||
const uint64_t crc = XXH64(buffor.data(), buffor.size(), VERSION);
|
||||
|
||||
//Kompresjia
|
||||
std::vector<char> zip;
|
||||
|
|
@ -333,16 +333,6 @@ uint64_t CreateCargo::fnv64(const std::string& data)
|
|||
return hash;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Wygenerój CRC32 HASH integralnoœci
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t CreateCargo::crc32(const std::vector<char>& buffer)
|
||||
{
|
||||
boost::crc_32_type crc;
|
||||
crc.process_bytes(buffer.data(), buffer.size());
|
||||
return crc.checksum();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Sprawdzanie czy plik znajduje się na liście
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -454,7 +444,7 @@ bool CreateCargo::WriteCargo()
|
|||
cargo.close();
|
||||
|
||||
// Zapisywanie klucza szyfrującego
|
||||
//crypt.saveKey(catalogPath);
|
||||
crypt.saveKey(catalogPath);
|
||||
|
||||
std::cout << "The container was successfully created! " << cargoFile << std::endl;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue