clang-format everything

This commit is contained in:
Martin Michelsen
2023-04-16 15:44:12 -07:00
parent b733f4e199
commit 91e484e514
119 changed files with 5101 additions and 5664 deletions
+5 -20
View File
@@ -4,14 +4,12 @@
#include <stddef.h>
#include <memory>
#include <phosg/Encoding.hh>
#include <string>
#include <vector>
#include <phosg/Encoding.hh>
#include "Text.hh" // for parray
class PSOEncryption {
public:
enum class Type {
@@ -39,8 +37,6 @@ protected:
PSOEncryption() = default;
};
class PSOLFGEncryption : public PSOEncryption {
public:
virtual void encrypt(void* data, size_t size, bool advance = true);
@@ -91,8 +87,6 @@ protected:
static constexpr size_t STREAM_LENGTH = 521;
};
class PSOBBEncryption : public PSOEncryption {
public:
enum Subtype : uint8_t {
@@ -109,14 +103,14 @@ public:
uint8_t jsd1_stream_offset;
parray<uint8_t, 0x48> as8;
parray<le_uint32_t, 0x12> as32;
InitialKeys() : as32() { }
InitialKeys(const InitialKeys& other) : as32(other.as32) { }
InitialKeys() : as32() {}
InitialKeys(const InitialKeys& other) : as32(other.as32) {}
} __attribute__((packed));
union PrivateKeys {
parray<uint8_t, 0x1000> as8;
parray<le_uint32_t, 0x400> as32;
PrivateKeys() : as32() { }
PrivateKeys(const PrivateKeys& other) : as32(other.as32) { }
PrivateKeys() : as32() {}
PrivateKeys(const PrivateKeys& other) : as32(other.as32) {}
} __attribute__((packed));
InitialKeys initial_keys;
PrivateKeys private_keys;
@@ -137,9 +131,6 @@ protected:
void apply_seed(const void* original_seed, size_t seed_size);
};
// The following classes provide support for automatically detecting which type
// of encryption a client is using based on their initial response to the server
@@ -176,8 +167,6 @@ protected:
std::shared_ptr<PSOEncryption> active_crypt;
};
// The following classes provide support for multiple PSOBB private keys, and
// the ability to automatically detect which key the client is using based on
// the first 8 bytes they send
@@ -232,8 +221,6 @@ protected:
bool jsd1_use_detector_seed;
};
class JSD0Encryption : public PSOEncryption {
public:
JSD0Encryption(const void* seed, size_t seed_size);
@@ -247,6 +234,4 @@ private:
uint8_t key;
};
void decrypt_trivial_gci_data(void* data, size_t size, uint8_t basis);