mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-07-01 00:57:56 -05:00
Reformat code with clang format
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
#include "Crypto.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Utils/ICapturedDataProvider.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Crypto.h"
|
||||
#include "Utils/ICapturedDataProvider.h"
|
||||
|
||||
class AbstractSalsa20Processor : public ICapturedDataProvider
|
||||
{
|
||||
protected:
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
class IXChunkProcessor
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
class XChunkException final : public std::exception
|
||||
{
|
||||
std::string m_message;
|
||||
|
@ -1,19 +1,18 @@
|
||||
#include "XChunkProcessorDeflate.h"
|
||||
|
||||
#include "XChunkException.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <zlib.h>
|
||||
#include <zutil.h>
|
||||
|
||||
#include "XChunkException.h"
|
||||
|
||||
size_t XChunkProcessorDeflate::Process(int streamNumber, const uint8_t* input, const size_t inputLength, uint8_t* output, const size_t outputBufferSize)
|
||||
{
|
||||
z_stream stream{};
|
||||
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.");
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "XChunkProcessorInflate.h"
|
||||
|
||||
#include "XChunkException.h"
|
||||
|
||||
#include <zlib.h>
|
||||
#include <zutil.h>
|
||||
|
||||
#include "XChunkException.h"
|
||||
|
||||
size_t XChunkProcessorInflate::Process(int streamNumber, const uint8_t* input, const size_t inputLength, uint8_t* output, const size_t outputBufferSize)
|
||||
{
|
||||
z_stream stream{};
|
||||
|
@ -1,16 +1,20 @@
|
||||
#include "XChunkProcessorSalsa20Decryption.h"
|
||||
|
||||
#include "AbstractSalsa20Processor.h"
|
||||
#include "Crypto.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "Crypto.h"
|
||||
#include "AbstractSalsa20Processor.h"
|
||||
|
||||
XChunkProcessorSalsa20Decryption::XChunkProcessorSalsa20Decryption(const int streamCount, std::string& zoneName, const uint8_t* salsa20Key, const size_t keySize)
|
||||
XChunkProcessorSalsa20Decryption::XChunkProcessorSalsa20Decryption(const int streamCount,
|
||||
std::string& zoneName,
|
||||
const uint8_t* salsa20Key,
|
||||
const size_t keySize)
|
||||
: AbstractSalsa20Processor(streamCount, zoneName, salsa20Key, keySize)
|
||||
{
|
||||
}
|
||||
|
||||
size_t XChunkProcessorSalsa20Decryption::Process(const int streamNumber, const uint8_t* input, const size_t inputLength, uint8_t* output, const size_t outputBufferSize)
|
||||
size_t XChunkProcessorSalsa20Decryption::Process(
|
||||
const int streamNumber, const uint8_t* input, const size_t inputLength, uint8_t* output, const size_t outputBufferSize)
|
||||
{
|
||||
assert(streamNumber >= 0 && streamNumber < m_stream_count);
|
||||
assert(input != nullptr);
|
||||
|
@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
#include "IXChunkProcessor.h"
|
||||
#include "AbstractSalsa20Processor.h"
|
||||
#include "IXChunkProcessor.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
class XChunkProcessorSalsa20Decryption final : public IXChunkProcessor, public AbstractSalsa20Processor
|
||||
{
|
||||
|
@ -2,12 +2,16 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
XChunkProcessorSalsa20Encryption::XChunkProcessorSalsa20Encryption(const int streamCount, std::string& zoneName, const uint8_t* salsa20Key, const size_t keySize)
|
||||
XChunkProcessorSalsa20Encryption::XChunkProcessorSalsa20Encryption(const int streamCount,
|
||||
std::string& zoneName,
|
||||
const uint8_t* salsa20Key,
|
||||
const size_t keySize)
|
||||
: AbstractSalsa20Processor(streamCount, zoneName, salsa20Key, keySize)
|
||||
{
|
||||
}
|
||||
|
||||
size_t XChunkProcessorSalsa20Encryption::Process(const int streamNumber, const uint8_t* input, const size_t inputLength, uint8_t* output, const size_t outputBufferSize)
|
||||
size_t XChunkProcessorSalsa20Encryption::Process(
|
||||
const int streamNumber, const uint8_t* input, const size_t inputLength, uint8_t* output, const size_t outputBufferSize)
|
||||
{
|
||||
assert(streamNumber >= 0 && streamNumber < m_stream_count);
|
||||
assert(input != nullptr);
|
||||
|
@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "AbstractSalsa20Processor.h"
|
||||
#include "IXChunkProcessor.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
class XChunkProcessorSalsa20Encryption final : public IXChunkProcessor, public AbstractSalsa20Processor
|
||||
{
|
||||
public:
|
||||
|
Reference in New Issue
Block a user