mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 07:18:11 -05:00
Write XChunks in fastfiles
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
#include "XChunkProcessorDeflate.h"
|
||||
|
||||
|
||||
#include <cassert>
|
||||
#include <zlib.h>
|
||||
#include <zutil.h>
|
||||
|
||||
@ -11,7 +13,7 @@ size_t XChunkProcessorDeflate::Process(int streamNumber, const uint8_t* input, c
|
||||
stream.zalloc = Z_NULL;
|
||||
stream.zfree = Z_NULL;
|
||||
stream.opaque = Z_NULL;
|
||||
|
||||
|
||||
auto ret = deflateInit2(&stream, Z_BEST_COMPRESSION, Z_DEFLATED, -DEF_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
|
||||
if (ret != Z_OK)
|
||||
throw XChunkException("Initializing deflate failed.");
|
||||
@ -23,7 +25,7 @@ size_t XChunkProcessorDeflate::Process(int streamNumber, const uint8_t* input, c
|
||||
|
||||
ret = deflate(&stream, Z_FINISH);
|
||||
if (ret != Z_STREAM_END)
|
||||
throw XChunkException("Zone has invalid or unsupported compression. Deflate failed");
|
||||
throw XChunkException("Failed to deflate memory of zone.");
|
||||
|
||||
const size_t outputSize = stream.total_out;
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "Crypto.h"
|
||||
#include "AbstractSalsa20Processor.h"
|
||||
|
||||
XChunkProcessorSalsa20Decryption::XChunkProcessorSalsa20Decryption(const int streamCount, std::string& zoneName, const uint8_t* salsa20Key, size_t keySize)
|
||||
XChunkProcessorSalsa20Decryption::XChunkProcessorSalsa20Decryption(const int streamCount, std::string& zoneName, const uint8_t* salsa20Key, const size_t keySize)
|
||||
: AbstractSalsa20Processor(streamCount, zoneName, salsa20Key, keySize)
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user