XChaCha20-Poly1305 via libsodium

This commit is contained in:
rtw1x1
2026-02-03 11:12:32 +00:00
parent 857ef33627
commit 509e2638cb
981 changed files with 49784 additions and 255732 deletions

View File

@@ -33,6 +33,7 @@ endif()
add_compile_options(
$<$<CXX_COMPILER_ID:MSVC>:/wd4828>
$<$<CXX_COMPILER_ID:MSVC>:/wd4996>
$<$<CXX_COMPILER_ID:MSVC>:/wd5033>
)
# ASan flags
@@ -65,6 +66,7 @@ add_compile_definitions("$<$<CONFIG:Release>:_DISTRIBUTE>")
include_directories("src")
include_directories("extern/include")
include_directories("vendor/libsodium/src/libsodium/include")
# Add subdirectories for libraries and executables
add_subdirectory(vendor)

View File

@@ -14,5 +14,41 @@ This repository contains the source code necessary to compile the game client ex
## 📋 Changelog
### 🐛 Bug Fixes
* **Effect adapting to semi-transparent meshes:** Effect adapting to semi-transparent meshes has been removed as it was causing artifacts when opacity was lower than 1
### Encryption & Security Overhaul
The entire legacy encryption system has been replaced with [libsodium](https://doc.libsodium.org/).
#### Removed Legacy Crypto
* **Crypto++ (cryptopp) vendor library** — Completely removed from the project
* **Panama cipher** (`CFilterEncoder`, `CFilterDecoder`) — Removed from `NetStream`
* **TEA encryption** (`tea.h`, `tea.cpp`) — Removed from both client and server
* **DH2 key exchange** (`cipher.h`, `cipher.cpp`) — Removed from `EterBase`
* **Camellia cipher** — Removed all references
* **`_IMPROVED_PACKET_ENCRYPTION_`** — Entire system removed (XTEA key scheduling, sequence encryption, key agreement)
* **`adwClientKey[4]`** — Removed from all packet structs (`TPacketCGLogin2`, `TPacketCGLogin3`, `TPacketGDAuthLogin`, `TPacketGDLoginByKey`, `TPacketLoginOnSetup`) and all associated code on both client and server
* **`LSS_SECURITY_KEY`** — Dead code removed (`"testtesttesttest"` hardcoded key, `GetSecurityKey()` function)
#### New Encryption System (libsodium)
* **X25519 key exchange** — `SecureCipher` class handles keypair generation and session key derivation via `crypto_kx_client_session_keys` / `crypto_kx_server_session_keys`
* **XChaCha20-Poly1305 AEAD** — Used for authenticated encryption of handshake tokens (key exchange, session tokens)
* **XChaCha20 stream cipher** — Used for in-place network buffer encryption via `EncryptInPlace()` / `DecryptInPlace()` (zero overhead, nonce-counter based replay prevention)
* **Challenge-response authentication** — HMAC-based (`crypto_auth`) verification during key exchange to prove shared secret derivation
* **New handshake protocol** — `HEADER_GC_KEY_CHALLENGE` / `HEADER_CG_KEY_RESPONSE` / `HEADER_GC_KEY_COMPLETE` packet flow for secure session establishment
#### Network Encryption Pipeline
* **Client send path** — Data is encrypted at queue time in `CNetworkStream::Send()` (prevents double-encryption on partial TCP sends)
* **Client receive path** — Data is decrypted immediately after `recv()` in `__RecvInternalBuffer()`, before being committed to the buffer
* **Server send path** — Data is encrypted in `DESC::Packet()` via `EncryptInPlace()` after encoding to the output buffer
* **Server receive path** — Newly received bytes are decrypted in `DESC::ProcessInput()` via `DecryptInPlace()` before buffer commit
#### Login Security Hardening
* **Removed plaintext login path** — `HEADER_CG_LOGIN` (direct password to game server) has been removed. All game server logins now require a login key obtained through the auth server (`HEADER_CG_LOGIN2` / `LoginByKey`)
* **CSPRNG login keys** — `CreateLoginKey()` now uses `randombytes_uniform()` (libsodium) instead of the non-cryptographic Xoshiro128PlusPlus PRNG
* **Single-use login keys** — Keys are consumed (removed from the map) immediately after successful authentication
* **Shorter key expiry** — Expired login keys are cleaned up after 15 seconds (down from 60 seconds). Orphaned keys (descriptor gone, never expired) are also cleaned up
* **Login rate limiting** — Per-IP tracking of failed login attempts. After 5 failures within 60 seconds, the IP is blocked with a `BLOCK` status and disconnected. Counter resets after cooldown or successful login
* **Removed Brazil password bypass** — The `LC_IsBrazil()` block that unconditionally disabled password verification has been removed
#### Pack File Encryption
* **libsodium-based pack encryption** — `PackLib` now uses XChaCha20-Poly1305 for pack file encryption, replacing the legacy Camellia/XTEA system
* **Secure key derivation** — Pack encryption keys are derived using `crypto_pwhash` (Argon2id)

View File

@@ -3,7 +3,6 @@ file(GLOB_RECURSE FILE_SOURCES "*.h" "*.c" "*.cpp")
add_library(AudioLib STATIC ${FILE_SOURCES})
target_link_libraries(AudioLib
cryptopp-static
mio
)

View File

@@ -1,10 +1,18 @@
file(GLOB_RECURSE FILE_SOURCES "*.h" "*.c" "*.cpp")
# Use tea.cpp from EterBase instead of maintaining a local copy
list(APPEND FILE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../EterBase/tea.cpp")
add_executable(DumpProto ${FILE_SOURCES})
set_target_properties(DumpProto PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
target_include_directories(DumpProto PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../EterBase
)
target_link_libraries(DumpProto
lzo2
sodium
)

View File

@@ -10,6 +10,7 @@
#include <cstring>
#include <io.h>
#include <direct.h>
#include <sodium.h>
#include "lzo.h"
@@ -1153,6 +1154,12 @@ int main(int argc, char ** argv)
printf("=== MAIN START ===\n");
fflush(stdout);
if (sodium_init() < 0)
{
fprintf(stderr, "sodium_init() failed\n");
return 1;
}
if (BuildMobTable())
{
printf("=== BuildMobTable returned TRUE ===\n");

View File

@@ -1,100 +0,0 @@
/*
* Filename: tea.c
* Description: TEA 암호화 모듈
*
* Author: 김한주 (aka. 비엽, Cronan), 송영진 (aka. myevan, 빗자루)
*/
#include "tea.h"
#include <memory.h>
/*
* TEA Encryption Module Instruction
* Edited by 김한주 aka. 비엽, Cronan
*
* void tea_code(const unsigned long sz, const unsigned long sy, const unsigned long *key, unsigned long *dest)
* void tea_decode(const unsigned long sz, const unsigned long sy, const unsigned long *key, unsigned long *dest)
* 8바이트를 암호/복호화 할때 사용된다. key 는 16 바이트여야 한다.
* sz, sy 는 8바이트의 역순으로 대입한다.
*
* int tea_decrypt(unsigned long *dest, const unsigned long *src, const unsigned long *key, int size);
* int tea_encrypt(unsigned long *dest, const unsigned long *src, const unsigned long *key, int size);
* 한꺼번에 8 바이트 이상을 암호/복호화 할때 사용한다. 만약 size 가
* 8의 배수가 아니면 8의 배수로 크기를 "늘려서" 암호화 한다.
*
* ex. tea_code(pdwSrc[1], pdwSrc[0], pdwKey, pdwDest);
* tea_decrypt(pdwDest, pdwSrc, pdwKey, nSize);
*/
#define TEA_ROUND 32 // 32 를 권장하며, 높을 수록 결과가 난해해 진다.
#define DELTA 0x9E3779B9 // DELTA 값 바꾸지 말것.
void tea_code(const unsigned long sz, const unsigned long sy, const unsigned long *key, unsigned long *dest)
{
register unsigned long y = sy, z = sz, sum = 0;
unsigned long n = TEA_ROUND;
while (n-- > 0)
{
y += ((z << 4 ^ z >> 5) + z) ^ (sum + key[sum & 3]);
sum += DELTA;
z += ((y << 4 ^ y >> 5) + y) ^ (sum + key[sum >> 11 & 3]);
}
*(dest++) = y;
*dest = z;
}
void tea_decode(const unsigned long sz, const unsigned long sy, const unsigned long *key, unsigned long *dest)
{
#pragma warning(disable:4307)
register unsigned long y = sy, z = sz, sum = DELTA * TEA_ROUND;
#pragma warning(default:4307)
unsigned long n = TEA_ROUND;
while (n-- > 0)
{
z -= ((y << 4 ^ y >> 5) + y) ^ (sum + key[sum >> 11 & 3]);
sum -= DELTA;
y -= ((z << 4 ^ z >> 5) + z) ^ (sum + key[sum & 3]);
}
*(dest++) = y;
*dest = z;
}
int tea_encrypt(unsigned long *dest, const unsigned long *src, const unsigned long * key, int size)
{
int i;
int resize;
if (size % 8 != 0)
{
resize = size + 8 - (size % 8);
memset((char *) src + size, 0, resize - size);
}
else
resize = size;
for (i = 0; i < resize >> 3; i++, dest += 2, src += 2)
tea_code(*(src + 1), *src, key, dest);
return (resize);
}
int tea_decrypt(unsigned long *dest, const unsigned long *src, const unsigned long * key, int size)
{
int i;
int resize;
if (size % 8 != 0)
resize = size + 8 - (size % 8);
else
resize = size;
for (i = 0; i < resize >> 3; i++, dest += 2, src += 2)
tea_decode(*(src + 1), *src, key, dest);
return (resize);
}

View File

@@ -1,17 +0,0 @@
#ifdef __cplusplus
extern "C" {
#endif
/* TEA is a 64-bit symmetric block cipher with a 128-bit key, developed
by David J. Wheeler and Roger M. Needham, and described in their
paper at <URL:http://www.cl.cam.ac.uk/ftp/users/djw3/tea.ps>.
This implementation is based on their code in
<URL:http://www.cl.cam.ac.uk/ftp/users/djw3/xtea.ps> */
int tea_encrypt(unsigned long *dest, const unsigned long *src, const unsigned long *key, int size);
int tea_decrypt(unsigned long *dest, const unsigned long *src, const unsigned long *key, int size);
#ifdef __cplusplus
};
#endif

View File

@@ -3,7 +3,6 @@
add_library(EffectLib STATIC ${FILE_SOURCES})
target_link_libraries(EffectLib
cryptopp-static
mio
)

View File

@@ -4,7 +4,7 @@ add_library(EterBase STATIC ${FILE_SOURCES})
target_link_libraries(EterBase
lzo2
cryptopp-static
sodium
mio
)

View File

@@ -0,0 +1,294 @@
#include "StdAfx.h"
#include "SecureCipher.h"
// Static initialization flag for libsodium
static bool s_sodiumInitialized = false;
static bool EnsureSodiumInit()
{
if (!s_sodiumInitialized)
{
if (sodium_init() < 0)
{
return false;
}
s_sodiumInitialized = true;
}
return true;
}
SecureCipher::SecureCipher()
{
sodium_memzero(m_pk, sizeof(m_pk));
sodium_memzero(m_sk, sizeof(m_sk));
sodium_memzero(m_tx_key, sizeof(m_tx_key));
sodium_memzero(m_rx_key, sizeof(m_rx_key));
sodium_memzero(m_session_token, sizeof(m_session_token));
}
SecureCipher::~SecureCipher()
{
CleanUp();
}
bool SecureCipher::Initialize()
{
if (!EnsureSodiumInit())
{
return false;
}
// Generate X25519 keypair
if (crypto_kx_keypair(m_pk, m_sk) != 0)
{
return false;
}
m_tx_nonce = 0;
m_rx_nonce = 0;
m_initialized = true;
m_activated = false;
return true;
}
void SecureCipher::CleanUp()
{
// Securely erase all sensitive key material
sodium_memzero(m_sk, sizeof(m_sk));
sodium_memzero(m_tx_key, sizeof(m_tx_key));
sodium_memzero(m_rx_key, sizeof(m_rx_key));
sodium_memzero(m_session_token, sizeof(m_session_token));
m_initialized = false;
m_activated = false;
m_tx_nonce = 0;
m_rx_nonce = 0;
}
void SecureCipher::GetPublicKey(uint8_t* out_pk) const
{
memcpy(out_pk, m_pk, PK_SIZE);
}
bool SecureCipher::ComputeClientKeys(const uint8_t* server_pk)
{
if (!m_initialized)
{
return false;
}
// Client: tx_key is for sending TO server, rx_key is for receiving FROM server
if (crypto_kx_client_session_keys(m_rx_key, m_tx_key, m_pk, m_sk, server_pk) != 0)
{
return false;
}
return true;
}
bool SecureCipher::ComputeServerKeys(const uint8_t* client_pk)
{
if (!m_initialized)
{
return false;
}
// Server: tx_key is for sending TO client, rx_key is for receiving FROM client
if (crypto_kx_server_session_keys(m_rx_key, m_tx_key, m_pk, m_sk, client_pk) != 0)
{
return false;
}
return true;
}
void SecureCipher::GenerateChallenge(uint8_t* out_challenge)
{
randombytes_buf(out_challenge, CHALLENGE_SIZE);
}
void SecureCipher::ComputeChallengeResponse(const uint8_t* challenge, uint8_t* out_response)
{
// HMAC the challenge using our rx_key as the authentication key
// This proves we derived the correct shared secret
crypto_auth(out_response, challenge, CHALLENGE_SIZE, m_rx_key);
}
bool SecureCipher::VerifyChallengeResponse(const uint8_t* challenge, const uint8_t* response)
{
// Verify the HMAC - peer should have used their tx_key (our rx_key) to compute it
return crypto_auth_verify(response, challenge, CHALLENGE_SIZE, m_rx_key) == 0;
}
void SecureCipher::BuildNonce(uint8_t* nonce, uint64_t counter, bool is_tx)
{
// 24-byte nonce structure:
// [0]: direction flag (0x01 for tx, 0x02 for rx)
// [1-7]: reserved/zero
// [8-15]: 64-bit counter (little-endian)
// [16-23]: reserved/zero
sodium_memzero(nonce, NONCE_SIZE);
nonce[0] = is_tx ? 0x01 : 0x02;
// Store counter in little-endian at offset 8
for (int i = 0; i < 8; ++i)
{
nonce[8 + i] = (uint8_t)(counter >> (i * 8));
}
}
size_t SecureCipher::Encrypt(const void* plaintext, size_t plaintext_len, void* ciphertext)
{
if (!m_activated)
{
return 0;
}
uint8_t nonce[NONCE_SIZE];
BuildNonce(nonce, m_tx_nonce, true);
unsigned long long ciphertext_len = 0;
if (crypto_aead_xchacha20poly1305_ietf_encrypt(
(uint8_t*)ciphertext, &ciphertext_len,
(const uint8_t*)plaintext, plaintext_len,
nullptr, 0, // No additional data
nullptr, // No secret nonce
nonce,
m_tx_key) != 0)
{
return 0;
}
++m_tx_nonce;
return (size_t)ciphertext_len;
}
size_t SecureCipher::Decrypt(const void* ciphertext, size_t ciphertext_len, void* plaintext)
{
if (!m_activated)
{
return 0;
}
if (ciphertext_len < TAG_SIZE)
{
return 0;
}
uint8_t nonce[NONCE_SIZE];
BuildNonce(nonce, m_rx_nonce, false);
unsigned long long plaintext_len = 0;
if (crypto_aead_xchacha20poly1305_ietf_decrypt(
(uint8_t*)plaintext, &plaintext_len,
nullptr, // No secret nonce output
(const uint8_t*)ciphertext, ciphertext_len,
nullptr, 0, // No additional data
nonce,
m_rx_key) != 0)
{
// Decryption failed - either wrong key, tampered data, or replay attack
return 0;
}
++m_rx_nonce;
return (size_t)plaintext_len;
}
void SecureCipher::EncryptInPlace(void* buffer, size_t len)
{
if (!m_activated || len == 0)
return;
uint8_t nonce[NONCE_SIZE];
BuildNonce(nonce, m_tx_nonce, true);
crypto_stream_xchacha20_xor_ic(
(uint8_t*)buffer,
(const uint8_t*)buffer,
(unsigned long long)len,
nonce,
0,
m_tx_key);
++m_tx_nonce;
}
void SecureCipher::DecryptInPlace(void* buffer, size_t len)
{
if (!m_activated || len == 0)
return;
uint8_t nonce[NONCE_SIZE];
BuildNonce(nonce, m_rx_nonce, false);
crypto_stream_xchacha20_xor_ic(
(uint8_t*)buffer,
(const uint8_t*)buffer,
(unsigned long long)len,
nonce,
0,
m_rx_key);
++m_rx_nonce;
}
bool SecureCipher::EncryptToken(const uint8_t* plaintext, size_t len,
uint8_t* ciphertext, uint8_t* nonce_out)
{
if (!m_initialized)
{
return false;
}
// Generate random nonce for this one-time encryption
randombytes_buf(nonce_out, NONCE_SIZE);
unsigned long long ciphertext_len = 0;
if (crypto_aead_xchacha20poly1305_ietf_encrypt(
ciphertext, &ciphertext_len,
plaintext, len,
nullptr, 0,
nullptr,
nonce_out,
m_tx_key) != 0)
{
return false;
}
return true;
}
bool SecureCipher::DecryptToken(const uint8_t* ciphertext, size_t len,
const uint8_t* nonce, uint8_t* plaintext)
{
if (!m_initialized)
{
return false;
}
unsigned long long plaintext_len = 0;
if (crypto_aead_xchacha20poly1305_ietf_decrypt(
plaintext, &plaintext_len,
nullptr,
ciphertext, len,
nullptr, 0,
nonce,
m_rx_key) != 0)
{
return false;
}
return true;
}
void SecureCipher::SetSessionToken(const uint8_t* token)
{
memcpy(m_session_token, token, SESSION_TOKEN_SIZE);
}

102
src/EterBase/SecureCipher.h Normal file
View File

@@ -0,0 +1,102 @@
#pragma once
#include <sodium.h>
#include <cstdint>
#include <cstring>
class SecureCipher {
public:
// libsodium constants
static constexpr size_t PK_SIZE = crypto_kx_PUBLICKEYBYTES; // 32
static constexpr size_t SK_SIZE = crypto_kx_SECRETKEYBYTES; // 32
static constexpr size_t KEY_SIZE = crypto_kx_SESSIONKEYBYTES; // 32
static constexpr size_t NONCE_SIZE = crypto_aead_xchacha20poly1305_ietf_NPUBBYTES; // 24
static constexpr size_t TAG_SIZE = crypto_aead_xchacha20poly1305_ietf_ABYTES; // 16
static constexpr size_t CHALLENGE_SIZE = 32;
static constexpr size_t SESSION_TOKEN_SIZE = 32;
static constexpr size_t HMAC_SIZE = crypto_auth_BYTES; // 32
SecureCipher();
~SecureCipher();
// Initialization - generates keypair
bool Initialize();
void CleanUp();
// Key exchange
void GetPublicKey(uint8_t* out_pk) const;
// Client computes session keys from server's public key
bool ComputeClientKeys(const uint8_t* server_pk);
// Server computes session keys from client's public key
bool ComputeServerKeys(const uint8_t* client_pk);
// Challenge-response for authentication
void GenerateChallenge(uint8_t* out_challenge);
void ComputeChallengeResponse(const uint8_t* challenge, uint8_t* out_response);
bool VerifyChallengeResponse(const uint8_t* challenge, const uint8_t* response);
// AEAD encryption - output is len + TAG_SIZE bytes
// Returns actual ciphertext length (plaintext_len + TAG_SIZE)
size_t Encrypt(const void* plaintext, size_t plaintext_len, void* ciphertext);
// AEAD decryption - input must be ciphertext_len bytes (includes TAG_SIZE)
// Returns actual plaintext length, or 0 on failure
size_t Decrypt(const void* ciphertext, size_t ciphertext_len, void* plaintext);
// In-place stream encryption for network buffers (XChaCha20, no tag overhead)
// Same length in/out. Nonce counter prevents replay.
void EncryptInPlace(void* buffer, size_t len);
void DecryptInPlace(void* buffer, size_t len);
// Encrypt a single token with explicit nonce (for KeyComplete packet)
bool EncryptToken(const uint8_t* plaintext, size_t len,
uint8_t* ciphertext, uint8_t* nonce_out);
bool DecryptToken(const uint8_t* ciphertext, size_t len,
const uint8_t* nonce, uint8_t* plaintext);
// State
bool IsActivated() const { return m_activated; }
void SetActivated(bool value) { m_activated = value; }
bool IsInitialized() const { return m_initialized; }
// Session token management
void SetSessionToken(const uint8_t* token);
const uint8_t* GetSessionToken() const { return m_session_token; }
// Get current nonce counters (for debugging/logging)
uint64_t GetTxNonce() const { return m_tx_nonce; }
uint64_t GetRxNonce() const { return m_rx_nonce; }
// Access keys directly (for special decrypt operations like session token)
const uint8_t* GetRxKey() const { return m_rx_key; }
const uint8_t* GetTxKey() const { return m_tx_key; }
// Alias for convenience
void ComputeResponse(const uint8_t* challenge, uint8_t* out_response) {
ComputeChallengeResponse(challenge, out_response);
}
private:
bool m_initialized = false;
bool m_activated = false;
// X25519 keypair
uint8_t m_pk[PK_SIZE];
uint8_t m_sk[SK_SIZE];
// Session keys derived from key exchange
uint8_t m_tx_key[KEY_SIZE]; // Key for encrypting outgoing packets
uint8_t m_rx_key[KEY_SIZE]; // Key for decrypting incoming packets
// Nonce counters - prevent replay attacks
uint64_t m_tx_nonce = 0;
uint64_t m_rx_nonce = 0;
// Server-generated session token
uint8_t m_session_token[SESSION_TOKEN_SIZE];
// Build 24-byte nonce from counter
void BuildNonce(uint8_t* nonce, uint64_t counter, bool is_tx);
};

View File

@@ -1,414 +0,0 @@
#include "stdafx.h"
#include "cipher.h"
#ifdef _IMPROVED_PACKET_ENCRYPTION_
//#pragma warning(push)
//#pragma warning(disable: 4100 4127 4189 4231 4512 4706)
#include <modes.h>
#include <nbtheory.h>
#include <osrng.h>
// Diffie-Hellman key agreement
#include <dh.h>
#include <dh2.h>
// AES winner and candidates
#include <aes.h>
#include <cast.h>
#include <rc6.h>
#include <mars.h>
#include <serpent.h>
#include <twofish.h>
// Other block ciphers
#include <blowfish.h>
#include <camellia.h>
#include <des.h>
#include <idea.h>
#include <rc5.h>
#include <seed.h>
#include <shacal2.h>
#include <skipjack.h>
#include <tea.h>
#include "Debug.h"
using namespace CryptoPP;
// Block cipher algorithm selector abstract base class.
struct BlockCipherAlgorithm {
enum {
kDefault, // to give more chances to default algorithm
// AES winner and candidates
// kAES, // Rijndael
kRC6,
kMARS,
kTwofish,
kSerpent,
kCAST256,
// Other block ciphers
kIDEA,
k3DES, // DES-EDE2
kCamellia,
kSEED,
kRC5,
kBlowfish,
kTEA,
//kSKIPJACK,
kSHACAL2,
// End sentinel
kMaxAlgorithms
};
BlockCipherAlgorithm() {}
virtual ~BlockCipherAlgorithm() {}
static BlockCipherAlgorithm* Pick(int hint);
virtual int GetBlockSize() const = 0;
virtual int GetDefaultKeyLength() const = 0;
virtual int GetIVLength() const = 0;
virtual SymmetricCipher* CreateEncoder(const CryptoPP::byte* key, size_t keylen,
const CryptoPP::byte* iv) const = 0;
virtual SymmetricCipher* CreateDecoder(const CryptoPP::byte* key, size_t keylen,
const CryptoPP::byte* iv) const = 0;
};
// Block cipher (with CTR mode) algorithm selector template class.
template<class T>
struct BlockCipherDetail : public BlockCipherAlgorithm {
BlockCipherDetail() {}
virtual ~BlockCipherDetail() {}
virtual int GetBlockSize() const { return T::BLOCKSIZE; }
virtual int GetDefaultKeyLength() const { return T::DEFAULT_KEYLENGTH; }
virtual int GetIVLength() const { return T::IV_LENGTH; }
virtual SymmetricCipher* CreateEncoder(const CryptoPP::byte* key, size_t keylen,
const CryptoPP::byte* iv) const
{
return new typename CTR_Mode<T>::Encryption(key, keylen, iv);
}
virtual SymmetricCipher* CreateDecoder(const CryptoPP::byte* key, size_t keylen,
const CryptoPP::byte* iv) const
{
return new typename CTR_Mode<T>::Decryption(key, keylen, iv);
}
};
// Key agreement scheme abstract class.
class KeyAgreement {
public:
KeyAgreement() {}
virtual ~KeyAgreement() {}
virtual size_t Prepare(void* buffer, size_t* length) = 0;
virtual bool Agree(size_t agreed_length, const void* buffer, size_t length) = 0;
const SecByteBlock& shared() const { return shared_; }
protected:
SecByteBlock shared_;
};
// Crypto++ Unified Diffie-Hellman key agreement scheme implementation.
class DH2KeyAgreement : public KeyAgreement {
public:
DH2KeyAgreement();
virtual ~DH2KeyAgreement();
virtual size_t Prepare(void* buffer, size_t* length);
virtual bool Agree(size_t agreed_length, const void* buffer, size_t length);
private:
DH dh_;
DH2 dh2_;
SecByteBlock spriv_key_;
SecByteBlock epriv_key_;
};
Cipher::Cipher()
: activated_(false), encoder_(NULL), decoder_(NULL), key_agreement_(NULL) {
}
Cipher::~Cipher() {
if (activated_) {
CleanUp();
}
}
void Cipher::CleanUp() {
if (encoder_ != NULL) {
delete encoder_;
encoder_ = NULL;
}
if (decoder_ != NULL) {
delete decoder_;
decoder_ = NULL;
}
if (key_agreement_ != NULL) {
delete key_agreement_;
key_agreement_ = NULL;
}
activated_ = false;
}
size_t Cipher::Prepare(void* buffer, size_t* length) {
assert(key_agreement_ == NULL);
key_agreement_ = new DH2KeyAgreement();
assert(key_agreement_ != NULL);
size_t agreed_length = key_agreement_->Prepare(buffer, length);
if (agreed_length == 0) {
delete key_agreement_;
key_agreement_ = NULL;
}
return agreed_length;
}
bool Cipher::Activate(bool polarity, size_t agreed_length,
const void* buffer, size_t length) {
assert(activated_ == false);
assert(key_agreement_ != NULL);
bool result = false;
if (key_agreement_->Agree(agreed_length, buffer, length)) {
result = SetUp(polarity);
}
delete key_agreement_;
key_agreement_ = NULL;
return result;
}
bool Cipher::SetUp(bool polarity) {
assert(key_agreement_ != NULL);
const SecByteBlock& shared = key_agreement_->shared();
// Pick a block cipher algorithm
if (shared.size() < 2) {
return false;
}
int hint_0 = shared.BytePtr()[*(shared.BytePtr()) % shared.size()];
int hint_1 = shared.BytePtr()[*(shared.BytePtr() + 1) % shared.size()];
BlockCipherAlgorithm* detail_0 = BlockCipherAlgorithm::Pick(hint_0);
BlockCipherAlgorithm* detail_1 = BlockCipherAlgorithm::Pick(hint_1);
assert(detail_0 != NULL);
assert(detail_1 != NULL);
std::unique_ptr<BlockCipherAlgorithm> algorithm_0(detail_0);
std::unique_ptr<BlockCipherAlgorithm> algorithm_1(detail_1);
const size_t key_length_0 = algorithm_0->GetDefaultKeyLength();
const size_t iv_length_0 = algorithm_0->GetBlockSize();
if (shared.size() < key_length_0 || shared.size() < iv_length_0) {
return false;
}
const size_t key_length_1 = algorithm_1->GetDefaultKeyLength();
const size_t iv_length_1 = algorithm_1->GetBlockSize();
if (shared.size() < key_length_1 || shared.size() < iv_length_1) {
return false;
}
// Pick encryption keys and initial vectors
SecByteBlock key_0(key_length_0), iv_0(iv_length_0);
SecByteBlock key_1(key_length_1), iv_1(iv_length_1);
size_t offset;
key_0.Assign(shared, key_length_0);
offset = key_length_0;
offset = std::min(key_length_0, shared.size() - key_length_1);
key_1.Assign(shared.BytePtr() + offset, key_length_1);
offset = shared.size() - iv_length_0;
iv_0.Assign(shared.BytePtr() + offset, iv_length_0);
offset = (offset < iv_length_1 ? 0 : offset - iv_length_1);
iv_1.Assign(shared.BytePtr() + offset, iv_length_1);
// Create encryption/decryption objects
if (polarity) {
encoder_ = algorithm_1->CreateEncoder(key_1, key_1.size(), iv_1);
decoder_ = algorithm_0->CreateDecoder(key_0, key_0.size(), iv_0);
} else {
encoder_ = algorithm_0->CreateEncoder(key_0, key_0.size(), iv_0);
decoder_ = algorithm_1->CreateDecoder(key_1, key_1.size(), iv_1);
}
assert(encoder_ != NULL);
assert(decoder_ != NULL);
return true;
}
BlockCipherAlgorithm* BlockCipherAlgorithm::Pick(int hint) {
BlockCipherAlgorithm* detail;
int selector = hint % kMaxAlgorithms;
switch (selector) {
//case kAES:
// detail = new BlockCipherDetail<AES>();
break;
case kRC6:
detail = new BlockCipherDetail<RC6>();
break;
case kMARS:
detail = new BlockCipherDetail<MARS>();
break;
case kTwofish:
detail = new BlockCipherDetail<Twofish>();
break;
case kSerpent:
detail = new BlockCipherDetail<Serpent>();
break;
case kCAST256:
detail = new BlockCipherDetail<CAST256>();
break;
case kIDEA:
detail = new BlockCipherDetail<IDEA>();
break;
case k3DES:
detail = new BlockCipherDetail<DES_EDE2>();
break;
case kCamellia:
detail = new BlockCipherDetail<Camellia>();
break;
case kSEED:
detail = new BlockCipherDetail<SEED>();
break;
case kRC5:
detail = new BlockCipherDetail<RC5>();
break;
case kBlowfish:
detail = new BlockCipherDetail<Blowfish>();
break;
case kTEA:
detail = new BlockCipherDetail<TEA>();
break;
// case kSKIPJACK:
// detail = new BlockCipherDetail<SKIPJACK>();
// break;
case kSHACAL2:
detail = new BlockCipherDetail<SHACAL2>();
break;
case kDefault:
default:
detail = new BlockCipherDetail<Twofish>(); // default algorithm
break;
}
return detail;
}
DH2KeyAgreement::DH2KeyAgreement() : dh_(), dh2_(dh_) {
}
DH2KeyAgreement::~DH2KeyAgreement() {
}
size_t DH2KeyAgreement::Prepare(void* buffer, size_t* length) {
// RFC 5114, 1024-bit MODP Group with 160-bit Prime Order Subgroup
// http://tools.ietf.org/html/rfc5114#section-2.1
Integer p("0xB10B8F96A080E01DDE92DE5EAE5D54EC52C99FBCFB06A3C6"
"9A6A9DCA52D23B616073E28675A23D189838EF1E2EE652C0"
"13ECB4AEA906112324975C3CD49B83BFACCBDD7D90C4BD70"
"98488E9C219A73724EFFD6FAE5644738FAA31A4FF55BCCC0"
"A151AF5F0DC8B4BD45BF37DF365C1A65E68CFDA76D4DA708"
"DF1FB2BC2E4A4371");
Integer g("0xA4D1CBD5C3FD34126765A442EFB99905F8104DD258AC507F"
"D6406CFF14266D31266FEA1E5C41564B777E690F5504F213"
"160217B4B01B886A5E91547F9E2749F4D7FBD7D3B9A92EE1"
"909D0D2263F80A76A6A24C087A091F531DBF0A0169B6A28A"
"D662A4D18E73AFA32D779D5918D08BC8858F4DCEF97C2A24"
"855E6EEB22B3B2E5");
Integer q("0xF518AA8781A8DF278ABA4E7D64B7CB9D49462353");
// Schnorr Group primes are of the form p = rq + 1, p and q prime. They
// provide a subgroup order. In the case of 1024-bit MODP Group, the
// security level is 80 bits (based on the 160-bit prime order subgroup).
// For a compare/contrast of using the maximum security level, see
// dh-unified.zip. Also see http://www.cryptopp.com/wiki/Diffie-Hellman
// and http://www.cryptopp.com/wiki/Security_level .
AutoSeededRandomPool rnd;
dh_.AccessGroupParameters().Initialize(p, q, g);
if(!dh_.GetGroupParameters().ValidateGroup(rnd, 3)) {
// Failed to validate prime and generator
return 0;
}
size_t count = 0;
p = dh_.GetGroupParameters().GetModulus();
q = dh_.GetGroupParameters().GetSubgroupOrder();
g = dh_.GetGroupParameters().GetGenerator();
// http://groups.google.com/group/sci.crypt/browse_thread/thread/7dc7eeb04a09f0ce
Integer v = ModularExponentiation(g, q, p);
if(v != Integer::One()) {
// Failed to verify order of the subgroup
return 0;
}
//////////////////////////////////////////////////////////////
spriv_key_.New(dh2_.StaticPrivateKeyLength());
epriv_key_.New(dh2_.EphemeralPrivateKeyLength());
SecByteBlock spub_key(dh2_.StaticPublicKeyLength());
SecByteBlock epub_key(dh2_.EphemeralPublicKeyLength());
dh2_.GenerateStaticKeyPair(rnd, spriv_key_, spub_key);
dh2_.GenerateEphemeralKeyPair(rnd, epriv_key_, epub_key);
// Prepare key agreement data
const size_t spub_key_length = spub_key.size();
const size_t epub_key_length = epub_key.size();
const size_t data_length = spub_key_length + epub_key_length;
if (*length < data_length) {
// Not enough data buffer length b-l-a-c-k
return 0;
}
*length = data_length;
CryptoPP::byte* buf = (CryptoPP::byte*)buffer;
memcpy(buf, spub_key.BytePtr(), spub_key_length);
memcpy(buf + spub_key_length, epub_key.BytePtr(), epub_key_length);
return dh2_.AgreedValueLength();
}
bool DH2KeyAgreement::Agree(size_t agreed_length, const void* buffer, size_t length) {
if (agreed_length != dh2_.AgreedValueLength()) {
// Shared secret size mismatch
return false;
}
const size_t spub_key_length = dh2_.StaticPublicKeyLength();
if (const size_t epub_key_length = dh2_.EphemeralPublicKeyLength(); length != (spub_key_length + epub_key_length)) {
// Wrong data length
return false;
}
shared_.New(dh2_.AgreedValueLength());
if (const CryptoPP::byte* buf = (const CryptoPP::byte*)buffer; !dh2_.Agree(shared_, spriv_key_, epriv_key_, buf, buf + spub_key_length)) {
// Failed to reach shared secret
return false;
}
return true;
}
#endif

View File

@@ -1,61 +0,0 @@
#ifndef __CIPHER_H__
#define __CIPHER_H__
#ifdef _IMPROVED_PACKET_ENCRYPTION_
#pragma warning(push)
#pragma warning(disable: 4100 4127 4189 4231 4512 4706)
#include <cryptlib.h>
#pragma warning(pop)
// Forward declaration
class KeyAgreement;
// Communication channel encryption handler.
class Cipher {
public:
explicit Cipher();
~Cipher();
void CleanUp();
// Returns agreed value length in CryptoPP::bytes, or zero on failure.
size_t Prepare(void* buffer, size_t* length);
// Try to activate cipher algorithm with agreement data received from peer.
bool Activate(bool polarity, size_t agreed_length,
const void* buffer, size_t length);
// Encrypts the given block of data. (no padding required)
void Encrypt(void* buffer, size_t length) {
assert(activated_);
if (!activated_) {
return;
}
encoder_->ProcessData((CryptoPP::byte*)buffer, (const CryptoPP::byte*)buffer, length);
}
// Decrypts the given block of data. (no padding required)
void Decrypt(void* buffer, size_t length) {
assert(activated_);
if (!activated_) {
return;
}
decoder_->ProcessData((CryptoPP::byte*)buffer, (const CryptoPP::byte*)buffer, length);
}
bool activated() const { return activated_; }
void set_activated(bool value) { activated_ = value; }
private:
bool SetUp(bool polarity);
bool activated_;
CryptoPP::SymmetricCipher* encoder_;
CryptoPP::SymmetricCipher* decoder_;
KeyAgreement* key_agreement_;
};
#endif // _IMPROVED_PACKET_ENCRYPTION_
#endif // __CIPHER_H__

View File

@@ -1,101 +1,87 @@
/*
* Filename: tea.c
* Description: TEA 암호화 모듈
*
* Author: 김한주 (aka. 비엽, Cronan), 송영진 (aka. myevan, 빗자루)
*/
#include "StdAfx.h"
* Symmetric encryption module using libsodium (XChaCha20)
* API-compatible replacement for legacy TEA encryption
*
* Key expansion: 16-byte input key is hashed to 32 bytes using BLAKE2b
* Nonce: Derived deterministically from the key to ensure encrypt/decrypt consistency
*/
#include "tea.h"
#include <memory.h>
#include <sodium.h>
#include <cstring>
/*
* TEA Encryption Module Instruction
* Edited by 김한주 aka. 비엽, Cronan
*
* void tea_code(const unsigned long sz, const unsigned long sy, const unsigned long *key, unsigned long *dest)
* void tea_decode(const unsigned long sz, const unsigned long sy, const unsigned long *key, unsigned long *dest)
* 8바이트를 암호/복호화 할때 사용된다. key 는 16 바이트여야 한다.
* sz, sy 는 8바이트의 역순으로 대입한다.
*
* int tea_decrypt(unsigned long *dest, const unsigned long *src, const unsigned long *key, int size);
* int tea_encrypt(unsigned long *dest, const unsigned long *src, const unsigned long *key, int size);
* 한꺼번에 8 바이트 이상을 암호/복호화 할때 사용한다. 만약 size 가
* 8의 배수가 아니면 8의 배수로 크기를 "늘려서" 암호화 한다.
*
* ex. tea_code(pdwSrc[1], pdwSrc[0], pdwKey, pdwDest);
* tea_decrypt(pdwDest, pdwSrc, pdwKey, nSize);
*/
// Fixed context string for key derivation
static const char* KEY_CONTEXT = "M2DevPackEncrypt";
#define TEA_ROUND 32 // 32 를 권장하며, 높을 수록 결과가 난해해 진다.
#define DELTA 0x9E3779B9 // DELTA 값 바꾸지 말것.
void tea_code(const unsigned long sz, const unsigned long sy, const unsigned long *key, unsigned long *dest)
// Derive a 32-byte key and 24-byte nonce from the 16-byte input key
static void DeriveKeyAndNonce(const unsigned long* key, uint8_t* derived_key, uint8_t* nonce)
{
unsigned long y = sy, z = sz, sum = 0;
unsigned long n = TEA_ROUND;
// Use BLAKE2b to derive a 32-byte key
crypto_generichash(derived_key, crypto_stream_xchacha20_KEYBYTES,
(const uint8_t*)key, TEA_KEY_LENGTH,
(const uint8_t*)KEY_CONTEXT, strlen(KEY_CONTEXT));
while (n-- > 0)
{
y += ((z << 4 ^ z >> 5) + z) ^ (sum + key[sum & 3]);
sum += DELTA;
z += ((y << 4 ^ y >> 5) + y) ^ (sum + key[sum >> 11 & 3]);
}
*(dest++) = y;
*dest = z;
// Derive nonce from key (using different context)
uint8_t nonce_seed[crypto_stream_xchacha20_NONCEBYTES + 8];
crypto_generichash(nonce_seed, sizeof(nonce_seed),
(const uint8_t*)key, TEA_KEY_LENGTH,
(const uint8_t*)"M2DevNonce", 10);
memcpy(nonce, nonce_seed, crypto_stream_xchacha20_NONCEBYTES);
}
void tea_decode(const unsigned long sz, const unsigned long sy, const unsigned long *key, unsigned long *dest)
int tea_encrypt(unsigned long *dest, const unsigned long *src, const unsigned long *key, int size)
{
#pragma warning(disable:4307)
unsigned long y = sy, z = sz, sum = DELTA * TEA_ROUND;
#pragma warning(default:4307)
unsigned long n = TEA_ROUND;
while (n-- > 0)
{
z -= ((y << 4 ^ y >> 5) + y) ^ (sum + key[sum >> 11 & 3]);
sum -= DELTA;
y -= ((z << 4 ^ z >> 5) + z) ^ (sum + key[sum & 3]);
}
*(dest++) = y;
*dest = z;
}
int tea_encrypt(unsigned long *dest, const unsigned long *src, const unsigned long * key, int size)
{
int i;
int resize;
int resize;
// Align to 8 bytes for compatibility with legacy format
if (size % 8 != 0)
{
resize = size + 8 - (size % 8);
memset((char *) src + size, 0, resize - size);
// Zero-pad the source (caller must ensure buffer is large enough)
memset((char*)src + size, 0, resize - size);
}
else
{
resize = size;
}
for (i = 0; i < resize >> 3; i++, dest += 2, src += 2)
tea_code(*(src + 1), *src, key, dest);
// Derive 32-byte key and nonce from 16-byte input
uint8_t derived_key[crypto_stream_xchacha20_KEYBYTES];
uint8_t nonce[crypto_stream_xchacha20_NONCEBYTES];
DeriveKeyAndNonce(key, derived_key, nonce);
return (resize);
// XOR encrypt using XChaCha20 stream
crypto_stream_xchacha20_xor((uint8_t*)dest, (const uint8_t*)src, resize, nonce, derived_key);
// Securely clear derived key
sodium_memzero(derived_key, sizeof(derived_key));
return resize;
}
int tea_decrypt(unsigned long *dest, const unsigned long *src, const unsigned long * key, int size)
int tea_decrypt(unsigned long *dest, const unsigned long *src, const unsigned long *key, int size)
{
int i;
int resize;
int resize;
// Align to 8 bytes for compatibility with legacy format
if (size % 8 != 0)
{
resize = size + 8 - (size % 8);
}
else
{
resize = size;
}
for (i = 0; i < resize >> 3; i++, dest += 2, src += 2)
tea_decode(*(src + 1), *src, key, dest);
// Derive 32-byte key and nonce from 16-byte input
uint8_t derived_key[crypto_stream_xchacha20_KEYBYTES];
uint8_t nonce[crypto_stream_xchacha20_NONCEBYTES];
DeriveKeyAndNonce(key, derived_key, nonce);
return (resize);
// XOR decrypt using XChaCha20 stream (same as encrypt for stream cipher)
crypto_stream_xchacha20_xor((uint8_t*)dest, (const uint8_t*)src, resize, nonce, derived_key);
// Securely clear derived key
sodium_memzero(derived_key, sizeof(derived_key));
return resize;
}

View File

@@ -1,18 +1,16 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
/* TEA is a 64-bit symmetric block cipher with a 128-bit key, developed
by David J. Wheeler and Roger M. Needham, and described in their
paper at <URL:http://www.cl.cam.ac.uk/ftp/users/djw3/tea.ps>.
// Symmetric encryption API using libsodium (XChaCha20)
// Key is 16 bytes (128-bit), internally expanded to 32 bytes
This implementation is based on their code in
<URL:http://www.cl.cam.ac.uk/ftp/users/djw3/xtea.ps> */
#define TEA_KEY_LENGTH 16
#define TEA_KEY_LENGTH 16
int tea_encrypt(unsigned long *dest, const unsigned long *src, const unsigned long *key, int size);
int tea_decrypt(unsigned long *dest, const unsigned long *src, const unsigned long *key, int size);
int tea_encrypt(unsigned long *dest, const unsigned long *src, const unsigned long *key, int size);
int tea_decrypt(unsigned long *dest, const unsigned long *src, const unsigned long *key, int size);
#ifdef __cplusplus
};

View File

@@ -3,7 +3,6 @@
add_library(EterGrnLib STATIC ${FILE_SOURCES})
target_link_libraries(EterGrnLib
cryptopp-static
mio
)

View File

@@ -3,7 +3,6 @@
add_library(EterImageLib STATIC ${FILE_SOURCES})
target_link_libraries(EterImageLib
cryptopp-static
mio
)

View File

@@ -3,7 +3,7 @@
add_library(EterLib STATIC ${FILE_SOURCES})
target_link_libraries(EterLib
cryptopp-static
sodium
mio
)

View File

@@ -1,58 +1,28 @@
#include "StdAfx.h"
#include "NetStream.h"
//#include "eterCrypt.h"
#include <iomanip>
#include <sstream>
#ifndef _IMPROVED_PACKET_ENCRYPTION_
#include "EterBase/tea.h"
#endif
#ifdef _DEBUG
#define _PACKETDUMP
#endif
#ifndef _IMPROVED_PACKET_ENCRYPTION_
void CNetworkStream::SetSecurityMode(bool isSecurityMode, const char* c_szTeaKey)
{
m_isSecurityMode = isSecurityMode;
memcpy(m_szEncryptKey, c_szTeaKey, TEA_KEY_LENGTH);
memcpy(m_szDecryptKey, c_szTeaKey, TEA_KEY_LENGTH);
}
void CNetworkStream::SetSecurityMode(bool isSecurityMode, const char* c_szTeaEncryptKey, const char* c_szTeaDecryptKey)
{
m_isSecurityMode = isSecurityMode;
memcpy(m_szEncryptKey, c_szTeaEncryptKey, TEA_KEY_LENGTH);
memcpy(m_szDecryptKey, c_szTeaDecryptKey, TEA_KEY_LENGTH);
}
#endif // _IMPROVED_PACKET_ENCRYPTION_
bool CNetworkStream::IsSecurityMode()
{
#ifdef _IMPROVED_PACKET_ENCRYPTION_
return m_cipher.activated();
#else
return m_isSecurityMode;
#endif
return m_secureCipher.IsActivated();
}
void CNetworkStream::SetRecvBufferSize(int recvBufSize)
{
if (m_recvBuf)
{
if (m_recvBufSize>recvBufSize)
if (m_recvBufSize > recvBufSize)
return;
delete [] m_recvBuf;
if (m_recvTEABuf)
delete [] m_recvTEABuf;
}
m_recvBufSize = recvBufSize;
m_recvBuf = new char[m_recvBufSize];
m_recvTEABufSize = ((m_recvBufSize>>3)+1)<<3;
m_recvTEABuf = new char[m_recvTEABufSize];
}
void CNetworkStream::SetSendBufferSize(int sendBufSize)
@@ -63,23 +33,18 @@ void CNetworkStream::SetSendBufferSize(int sendBufSize)
return;
delete [] m_sendBuf;
if (m_sendTEABuf)
delete [] m_sendTEABuf;
}
m_sendBufSize = sendBufSize;
m_sendBuf = new char[m_sendBufSize];
m_sendTEABufSize = ((m_sendBufSize>>3)+1)<<3;
m_sendTEABuf = new char[m_sendTEABufSize];
}
bool CNetworkStream::__RecvInternalBuffer()
{
if (m_recvBufOutputPos>0)
if (m_recvBufOutputPos > 0)
{
int recvBufDataSize = m_recvBufInputPos - m_recvBufOutputPos;
if (recvBufDataSize>0)
if (recvBufDataSize > 0)
{
memmove(m_recvBuf, m_recvBuf + m_recvBufOutputPos, recvBufDataSize);
}
@@ -88,117 +53,30 @@ bool CNetworkStream::__RecvInternalBuffer()
m_recvBufOutputPos = 0;
}
#ifdef _IMPROVED_PACKET_ENCRYPTION_
int restSize = m_recvBufSize - m_recvBufInputPos;
if (restSize>0)
if (restSize > 0)
{
int recvSize = recv(m_sock, m_recvBuf + m_recvBufInputPos, m_recvBufSize - m_recvBufInputPos, 0);
//Tracenf("RECV %d %d(%d, %d)", recvSize, restSize, m_recvTEABufSize - m_recvTEABufInputPos, m_recvBufSize - m_recvBufInputPos);
int recvSize = recv(m_sock, m_recvBuf + m_recvBufInputPos, restSize, 0);
if (recvSize < 0)
{
int error = WSAGetLastError();
if (error != WSAEWOULDBLOCK)
{
return false;
}
}
else if (recvSize == 0)
{
return false;
}
if (IsSecurityMode()) {
m_cipher.Decrypt(m_recvBuf + m_recvBufInputPos, recvSize);
}
m_recvBufInputPos += recvSize;
}
#else
if (IsSecurityMode())
{
int restSize = std::min(m_recvTEABufSize - m_recvTEABufInputPos, m_recvBufSize - m_recvBufInputPos);
if (restSize > 0)
else
{
int recvSize = recv(m_sock, m_recvTEABuf + m_recvTEABufInputPos, restSize, 0);
//Tracenf("RECV %d %d(%d, %d)", recvSize, restSize, m_recvTEABufSize - m_recvTEABufInputPos, m_recvBufSize - m_recvBufInputPos);
if (recvSize < 0)
if (m_secureCipher.IsActivated())
{
int error = WSAGetLastError();
if (error != WSAEWOULDBLOCK)
{
return false;
}
m_secureCipher.DecryptInPlace(m_recvBuf + m_recvBufInputPos, recvSize);
}
else if (recvSize == 0)
{
return false;
}
m_recvTEABufInputPos += recvSize;
int decodeSize = m_recvTEABufInputPos;
if (decodeSize >= 8)
{
decodeSize >>= 3;
decodeSize <<= 3;
/*int decodeDstSize = tea_decrypt((DWORD *) (m_recvBuf + m_recvBufInputPos),
(DWORD *) m_recvTEABuf,
(const DWORD *) m_szDecryptKey,
decodeSize);
*/
int decodeDstSize = tea_decrypt((DWORD *) (m_recvBuf + m_recvBufInputPos),
(DWORD *) m_recvTEABuf,
(const DWORD *) m_szDecryptKey,
decodeSize);
m_recvBufInputPos += decodeDstSize;
if (m_recvTEABufInputPos>decodeSize)
memmove(m_recvTEABuf, m_recvTEABuf+decodeSize, m_recvTEABufInputPos-decodeSize);
m_recvTEABufInputPos -= decodeSize;
//Tracenf("!!!!!! decrypt decodeSrcSize %d -> decodeDstSize %d (recvOutputPos %d, recvInputPos %d, teaInputPos %d)",
// decodeSize, decodeDstSize, m_recvBufOutputPos, m_recvBufInputPos, m_recvTEABufInputPos);
}
}
}
else
{
int restSize = m_recvBufSize - m_recvBufInputPos;
if (restSize>0)
{
int recvSize = recv(m_sock, m_recvBuf + m_recvBufInputPos, m_recvBufSize - m_recvBufInputPos, 0);
//Tracenf("RECV %d %d(%d, %d)", recvSize, restSize, m_recvTEABufSize - m_recvTEABufInputPos, m_recvBufSize - m_recvBufInputPos);
if (recvSize < 0)
{
int error = WSAGetLastError();
if (error != WSAEWOULDBLOCK)
{
return false;
}
}
else if (recvSize == 0)
{
return false;
}
m_recvBufInputPos += recvSize;
}
}
#endif // _IMPROVED_PACKET_ENCRYPTION_
//Tracef("recvSize: %d input pos %d output pos %d\n", recvSize, m_recvBufInputPos, m_recvBufOutputPos);
return true;
}
@@ -206,78 +84,30 @@ bool CNetworkStream::__RecvInternalBuffer()
bool CNetworkStream::__SendInternalBuffer()
{
#ifdef _IMPROVED_PACKET_ENCRYPTION_
int dataSize=__GetSendBufferSize();
if (dataSize<=0)
int dataSize = __GetSendBufferSize();
if (dataSize <= 0)
return true;
if (IsSecurityMode()) {
m_cipher.Encrypt(m_sendBuf + m_sendBufOutputPos, dataSize);
}
int sendSize = send(m_sock, m_sendBuf+m_sendBufOutputPos, dataSize, 0);
int sendSize = send(m_sock, m_sendBuf + m_sendBufOutputPos, dataSize, 0);
if (sendSize < 0)
return false;
m_sendBufOutputPos+=sendSize;
m_sendBufOutputPos += sendSize;
__PopSendBuffer();
#else
if (IsSecurityMode())
{
int encodeSize=__GetSendBufferSize();
if (encodeSize<=0)
return true;
m_sendTEABufInputPos += tea_encrypt((DWORD *) (m_sendTEABuf + m_sendTEABufInputPos),
(DWORD *) (m_sendBuf + m_sendBufOutputPos),
(const DWORD *) m_szEncryptKey,
encodeSize);
m_sendBufOutputPos += encodeSize;
if (m_sendTEABufInputPos>0)
{
int sendSize = send(m_sock, m_sendTEABuf, m_sendTEABufInputPos, 0);
if (sendSize < 0)
return false;
if (m_sendTEABufInputPos>sendSize)
memmove(m_sendTEABuf, m_sendTEABuf+sendSize, m_sendTEABufInputPos-sendSize);
m_sendTEABufInputPos-=sendSize;
}
__PopSendBuffer();
}
else
{
int dataSize=__GetSendBufferSize();
if (dataSize<=0)
return true;
int sendSize = send(m_sock, m_sendBuf+m_sendBufOutputPos, dataSize, 0);
if (sendSize < 0)
return false;
m_sendBufOutputPos+=sendSize;
__PopSendBuffer();
}
#endif // _IMPROVED_PACKET_ENCRYPTION_
return true;
}
void CNetworkStream::__PopSendBuffer()
{
if (m_sendBufOutputPos<=0)
if (m_sendBufOutputPos <= 0)
return;
int sendBufDataSize = m_sendBufInputPos - m_sendBufOutputPos;
if (sendBufDataSize>0)
if (sendBufDataSize > 0)
{
memmove(m_sendBuf, m_sendBuf+m_sendBufOutputPos, sendBufDataSize);
memmove(m_sendBuf, m_sendBuf + m_sendBufOutputPos, sendBufDataSize);
}
m_sendBufInputPos = sendBufDataSize;
@@ -362,8 +192,6 @@ void CNetworkStream::Disconnect()
if (m_sock == INVALID_SOCKET)
return;
//OnDisconnect();
Clear();
}
@@ -372,26 +200,14 @@ void CNetworkStream::Clear()
if (m_sock == INVALID_SOCKET)
return;
#ifdef _IMPROVED_PACKET_ENCRYPTION_
m_cipher.CleanUp();
#endif
m_secureCipher.CleanUp();
closesocket(m_sock);
m_sock = INVALID_SOCKET;
#ifndef _IMPROVED_PACKET_ENCRYPTION_
memset(m_szEncryptKey, 0, sizeof(m_szEncryptKey));
memset(m_szDecryptKey, 0, sizeof(m_szDecryptKey));
m_isSecurityMode = false;
#endif
m_isOnline = false;
m_connectLimitTime = 0;
m_recvTEABufInputPos = 0;
m_sendTEABufInputPos = 0;
m_recvBufInputPos = 0;
m_recvBufOutputPos = 0;
@@ -508,7 +324,6 @@ const char * GetSendHeaderName(BYTE header)
sprintf(buf,"%d",i);
stringList[i] = buf;
}
stringList[1] = "HEADER_CG_LOGIN";
stringList[2] = "HEADER_CG_ATTACK";
stringList[3] = "HEADER_CG_CHAT";
stringList[4] = "HEADER_CG_PLAYER_CREATE";
@@ -575,9 +390,7 @@ const char * GetSendHeaderName(BYTE header)
stringList[112] = "HEADER_CG_GUILD_SYMBOL_UPLOAD";
stringList[113] = "HEADER_CG_GUILD_SYMBOL_CRC";
stringList[114] = "HEADER_CG_SCRIPT_SELECT_ITEM";
#ifdef _IMPROVED_PACKET_ENCRYPTION_
stringList[0xfb] = "HEADER_CG_KEY_AGREEMENT";
#endif
stringList[0xf9] = "HEADER_CG_KEY_RESPONSE";
stringList[0xfc] = "HEADER_CG_TIME_SYNC";
stringList[0xfd] = "HEADER_CG_CLIENT_VERSION";
stringList[0xfe] = "HEADER_CG_PONG";
@@ -709,10 +522,8 @@ const char * GetRecvHeaderName(BYTE header)
stringList[135] = "HEADER_GC_DAMAGE_INFO";
stringList[136] = "HEADER_GC_CHAR_ADDITIONAL_INFO";
stringList[150] = "HEADER_GC_AUTH_SUCCESS";
#ifdef _IMPROVED_PACKET_ENCRYPTION_
stringList[0xfa] = "HEADER_GC_KEY_AGREEMENT_COMPLETED";
stringList[0xfb] = "HEADER_GC_KEY_AGREEMENT";
#endif
stringList[0xf7] = "HEADER_GC_KEY_COMPLETE";
stringList[0xf8] = "HEADER_GC_KEY_CHALLENGE";
stringList[0xfc] = "HEADER_GC_HANDSHAKE_OK";
stringList[0xfd] = "HEADER_GC_PHASE";
stringList[0xfe] = "HEADER_GC_BINDUDP";
@@ -771,7 +582,7 @@ bool CNetworkStream::Recv(int size, char * pDestBuf)
int CNetworkStream::__GetSendBufferSize()
{
return m_sendBufInputPos-m_sendBufOutputPos;
return m_sendBufInputPos - m_sendBufOutputPos;
}
@@ -782,6 +593,12 @@ bool CNetworkStream::Send(int size, const char * pSrcBuf)
return false;
memcpy(m_sendBuf + m_sendBufInputPos, pSrcBuf, size);
if (m_secureCipher.IsActivated())
{
m_secureCipher.EncryptInPlace(m_sendBuf + m_sendBufInputPos, size);
}
m_sendBufInputPos += size;
#ifdef _PACKETDUMP
@@ -796,23 +613,6 @@ bool CNetworkStream::Send(int size, const char * pSrcBuf)
#endif
return true;
/*
if (size > 0)
{
if (IsSecurityMode())
{
m_sendBufInputPos += TEA_Encrypt((DWORD *) (m_sendBuf + m_sendBufInputPos),
(DWORD *) (m_sendBuf + m_sendBufInputPos),
(const DWORD *) gs_szTeaKey,
size);
}
else
{
}
}
return __SendInternalBuffer();
*/
}
bool CNetworkStream::Peek(int len, void* pDestBuf)
@@ -885,37 +685,18 @@ void CNetworkStream::OnConnectFailure()
Tracen("Failed to connect.");
}
//void CNetworkStream::OnCheckinSuccess()
//{
//}
//void CNetworkStream::OnCheckinFailure()
//{
//}
CNetworkStream::CNetworkStream()
{
m_sock = INVALID_SOCKET;
#ifndef _IMPROVED_PACKET_ENCRYPTION_
m_isSecurityMode = false;
#endif
m_isOnline = false;
m_connectLimitTime = 0;
m_recvTEABuf = NULL;
m_recvTEABufSize = 0;
m_recvTEABufInputPos = 0;
m_recvBuf = NULL;
m_recvBufSize = 0;
m_recvBufOutputPos = 0;
m_recvBufInputPos = 0;
m_sendTEABuf = NULL;
m_sendTEABuf = 0;
m_sendTEABufInputPos = 0;
m_sendBuf = NULL;
m_sendBufSize = 0;
m_sendBufOutputPos = 0;
@@ -929,57 +710,15 @@ CNetworkStream::~CNetworkStream()
{
Clear();
if (m_sendTEABuf)
{
delete [] m_sendTEABuf;
m_sendTEABuf=NULL;
}
if (m_recvTEABuf)
{
delete [] m_recvTEABuf;
m_recvTEABuf=NULL;
}
if (m_recvBuf)
{
delete [] m_recvBuf;
m_recvBuf=NULL;
m_recvBuf = NULL;
}
if (m_sendBuf)
{
delete [] m_sendBuf;
m_sendBuf=NULL;
m_sendBuf = NULL;
}
}
#ifdef _IMPROVED_PACKET_ENCRYPTION_
size_t CNetworkStream::Prepare(void* buffer, size_t* length)
{
return m_cipher.Prepare(buffer, length);
}
bool CNetworkStream::Activate(size_t agreed_length, const void* buffer, size_t length)
{
return m_cipher.Activate(true, agreed_length, buffer, length);
}
void CNetworkStream::ActivateCipher()
{
return m_cipher.set_activated(true);
}
// If cipher is active and there's unread data in buffer, decrypt it in-place
void CNetworkStream::DecryptAlreadyReceivedData()
{
if (!IsSecurityMode())
return;
const int unreadSize = m_recvBufInputPos - m_recvBufOutputPos;
if (unreadSize <= 0)
return;
m_cipher.Decrypt(m_recvBuf + m_recvBufOutputPos, unreadSize);
}
#endif // _IMPROVED_PACKET_ENCRYPTION_

View File

@@ -1,9 +1,6 @@
#pragma once
#ifdef _IMPROVED_PACKET_ENCRYPTION_
#include "EterBase/cipher.h"
#endif
#include "EterBase/tea.h"
#include "EterBase/SecureCipher.h"
#include "NetAddress.h"
#include <pcg_random.hpp>
@@ -19,10 +16,6 @@ class CNetworkStream
void SetRecvBufferSize(int recvBufSize);
void SetSendBufferSize(int sendBufSize);
#ifndef _IMPROVED_PACKET_ENCRYPTION_
void SetSecurityMode(bool isSecurityMode, const char* c_szTeaKey);
void SetSecurityMode(bool isSecurityMode, const char* c_szTeaEncryptKey, const char* c_szTeaDecryptKey);
#endif
bool IsSecurityMode();
int GetRecvBufferSize();
@@ -69,20 +62,14 @@ class CNetworkStream
int __GetSendBufferSize();
#ifdef _IMPROVED_PACKET_ENCRYPTION_
size_t Prepare(void* buffer, size_t* length);
bool Activate(size_t agreed_length, const void* buffer, size_t length);
void ActivateCipher();
void DecryptAlreadyReceivedData();
#endif
// Secure cipher methods (libsodium)
SecureCipher& GetSecureCipher() { return m_secureCipher; }
bool IsSecureCipherActivated() const { return m_secureCipher.IsActivated(); }
void ActivateSecureCipher() { m_secureCipher.SetActivated(true); }
private:
time_t m_connectLimitTime;
char* m_recvTEABuf;
int m_recvTEABufInputPos;
int m_recvTEABufSize;
char* m_recvBuf;
int m_recvBufSize;
int m_recvBufInputPos;
@@ -93,20 +80,10 @@ class CNetworkStream
int m_sendBufInputPos;
int m_sendBufOutputPos;
char* m_sendTEABuf;
int m_sendTEABufSize;
int m_sendTEABufInputPos;
bool m_isOnline;
#ifdef _IMPROVED_PACKET_ENCRYPTION_
Cipher m_cipher;
#else
// Obsolete encryption stuff here
bool m_isSecurityMode;
char m_szEncryptKey[TEA_KEY_LENGTH]; // Client 에서 보낼 패킷을 Encrypt 할때 사용하는 Key
char m_szDecryptKey[TEA_KEY_LENGTH]; // Server 에서 전송된 패킷을 Decrypt 할때 사용하는 Key
#endif
// Secure cipher (libsodium/XChaCha20-Poly1305)
SecureCipher m_secureCipher;
SOCKET m_sock;

View File

@@ -3,7 +3,6 @@
add_library(EterLocale STATIC ${FILE_SOURCES})
target_link_libraries(EterLocale
cryptopp-static
mio
)

View File

@@ -3,7 +3,6 @@
add_library(EterPythonLib STATIC ${FILE_SOURCES})
target_link_libraries(EterPythonLib
cryptopp-static
mio
)

View File

@@ -4,7 +4,6 @@ add_library(GameLib STATIC ${FILE_SOURCES})
target_link_libraries(GameLib
lzo2
cryptopp-static
mio
)

View File

@@ -3,7 +3,6 @@
add_library(PRTerrainLib STATIC ${FILE_SOURCES})
target_link_libraries(PRTerrainLib
cryptopp-static
mio
)

View File

@@ -4,7 +4,7 @@ add_library(PackLib STATIC ${FILE_SOURCES})
target_link_libraries(PackLib
libzstd_static
cryptopp-static
sodium
mio
)

View File

@@ -13,6 +13,11 @@ static ZSTD_DCtx* GetThreadLocalZSTDContext()
return g_zstdDCtx;
}
void CPack::DecryptData(uint8_t* data, size_t len, const uint8_t* nonce)
{
crypto_stream_xchacha20_xor(data, data, len, nonce, PACK_KEY.data());
}
bool CPack::Load(const std::string& path)
{
std::error_code ec;
@@ -28,7 +33,6 @@ bool CPack::Load(const std::string& path)
}
memcpy(&m_header, m_file.data(), sizeof(TPackFileHeader));
m_decryption.SetKeyWithIV(PACK_KEY.data(), PACK_KEY.size(), m_header.iv, CryptoPP::Camellia::BLOCKSIZE);
if (file_size < sizeof(TPackFileHeader) + m_header.entry_num * sizeof(TPackFileEntry)) {
return false;
@@ -39,7 +43,7 @@ bool CPack::Load(const std::string& path)
for (size_t i = 0; i < m_header.entry_num; i++) {
TPackFileEntry& entry = m_index[i];
memcpy(&entry, m_file.data() + sizeof(TPackFileHeader) + i * sizeof(TPackFileEntry), sizeof(TPackFileEntry));
m_decryption.ProcessData((CryptoPP::byte*)&entry, (CryptoPP::byte*)&entry, sizeof(TPackFileEntry));
DecryptData((uint8_t*)&entry, sizeof(TPackFileEntry), m_header.nonce);
if (file_size < m_header.data_begin + entry.offset + entry.compressed_size) {
return false;
@@ -79,8 +83,7 @@ bool CPack::GetFileWithPool(const TPackFileEntry& entry, TPackFile& result, CBuf
memcpy(compressed_data.data(), m_file.data() + offset, entry.compressed_size);
m_decryption.Resynchronize(entry.iv, sizeof(entry.iv));
m_decryption.ProcessData(compressed_data.data(), compressed_data.data(), entry.compressed_size);
DecryptData(compressed_data.data(), entry.compressed_size, entry.nonce);
size_t decompressed_size = ZSTD_decompressDCtx(dctx, result.data(), result.size(), compressed_data.data(), compressed_data.size());

View File

@@ -19,9 +19,9 @@ public:
bool GetFileWithPool(const TPackFileEntry& entry, TPackFile& result, CBufferPool* pPool);
private:
void DecryptData(uint8_t* data, size_t len, const uint8_t* nonce);
TPackFileHeader m_header;
std::vector<TPackFileEntry> m_index;
mio::mmap_source m_file;
CryptoPP::CTR_Mode<CryptoPP::Camellia>::Decryption m_decryption;
};

View File

@@ -6,13 +6,12 @@
#include <memory>
#include <unordered_map>
#include <gcm.h>
#include <modes.h>
#include <osrng.h>
#include <secblock.h>
#include <camellia.h>
#include <sodium.h>
constexpr std::array<uint8_t, 32> PACK_KEY = {
constexpr size_t PACK_KEY_SIZE = crypto_stream_xchacha20_KEYBYTES; // 32 bytes
constexpr size_t PACK_NONCE_SIZE = crypto_stream_xchacha20_NONCEBYTES; // 24 bytes
constexpr std::array<uint8_t, PACK_KEY_SIZE> PACK_KEY = {
0x00,0x11,0x22,0x33, 0x44,0x55,0x66,0x77,
0x88,0x99,0xAA,0xBB, 0xCC,0xDD,0xEE,0xFF,
0x01,0x23,0x45,0x67, 0x89,0xAB,0xCD,0xEF,
@@ -24,7 +23,7 @@ struct TPackFileHeader
{
uint64_t entry_num;
uint64_t data_begin;
uint8_t iv[CryptoPP::Camellia::BLOCKSIZE];
uint8_t nonce[PACK_NONCE_SIZE];
};
struct TPackFileEntry
{
@@ -33,7 +32,7 @@ struct TPackFileEntry
uint64_t file_size;
uint64_t compressed_size;
uint8_t encryption;
uint8_t iv[CryptoPP::Camellia::BLOCKSIZE];
uint8_t nonce[PACK_NONCE_SIZE];
};
#pragma pack(pop)

View File

@@ -7,5 +7,5 @@ set_target_properties(PackMaker PROPERTIES
target_link_libraries(PackMaker
libzstd_static
cryptopp-static
sodium
)

View File

@@ -5,13 +5,24 @@
#include <zstd.h>
#include <argparse.hpp>
#include <sodium.h>
#include "PackLib/config.h"
static void EncryptData(uint8_t* data, size_t len, const uint8_t* nonce)
{
crypto_stream_xchacha20_xor(data, data, len, nonce, PACK_KEY.data());
}
int main(int argc, char* argv[])
{
std::setlocale(LC_ALL, "en_US.UTF-8");
if (sodium_init() < 0) {
std::cerr << "Failed to initialize libsodium" << std::endl;
return EXIT_FAILURE;
}
argparse::ArgumentParser program("PackMaker");
program.add_argument("--input")
@@ -77,15 +88,11 @@ int main(int argc, char* argv[])
header.entry_num = entries.size();
header.data_begin = sizeof(TPackFileHeader) + sizeof(TPackFileEntry) * entries.size();
CryptoPP::AutoSeededRandomPool rnd;
rnd.GenerateBlock(header.iv, sizeof(header.iv));
randombytes_buf(header.nonce, sizeof(header.nonce));
ofs.write((const char*) &header, sizeof(header));
ofs.seekp(header.data_begin, std::ios::beg);
CryptoPP::CTR_Mode<CryptoPP::Camellia>::Encryption encryption;
encryption.SetKeyWithIV(PACK_KEY.data(), PACK_KEY.size(), header.iv, CryptoPP::Camellia::BLOCKSIZE);
uint64_t offset = 0;
for (auto& [path, entry] : entries) {
std::ifstream ifs(input / path, std::ios::binary);
@@ -118,9 +125,8 @@ int main(int argc, char* argv[])
if (path.has_extension() && path.extension() == ".py") {
entry.encryption = 1;
rnd.GenerateBlock(entry.iv, sizeof(entry.iv));
encryption.Resynchronize(entry.iv, sizeof(entry.iv));
encryption.ProcessData((uint8_t*)compressed_buffer.data(), (uint8_t*)compressed_buffer.data(), entry.compressed_size);
randombytes_buf(entry.nonce, sizeof(entry.nonce));
EncryptData((uint8_t*)compressed_buffer.data(), entry.compressed_size, entry.nonce);
}
ofs.write(compressed_buffer.data(), entry.compressed_size);
@@ -128,11 +134,10 @@ int main(int argc, char* argv[])
}
ofs.seekp(sizeof(TPackFileHeader), std::ios::beg);
encryption.Resynchronize(header.iv, sizeof(header.iv));
for (auto& [path, entry] : entries) {
TPackFileEntry tmp = entry;
encryption.ProcessData((uint8_t*)&tmp, (uint8_t*)&tmp, sizeof(TPackFileEntry));
EncryptData((uint8_t*)&tmp, sizeof(TPackFileEntry), header.nonce);
ofs.write((const char*)&tmp, sizeof(TPackFileEntry));
}

View File

@@ -3,7 +3,6 @@
add_library(ScriptLib STATIC ${FILE_SOURCES})
target_link_libraries(ScriptLib
cryptopp-static
mio
)

View File

@@ -40,21 +40,36 @@ void Traceback()
PyObject * exc;
PyObject * v;
PyObject * tb;
const char * errStr;
PyErr_Fetch(&exc, &v, &tb);
PyErr_NormalizeException(&exc, &v, &tb);
if (PyString_Check(v))
if (exc)
{
errStr = PyString_AS_STRING(v);
str.append("Error: ");
str.append(errStr);
Tracef("%s\n", errStr);
PyObject* excName = PyObject_GetAttrString(exc, "__name__");
if (excName && PyString_Check(excName))
{
str.append(PyString_AS_STRING(excName));
str.append(": ");
}
Py_XDECREF(excName);
}
Py_DECREF(exc);
Py_DECREF(v);
Py_DECREF(tb);
if (v)
{
PyObject* vStr = PyObject_Str(v);
if (vStr && PyString_Check(vStr))
{
const char* errStr = PyString_AS_STRING(vStr);
str.append(errStr);
Tracef("%s\n", errStr);
}
Py_XDECREF(vStr);
}
Py_XDECREF(exc);
Py_XDECREF(v);
Py_XDECREF(tb);
LogBoxf("Traceback:\n\n%s\n", str.c_str());
}
@@ -241,7 +256,37 @@ bool CPythonLauncher::RunFile(const char* c_szFileName)
if (file.empty())
return false;
return RunMemoryTextFile(c_szFileName, file.size(), file.data());
// Convert \r\n to \n and null-terminate
std::string source;
source.reserve(file.size());
for (size_t i = 0; i < file.size(); ++i)
{
if (file[i] != '\r')
source += (char)file[i];
}
// Compile directly with the filename for proper error reporting
PyObject* code = Py_CompileString(source.c_str(), c_szFileName, Py_file_input);
if (!code)
{
Traceback();
return false;
}
PyObject* result = PyEval_EvalCode((PyCodeObject*)code, m_poDic, m_poDic);
Py_DECREF(code);
if (!result)
{
Traceback();
return false;
}
Py_DECREF(result);
if (Py_FlushLine())
PyErr_Clear();
return true;
}
bool CPythonLauncher::RunLine(const char* c_szSrc)

View File

@@ -3,7 +3,6 @@
add_library(SpeedTreeLib STATIC ${FILE_SOURCES})
target_link_libraries(SpeedTreeLib
cryptopp-static
mio
)

View File

@@ -2,13 +2,6 @@
#include "AccountConnector.h"
#include "Packet.h"
#include "PythonNetworkStream.h"
#include "EterBase/tea.h"
#include "PackLib/PackManager.h"
// CHINA_CRYPT_KEY
extern DWORD g_adwEncryptKey[4];
extern DWORD g_adwDecryptKey[4];
// END_OF_CHINA_CRYPT_KEY
void CAccountConnector::SetHandler(PyObject* poHandler)
{
@@ -29,14 +22,9 @@ void CAccountConnector::ClearLoginInfo( void )
bool CAccountConnector::Connect(const char * c_szAddr, int iPort, const char * c_szAccountAddr, int iAccountPort)
{
#ifndef _IMPROVED_PACKET_ENCRYPTION_
__BuildClientKey();
#endif
m_strAddr = c_szAddr;
m_iPort = iPort;
__OfflineState_Set();
__BuildClientKey_20050304Myevan();
return CNetworkStream::Connect(c_szAccountAddr, iAccountPort);
}
@@ -84,21 +72,12 @@ bool CAccountConnector::__HandshakeState_Process()
if (!__AnalyzePacket(HEADER_GC_PING, sizeof(TPacketGCPing), &CAccountConnector::__AuthState_RecvPing))
return false;
// TODO : 차후 서버와 동일하게 가변길이 data serialize & deserialize 작업해야 한다.
if (!__AnalyzeVarSizePacket(HEADER_GC_HYBRIDCRYPT_KEYS, &CAccountConnector::__AuthState_RecvHybridCryptKeys))
if (!__AnalyzePacket(HEADER_GC_KEY_CHALLENGE, sizeof(TPacketGCKeyChallenge), &CAccountConnector::__AuthState_RecvKeyChallenge))
return false;
if (!__AnalyzeVarSizePacket(HEADER_GC_HYBRIDCRYPT_SDB, &CAccountConnector::__AuthState_RecvHybridCryptSDB))
if (!__AnalyzePacket(HEADER_GC_KEY_COMPLETE, sizeof(TPacketGCKeyComplete), &CAccountConnector::__AuthState_RecvKeyComplete))
return false;
#ifdef _IMPROVED_PACKET_ENCRYPTION_
if (!__AnalyzePacket(HEADER_GC_KEY_AGREEMENT, sizeof(TPacketKeyAgreement), &CAccountConnector::__AuthState_RecvKeyAgreement))
return false;
if (!__AnalyzePacket(HEADER_GC_KEY_AGREEMENT_COMPLETED, sizeof(TPacketKeyAgreementCompleted), &CAccountConnector::__AuthState_RecvKeyAgreementCompleted))
return false;
#endif
return true;
}
@@ -122,22 +101,10 @@ bool CAccountConnector::__AuthState_Process()
if (!__AnalyzePacket(HEADER_GC_HANDSHAKE, sizeof(TPacketGCHandshake), &CAccountConnector::__AuthState_RecvHandshake))
return false;
if (!__AnalyzePacket(HEADER_GC_PANAMA_PACK, sizeof(TPacketGCPanamaPack), &CAccountConnector::__AuthState_RecvPanamaPack))
if (!__AnalyzePacket(HEADER_GC_KEY_CHALLENGE, sizeof(TPacketGCKeyChallenge), &CAccountConnector::__AuthState_RecvKeyChallenge))
return false;
#ifdef _IMPROVED_PACKET_ENCRYPTION_
if (!__AnalyzePacket(HEADER_GC_KEY_AGREEMENT, sizeof(TPacketKeyAgreement), &CAccountConnector::__AuthState_RecvKeyAgreement))
return false;
if (!__AnalyzePacket(HEADER_GC_KEY_AGREEMENT_COMPLETED, sizeof(TPacketKeyAgreementCompleted), &CAccountConnector::__AuthState_RecvKeyAgreementCompleted))
return false;
#endif
// TODO : 차후 서버와 동일하게 가변길이 data serialize & deserialize 작업해야 한다.
if (!__AnalyzeVarSizePacket(HEADER_GC_HYBRIDCRYPT_KEYS, &CAccountConnector::__AuthState_RecvHybridCryptKeys))
return false;
if (!__AnalyzeVarSizePacket(HEADER_GC_HYBRIDCRYPT_SDB, &CAccountConnector::__AuthState_RecvHybridCryptSDB))
if (!__AnalyzePacket(HEADER_GC_KEY_COMPLETE, sizeof(TPacketGCKeyComplete), &CAccountConnector::__AuthState_RecvKeyComplete))
return false;
return true;
@@ -162,11 +129,6 @@ bool CAccountConnector::__AuthState_RecvPhase()
}
else if (kPacketPhase.phase == PHASE_AUTH)
{
#ifndef _IMPROVED_PACKET_ENCRYPTION_
const char* key = GetSecurityKey();
SetSecurityMode(true, key);
#endif
TPacketCGLogin3 LoginPacket;
LoginPacket.header = HEADER_CG_LOGIN3;
@@ -175,16 +137,12 @@ bool CAccountConnector::__AuthState_RecvPhase()
LoginPacket.name[ID_MAX_NUM] = '\0';
LoginPacket.pwd[PASS_MAX_NUM] = '\0';
// 비밀번호를 메모리에 계속 갖고 있는 문제가 있어서, 사용 즉시 날리는 것으로 변경
ClearLoginInfo();
CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance();
rkNetStream.ClearLoginInfo();
m_strPassword = "";
for (DWORD i = 0; i < 4; ++i)
LoginPacket.adwClientKey[i] = g_adwEncryptKey[i];
if (!Send(sizeof(LoginPacket), &LoginPacket))
{
Tracen(" CAccountConnector::__AuthState_RecvPhase - SendLogin3 Error");
@@ -208,71 +166,93 @@ bool CAccountConnector::__AuthState_RecvHandshake()
if (!Recv(sizeof(kPacketHandshake), &kPacketHandshake))
return false;
// HandShake
Tracenf("HANDSHAKE RECV %u %d", kPacketHandshake.dwTime, kPacketHandshake.lDelta);
ELTimer_SetServerMSec(kPacketHandshake.dwTime+ kPacketHandshake.lDelta);
kPacketHandshake.dwTime = kPacketHandshake.dwTime + kPacketHandshake.lDelta + kPacketHandshake.lDelta;
kPacketHandshake.lDelta = 0;
Tracenf("HANDSHAKE SEND %u", kPacketHandshake.dwTime);
if (!Send(sizeof(kPacketHandshake), &kPacketHandshake))
{
Tracenf("HANDSHAKE RECV %u %d", kPacketHandshake.dwTime, kPacketHandshake.lDelta);
ELTimer_SetServerMSec(kPacketHandshake.dwTime+ kPacketHandshake.lDelta);
//DWORD dwBaseServerTime = kPacketHandshake.dwTime+ kPacketHandshake.lDelta;
//DWORD dwBaseClientTime = ELTimer_GetMSec();
kPacketHandshake.dwTime = kPacketHandshake.dwTime + kPacketHandshake.lDelta + kPacketHandshake.lDelta;
kPacketHandshake.lDelta = 0;
Tracenf("HANDSHAKE SEND %u", kPacketHandshake.dwTime);
if (!Send(sizeof(kPacketHandshake), &kPacketHandshake))
{
Tracen(" CAccountConnector::__AuthState_RecvHandshake - SendHandshake Error");
return false;
}
Tracen(" CAccountConnector::__AuthState_RecvHandshake - SendHandshake Error");
return false;
}
return true;
}
bool CAccountConnector::__AuthState_RecvPanamaPack()
bool CAccountConnector::__AuthState_RecvKeyChallenge()
{
TPacketGCPanamaPack kPacket;
if (!Recv(sizeof(TPacketGCPanamaPack), &kPacket))
TPacketGCKeyChallenge packet;
if (!Recv(sizeof(packet), &packet))
return false;
Tracen("KEY_CHALLENGE RECV - Starting secure key exchange");
SecureCipher& cipher = GetSecureCipher();
if (!cipher.Initialize())
{
Tracen("SecureCipher initialization failed");
Disconnect();
return false;
}
if (!cipher.ComputeClientKeys(packet.server_pk))
{
Tracen("Failed to compute client session keys");
Disconnect();
return false;
}
TPacketCGKeyResponse response;
response.bHeader = HEADER_CG_KEY_RESPONSE;
cipher.GetPublicKey(response.client_pk);
cipher.ComputeResponse(packet.challenge, response.challenge_response);
if (!Send(sizeof(response), &response))
{
Tracen("Failed to send key response");
return false;
}
Tracen("KEY_RESPONSE SEND - Awaiting key completion");
return true;
}
bool CAccountConnector::__AuthState_RecvHybridCryptKeys(int iTotalSize)
bool CAccountConnector::__AuthState_RecvKeyComplete()
{
int iFixedHeaderSize = TPacketGCHybridCryptKeys::GetFixedHeaderSize();
TPacketGCHybridCryptKeys kPacket(iTotalSize-iFixedHeaderSize);
if (!Recv(iFixedHeaderSize, &kPacket))
TPacketGCKeyComplete packet;
if (!Recv(sizeof(packet), &packet))
return false;
if (!Recv(kPacket.iKeyStreamLen, kPacket.m_pStream))
return false;
Tracen("KEY_COMPLETE RECV - Decrypting session token");
SecureCipher& cipher = GetSecureCipher();
uint8_t session_token[SecureCipher::SESSION_TOKEN_SIZE];
if (crypto_aead_xchacha20poly1305_ietf_decrypt(
session_token, nullptr,
nullptr,
packet.encrypted_token, sizeof(packet.encrypted_token),
nullptr, 0,
packet.nonce,
cipher.GetRxKey()) != 0)
{
Tracen("Failed to decrypt session token - authentication failed");
Disconnect();
return false;
}
cipher.SetSessionToken(session_token);
cipher.SetActivated(true);
Tracen("Secure channel established - encryption activated");
return true;
}
bool CAccountConnector::__AuthState_RecvHybridCryptSDB(int iTotalSize)
{
int iFixedHeaderSize = TPacketGCHybridSDB::GetFixedHeaderSize();
TPacketGCHybridSDB kPacket(iTotalSize-iFixedHeaderSize);
if (!Recv(iFixedHeaderSize, &kPacket))
return false;
if (!Recv(kPacket.iSDBStreamLen, kPacket.m_pStream))
return false;
return true;
}
bool CAccountConnector::__AuthState_RecvPing()
{
TPacketGCPing kPacketPing;
@@ -309,8 +289,6 @@ bool CAccountConnector::__AuthState_RecvAuthSuccess()
}
else
{
DWORD dwPanamaKey = kAuthSuccessPacket.dwLoginKey ^ g_adwEncryptKey[0] ^ g_adwEncryptKey[1] ^ g_adwEncryptKey[2] ^ g_adwEncryptKey[3];
CPythonNetworkStream & rkNet = CPythonNetworkStream::Instance();
rkNet.SetLoginKey(kAuthSuccessPacket.dwLoginKey);
rkNet.Connect(m_strAddr.c_str(), m_iPort);
@@ -331,72 +309,9 @@ bool CAccountConnector::__AuthState_RecvAuthFailure()
if (m_poHandler)
PyCallClassMemberFunc(m_poHandler, "OnLoginFailure", Py_BuildValue("(s)", packet_failure.szStatus));
// __OfflineState_Set();
return true;
}
#ifdef _IMPROVED_PACKET_ENCRYPTION_
bool CAccountConnector::__AuthState_RecvKeyAgreement()
{
TPacketKeyAgreement packet;
if (!Recv(sizeof(packet), &packet))
{
return false;
}
Tracenf("KEY_AGREEMENT RECV %u", packet.wDataLength);
TPacketKeyAgreement packetToSend;
size_t dataLength = TPacketKeyAgreement::MAX_DATA_LEN;
size_t agreedLength = Prepare(packetToSend.data, &dataLength);
if (agreedLength == 0)
{
// 초기화 실패
Disconnect();
return false;
}
assert(dataLength <= TPacketKeyAgreement::MAX_DATA_LEN);
if (Activate(packet.wAgreedLength, packet.data, packet.wDataLength))
{
// Key agreement 성공, 응답 전송
packetToSend.bHeader = HEADER_CG_KEY_AGREEMENT;
packetToSend.wAgreedLength = (WORD)agreedLength;
packetToSend.wDataLength = (WORD)dataLength;
if (!Send(sizeof(packetToSend), &packetToSend))
{
Tracen(" CAccountConnector::__AuthState_RecvKeyAgreement - SendKeyAgreement Error");
return false;
}
Tracenf("KEY_AGREEMENT SEND %u", packetToSend.wDataLength);
}
else
{
// 키 협상 실패
Disconnect();
return false;
}
return true;
}
bool CAccountConnector::__AuthState_RecvKeyAgreementCompleted()
{
TPacketKeyAgreementCompleted packet;
if (!Recv(sizeof(packet), &packet))
{
return false;
}
Tracenf("KEY_AGREEMENT_COMPLETED RECV");
ActivateCipher();
return true;
}
#endif // _IMPROVED_PACKET_ENCRYPTION_
bool CAccountConnector::__AnalyzePacket(UINT uHeader, UINT uPacketSize, bool (CAccountConnector::*pfnDispatchPacket)())
{
BYTE bHeader;
@@ -412,27 +327,6 @@ bool CAccountConnector::__AnalyzePacket(UINT uHeader, UINT uPacketSize, bool (CA
return (this->*pfnDispatchPacket)();
}
bool CAccountConnector::__AnalyzeVarSizePacket(UINT uHeader, bool (CAccountConnector::*pfnDispatchPacket)(int))
{
BYTE bHeader;
if (!Peek(sizeof(bHeader), &bHeader))
return true;
if (bHeader!=uHeader)
return true;
TDynamicSizePacketHeader dynamicHeader;
if (!Peek(sizeof(dynamicHeader), &dynamicHeader))
return true;
if (!Peek(dynamicHeader.size))
return true;
return (this->*pfnDispatchPacket)(dynamicHeader.size);
}
void CAccountConnector::__OfflineState_Set()
{
__Inialize();
@@ -463,7 +357,6 @@ void CAccountConnector::OnConnectSuccess()
void CAccountConnector::OnRemoteDisconnect()
{
// Matrix Card Number 를 보내 놓았는데 close 되면 프로그램을 종료 한다.
if (m_isWaitKey)
{
if (m_poHandler)
@@ -481,17 +374,6 @@ void CAccountConnector::OnDisconnect()
__OfflineState_Set();
}
#ifndef _IMPROVED_PACKET_ENCRYPTION_
void CAccountConnector::__BuildClientKey()
{
for (DWORD i = 0; i < 4; ++i)
g_adwEncryptKey[i] = random();
const BYTE * c_pszKey = (const BYTE *) "JyTxtHljHJlVJHorRM301vf@4fvj10-v";
tea_encrypt((DWORD *) g_adwDecryptKey, (const DWORD *) g_adwEncryptKey, (const DWORD *) c_pszKey, 16);
}
#endif
void CAccountConnector::__Inialize()
{
m_eState=STATE_OFFLINE;

View File

@@ -1,4 +1,4 @@
#pragma
#pragma once
#include "EterLib/NetStream.h"
#include "EterLib/FuncObject.h"
@@ -49,22 +49,10 @@ class CAccountConnector : public CNetworkStream, public CSingleton<CAccountConne
bool __AuthState_SendPong();
bool __AuthState_RecvAuthSuccess();
bool __AuthState_RecvAuthFailure();
bool __AuthState_RecvPanamaPack();
#ifdef _IMPROVED_PACKET_ENCRYPTION_
bool __AuthState_RecvKeyAgreement();
bool __AuthState_RecvKeyAgreementCompleted();
#endif
bool __AuthState_RecvHybridCryptKeys(int VarSize);
bool __AuthState_RecvHybridCryptSDB(int VarSize);
bool __AuthState_RecvKeyChallenge();
bool __AuthState_RecvKeyComplete();
bool __AnalyzePacket(UINT uHeader, UINT uPacketSize, bool (CAccountConnector::*pfnDispatchPacket)());
// TODO: 지금 현재는 임시다. header뒤에 size 4byte가 무조건 온다는 가정임.
// 제대로 하려면 Packet System Refactoring해야 한다.
bool __AnalyzeVarSizePacket(UINT uHeader, bool (CAccountConnector::*pfnDispatchPacket)(int));
#ifndef _IMPROVED_PACKET_ENCRYPTION_
void __BuildClientKey();
#endif
protected:
UINT m_eState;
@@ -77,7 +65,4 @@ class CAccountConnector : public CNetworkStream, public CSingleton<CAccountConne
PyObject * m_poHandler;
// CHINA_CRYPT_KEY
void __BuildClientKey_20050304Myevan();
// END_OF_CHINA_CRYPT_KEY
};

View File

@@ -25,7 +25,6 @@ target_link_libraries(UserInterface
SphereLib
PackLib
cryptopp-static
lzo2
libzstd_static
mio

View File

@@ -3,7 +3,6 @@
#include "PythonCharacterManager.h"
#include "PythonTextTail.h"
#include "Packet.h"
#include "PackLib/PackManager.h"
// MARK_BUG_FIX
struct SMarkIndex
@@ -193,15 +192,12 @@ UINT CGuildMarkDownloader::__GetPacketSize(UINT header)
return sizeof(TPacketGCMarkBlock);
case HEADER_GC_GUILD_SYMBOL_DATA:
return sizeof(TPacketGCGuildSymbolData);
case HEADER_GC_MARK_DIFF_DATA: // 사용하지 않음
case HEADER_GC_MARK_DIFF_DATA:
return sizeof(BYTE);
#ifdef _IMPROVED_PACKET_ENCRYPTION_
case HEADER_GC_KEY_AGREEMENT:
return sizeof(TPacketKeyAgreement);
case HEADER_GC_KEY_AGREEMENT_COMPLETED:
return sizeof(TPacketKeyAgreementCompleted);
#endif
case HEADER_GC_KEY_CHALLENGE:
return sizeof(TPacketGCKeyChallenge);
case HEADER_GC_KEY_COMPLETE:
return sizeof(TPacketGCKeyComplete);
}
return 0;
}
@@ -222,14 +218,12 @@ bool CGuildMarkDownloader::__DispatchPacket(UINT header)
return __LoginState_RecvMarkBlock();
case HEADER_GC_GUILD_SYMBOL_DATA:
return __LoginState_RecvSymbolData();
case HEADER_GC_MARK_DIFF_DATA: // 사용하지 않음
case HEADER_GC_MARK_DIFF_DATA:
return true;
#ifdef _IMPROVED_PACKET_ENCRYPTION_
case HEADER_GC_KEY_AGREEMENT:
return __LoginState_RecvKeyAgreement();
case HEADER_GC_KEY_AGREEMENT_COMPLETED:
return __LoginState_RecvKeyAgreementCompleted();
#endif
case HEADER_GC_KEY_CHALLENGE:
return __LoginState_RecvKeyChallenge();
case HEADER_GC_KEY_COMPLETE:
return __LoginState_RecvKeyComplete();
}
return false;
}
@@ -279,11 +273,6 @@ bool CGuildMarkDownloader::__LoginState_RecvPhase()
if (kPacketPhase.phase == PHASE_LOGIN)
{
#ifndef _IMPROVED_PACKET_ENCRYPTION_
const char* key = GetSecurityKey();
SetSecurityMode(true, key);
#endif
switch (m_dwTodo)
{
case TODO_RECV_NONE:
@@ -428,66 +417,63 @@ bool CGuildMarkDownloader::__LoginState_RecvMarkBlock()
}
// END_OF_MARK_BUG_FIX
#ifdef _IMPROVED_PACKET_ENCRYPTION_
bool CGuildMarkDownloader::__LoginState_RecvKeyAgreement()
bool CGuildMarkDownloader::__LoginState_RecvKeyChallenge()
{
TPacketKeyAgreement packet;
TPacketGCKeyChallenge packet;
if (!Recv(sizeof(packet), &packet))
{
return false;
}
Tracenf("KEY_AGREEMENT RECV %u", packet.wDataLength);
Tracen("KEY_CHALLENGE RECV");
TPacketKeyAgreement packetToSend;
size_t dataLength = TPacketKeyAgreement::MAX_DATA_LEN;
size_t agreedLength = Prepare(packetToSend.data, &dataLength);
if (agreedLength == 0)
SecureCipher& cipher = GetSecureCipher();
if (!cipher.Initialize())
{
// 초기화 실패
Disconnect();
return false;
}
assert(dataLength <= TPacketKeyAgreement::MAX_DATA_LEN);
if (Activate(packet.wAgreedLength, packet.data, packet.wDataLength))
if (!cipher.ComputeClientKeys(packet.server_pk))
{
// Key agreement 성공, 응답 전송
packetToSend.bHeader = HEADER_CG_KEY_AGREEMENT;
packetToSend.wAgreedLength = (WORD)agreedLength;
packetToSend.wDataLength = (WORD)dataLength;
if (!Send(sizeof(packetToSend), &packetToSend))
{
Tracen(" CAccountConnector::__AuthState_RecvKeyAgreement - SendKeyAgreement Error");
return false;
}
Tracenf("KEY_AGREEMENT SEND %u", packetToSend.wDataLength);
}
else
{
// 키 협상 실패
Disconnect();
return false;
}
TPacketCGKeyResponse response;
response.bHeader = HEADER_CG_KEY_RESPONSE;
cipher.GetPublicKey(response.client_pk);
cipher.ComputeResponse(packet.challenge, response.challenge_response);
if (!Send(sizeof(response), &response))
return false;
Tracen("KEY_RESPONSE SENT");
return true;
}
bool CGuildMarkDownloader::__LoginState_RecvKeyAgreementCompleted()
bool CGuildMarkDownloader::__LoginState_RecvKeyComplete()
{
TPacketKeyAgreementCompleted packet;
TPacketGCKeyComplete packet;
if (!Recv(sizeof(packet), &packet))
return false;
Tracen("KEY_COMPLETE RECV");
SecureCipher& cipher = GetSecureCipher();
uint8_t session_token[SecureCipher::SESSION_TOKEN_SIZE];
if (!cipher.DecryptToken(packet.encrypted_token, sizeof(packet.encrypted_token),
packet.nonce, session_token))
{
Disconnect();
return false;
}
Tracenf("KEY_AGREEMENT_COMPLETED RECV");
ActivateCipher();
cipher.SetSessionToken(session_token);
cipher.SetActivated(true);
Tracen("SECURE CIPHER ACTIVATED");
return true;
}
#endif // _IMPROVED_PACKET_ENCRYPTION_
bool CGuildMarkDownloader::__SendSymbolCRCList()
{

View File

@@ -54,10 +54,8 @@ class CGuildMarkDownloader : public CNetworkStream, public CSingleton<CGuildMark
bool __LoginState_RecvMarkIndex();
bool __LoginState_RecvMarkBlock();
bool __LoginState_RecvSymbolData();
#ifdef _IMPROVED_PACKET_ENCRYPTION_
bool __LoginState_RecvKeyAgreement();
bool __LoginState_RecvKeyAgreementCompleted();
#endif
bool __LoginState_RecvKeyChallenge();
bool __LoginState_RecvKeyComplete();
bool __SendMarkIDXList();
bool __SendMarkCRCList();
bool __SendSymbolCRCList();

View File

@@ -272,13 +272,11 @@ bool CGuildMarkUploader::__LoginState_Process()
if (!__AnalyzePacket(HEADER_GC_PING, sizeof(TPacketGCPing), &CGuildMarkUploader::__LoginState_RecvPing))
return false;
#ifdef _IMPROVED_PACKET_ENCRYPTION_
if (!__AnalyzePacket(HEADER_GC_KEY_AGREEMENT, sizeof(TPacketKeyAgreement), &CGuildMarkUploader::__LoginState_RecvKeyAgreement))
if (!__AnalyzePacket(HEADER_GC_KEY_CHALLENGE, sizeof(TPacketGCKeyChallenge), &CGuildMarkUploader::__LoginState_RecvKeyChallenge))
return false;
if (!__AnalyzePacket(HEADER_GC_KEY_AGREEMENT_COMPLETED, sizeof(TPacketKeyAgreementCompleted), &CGuildMarkUploader::__LoginState_RecvKeyAgreementCompleted))
if (!__AnalyzePacket(HEADER_GC_KEY_COMPLETE, sizeof(TPacketGCKeyComplete), &CGuildMarkUploader::__LoginState_RecvKeyComplete))
return false;
#endif
return true;
}
@@ -330,11 +328,6 @@ bool CGuildMarkUploader::__LoginState_RecvPhase()
if (kPacketPhase.phase==PHASE_LOGIN)
{
#ifndef _IMPROVED_PACKET_ENCRYPTION_
const char* key = GetSecurityKey();
SetSecurityMode(true, key);
#endif
if (SEND_TYPE_MARK == m_dwSendType)
{
if (!__SendMarkPacket())
@@ -384,66 +377,63 @@ bool CGuildMarkUploader::__LoginState_RecvPing()
return true;
}
#ifdef _IMPROVED_PACKET_ENCRYPTION_
bool CGuildMarkUploader::__LoginState_RecvKeyAgreement()
bool CGuildMarkUploader::__LoginState_RecvKeyChallenge()
{
TPacketKeyAgreement packet;
TPacketGCKeyChallenge packet;
if (!Recv(sizeof(packet), &packet))
{
return false;
}
Tracenf("KEY_AGREEMENT RECV %u", packet.wDataLength);
Tracen("KEY_CHALLENGE RECV");
TPacketKeyAgreement packetToSend;
size_t dataLength = TPacketKeyAgreement::MAX_DATA_LEN;
size_t agreedLength = Prepare(packetToSend.data, &dataLength);
if (agreedLength == 0)
SecureCipher& cipher = GetSecureCipher();
if (!cipher.Initialize())
{
// 초기화 실패
Disconnect();
return false;
}
assert(dataLength <= TPacketKeyAgreement::MAX_DATA_LEN);
if (Activate(packet.wAgreedLength, packet.data, packet.wDataLength))
if (!cipher.ComputeClientKeys(packet.server_pk))
{
// Key agreement 성공, 응답 전송
packetToSend.bHeader = HEADER_CG_KEY_AGREEMENT;
packetToSend.wAgreedLength = (WORD)agreedLength;
packetToSend.wDataLength = (WORD)dataLength;
if (!Send(sizeof(packetToSend), &packetToSend))
{
Tracen(" CAccountConnector::__AuthState_RecvKeyAgreement - SendKeyAgreement Error");
return false;
}
Tracenf("KEY_AGREEMENT SEND %u", packetToSend.wDataLength);
}
else
{
// 키 협상 실패
Disconnect();
return false;
}
TPacketCGKeyResponse response;
response.bHeader = HEADER_CG_KEY_RESPONSE;
cipher.GetPublicKey(response.client_pk);
cipher.ComputeResponse(packet.challenge, response.challenge_response);
if (!Send(sizeof(response), &response))
return false;
Tracen("KEY_RESPONSE SENT");
return true;
}
bool CGuildMarkUploader::__LoginState_RecvKeyAgreementCompleted()
bool CGuildMarkUploader::__LoginState_RecvKeyComplete()
{
TPacketKeyAgreementCompleted packet;
TPacketGCKeyComplete packet;
if (!Recv(sizeof(packet), &packet))
return false;
Tracen("KEY_COMPLETE RECV");
SecureCipher& cipher = GetSecureCipher();
uint8_t session_token[SecureCipher::SESSION_TOKEN_SIZE];
if (!cipher.DecryptToken(packet.encrypted_token, sizeof(packet.encrypted_token),
packet.nonce, session_token))
{
Disconnect();
return false;
}
Tracenf("KEY_AGREEMENT_COMPLETED RECV");
ActivateCipher();
cipher.SetSessionToken(session_token);
cipher.SetActivated(true);
Tracen("SECURE CIPHER ACTIVATED");
return true;
}
#endif // _IMPROVED_PACKET_ENCRYPTION_
bool CGuildMarkUploader::__AnalyzePacket(UINT uHeader, UINT uPacketSize, bool (CGuildMarkUploader::*pfnDispatchPacket)())
{

View File

@@ -88,10 +88,8 @@ class CGuildMarkUploader : public CNetworkStream, public CSingleton<CGuildMarkUp
bool __LoginState_RecvPhase();
bool __LoginState_RecvHandshake();
bool __LoginState_RecvPing();
#ifdef _IMPROVED_PACKET_ENCRYPTION_
bool __LoginState_RecvKeyAgreement();
bool __LoginState_RecvKeyAgreementCompleted();
#endif
bool __LoginState_RecvKeyChallenge();
bool __LoginState_RecvKeyComplete();
bool __AnalyzePacket(UINT uHeader, UINT uPacketSize, bool (CGuildMarkUploader::*pfnDispatchPacket)());

View File

@@ -6,12 +6,6 @@
#include <windowsx.h>
#ifndef LSS_SECURITY_KEY
#define LSS_SECURITY_KEY "testtesttesttest"
#endif
std::string __SECURITY_KEY_STRING__ = LSS_SECURITY_KEY;
char MULTI_LOCALE_PATH_COMMON[256] = "locale/common";
char MULTI_LOCALE_PATH[256] = "locale/en";
char MULTI_LOCALE_NAME[256] = "en";
@@ -100,11 +94,6 @@ int GetSkillPower(unsigned level)
return SKILL_POWERS[level];
}
const char* GetSecurityKey()
{
return __SECURITY_KEY_STRING__.c_str();
}
const char* GetLocaleName()
{
return MULTI_LOCALE_NAME;

View File

@@ -5,8 +5,6 @@
const char* GetLocaleName();
const char* GetLocalePath();
const char* GetLocalePathCommon();
const char* GetSecurityKey();
bool IsRTL();
int StringCompareCI( LPCSTR szStringLeft, LPCSTR szStringRight, size_t sizeLength );
void LoadConfig(const char* fileName);

View File

@@ -1,5 +1,3 @@
#define _IMPROVED_PACKET_ENCRYPTION_
#define ENABLE_COSTUME_SYSTEM
#define ENABLE_ENERGY_SYSTEM
#define ENABLE_DRAGON_SOUL_SYSTEM

View File

@@ -11,7 +11,6 @@ enum
/////////////////////////////////////////////////
// To Server
// HEADER_BLANK is the not use(for future use)
HEADER_CG_LOGIN = 1,
HEADER_CG_ATTACK = 2,
HEADER_CG_CHAT = 3,
HEADER_CG_PLAYER_CREATE = 4, // 새로운 플래이어를 생성
@@ -131,7 +130,8 @@ enum
HEADER_CG_DRAGON_SOUL_REFINE = 205,
HEADER_CG_STATE_CHECKER = 206,
HEADER_CG_KEY_AGREEMENT = 0xfb, // _IMPROVED_PACKET_ENCRYPTION_
HEADER_CG_KEY_RESPONSE = 0xf9, // Secure key exchange response
HEADER_CG_LOGIN_SECURE = 0xf6, // Secure login packet
HEADER_CG_TIME_SYNC = 0xfc,
HEADER_CG_CLIENT_VERSION = 0xfd,
HEADER_CG_CLIENT_VERSION2 = 0xf1,
@@ -288,21 +288,15 @@ enum
// END_OF_SUPPORT_BGM
HEADER_GC_AUTH_SUCCESS = 150,
HEADER_GC_PANAMA_PACK = 151,
//HYBRID CRYPT
HEADER_GC_HYBRIDCRYPT_KEYS = 152,
HEADER_GC_HYBRIDCRYPT_SDB = 153, // SDB means Supplmentary Data Blocks
//HYBRID CRYPT
HEADER_GC_SPECIFIC_EFFECT = 208,
HEADER_GC_DRAGON_SOUL_REFINE = 209,
HEADER_GC_DRAGON_SOUL_REFINE = 209,
HEADER_GC_RESPOND_CHANNELSTATUS = 210,
HEADER_GC_ITEM_GET = 211,
HEADER_GC_KEY_AGREEMENT_COMPLETED = 0xfa, // _IMPROVED_PACKET_ENCRYPTION_
HEADER_GC_KEY_AGREEMENT = 0xfb, // _IMPROVED_PACKET_ENCRYPTION_
HEADER_GC_KEY_CHALLENGE = 0xf8, // Secure key exchange challenge
HEADER_GC_KEY_COMPLETE = 0xf7, // Secure key exchange complete
HEADER_GC_HANDSHAKE_OK = 0xfc, // 252
HEADER_GC_PHASE = 0xfd, // 253
HEADER_GC_BINDUDP = 0xfe, // 254
@@ -479,20 +473,12 @@ typedef struct command_checkin
char pwd[PASS_MAX_NUM+1];
} TPacketCGCheckin;
typedef struct command_login
{
uint8_t header;
char name[ID_MAX_NUM + 1];
char pwd[PASS_MAX_NUM + 1];
} TPacketCGLogin;
// start - 권한 서버 접속을 위한 패킷들
typedef struct command_login2
{
uint8_t header;
char name[ID_MAX_NUM + 1];
uint32_t login_key;
uint32_t adwClientKey[4];
} TPacketCGLogin2;
typedef struct command_login3
@@ -500,7 +486,6 @@ typedef struct command_login3
uint8_t header;
char name[ID_MAX_NUM + 1];
char pwd[PASS_MAX_NUM + 1];
uint32_t adwClientKey[4];
} TPacketCGLogin3;
typedef struct command_direct_enter
@@ -2468,70 +2453,6 @@ typedef struct SPacketGCResetOnTime
uint8_t header;
} TPacketGCResetOnTime;
typedef struct SPacketGCPanamaPack
{
uint8_t bHeader;
char szPackName[256];
uint8_t abIV[32];
} TPacketGCPanamaPack;
typedef struct SPacketGCHybridCryptKeys
{
private:
SPacketGCHybridCryptKeys() : m_pStream(NULL) {}
public:
SPacketGCHybridCryptKeys(int32_t iStreamSize) : iKeyStreamLen(iStreamSize)
{
m_pStream = new uint8_t[iStreamSize];
}
~SPacketGCHybridCryptKeys()
{
if( m_pStream )
{
delete[] m_pStream;
m_pStream = NULL;
}
}
static int32_t GetFixedHeaderSize()
{
return sizeof(uint8_t)+sizeof(uint16_t)+sizeof(int32_t);
}
uint8_t bHeader;
uint16_t wDynamicPacketSize;
int32_t iKeyStreamLen;
uint8_t* m_pStream;
} TPacketGCHybridCryptKeys;
typedef struct SPacketGCHybridSDB
{
private:
SPacketGCHybridSDB() : m_pStream(NULL) {}
public:
SPacketGCHybridSDB(int32_t iStreamSize) : iSDBStreamLen(iStreamSize)
{
m_pStream = new uint8_t[iStreamSize];
}
~SPacketGCHybridSDB()
{
delete[] m_pStream;
m_pStream = NULL;
}
static int32_t GetFixedHeaderSize()
{
return sizeof(uint8_t)+sizeof(uint16_t)+sizeof(int32_t);
}
uint8_t bHeader;
uint16_t wDynamicPacketSize;
int32_t iSDBStreamLen;
uint8_t* m_pStream;
} TPacketGCHybridSDB;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Client To Client
@@ -2556,22 +2477,43 @@ typedef struct packet_autoban_quiz
} TPacketGCAutoBanQuiz;
// END_OF_AUTOBAN
#ifdef _IMPROVED_PACKET_ENCRYPTION_
struct TPacketKeyAgreement
// Secure authentication packets (libsodium/XChaCha20-Poly1305)
#pragma pack(push, 1)
// Server -> Client: Key exchange challenge
struct TPacketGCKeyChallenge
{
static const int32_t MAX_DATA_LEN = 256;
uint8_t bHeader;
uint16_t wAgreedLength;
uint16_t wDataLength;
uint8_t data[MAX_DATA_LEN];
uint8_t bHeader; // HEADER_GC_KEY_CHALLENGE (0xf8)
uint8_t server_pk[32]; // Server's X25519 public key
uint8_t challenge[32]; // Random challenge bytes
};
struct TPacketKeyAgreementCompleted
// Client -> Server: Key exchange response
struct TPacketCGKeyResponse
{
uint8_t bHeader;
uint8_t data[3]; // dummy (not used)
uint8_t bHeader; // HEADER_CG_KEY_RESPONSE (0xf9)
uint8_t client_pk[32]; // Client's X25519 public key
uint8_t challenge_response[32]; // HMAC(challenge, rx_key)
};
#endif // _IMPROVED_PACKET_ENCRYPTION_
// Server -> Client: Key exchange complete
struct TPacketGCKeyComplete
{
uint8_t bHeader; // HEADER_GC_KEY_COMPLETE (0xf7)
uint8_t encrypted_token[32 + 16]; // Session token + Poly1305 tag
uint8_t nonce[24]; // XChaCha20 nonce
};
// Client -> Server: Secure login
struct TPacketCGLoginSecure
{
uint8_t bHeader; // HEADER_CG_LOGIN_SECURE (0xf6)
char name[ID_MAX_NUM + 1];
char pwd[PASS_MAX_NUM + 1];
uint8_t session_token[32]; // Session token from KeyComplete
};
#pragma pack(pop)
typedef struct SPacketGCSpecificEffect
{

View File

@@ -108,10 +108,9 @@ class CMainPacketHeaderMap : public CNetworkPacketHeaderMap
Set(HEADER_GC_BINDUDP, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCBindUDP), STATIC_SIZE_PACKET));
Set(HEADER_GC_OWNERSHIP, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCOwnership), STATIC_SIZE_PACKET));
Set(HEADER_GC_CREATE_FLY, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCCreateFly), STATIC_SIZE_PACKET));
#ifdef _IMPROVED_PACKET_ENCRYPTION_
Set(HEADER_GC_KEY_AGREEMENT, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketKeyAgreement), STATIC_SIZE_PACKET));
Set(HEADER_GC_KEY_AGREEMENT_COMPLETED, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketKeyAgreementCompleted), STATIC_SIZE_PACKET));
#endif
// Secure key exchange (libsodium)
Set(HEADER_GC_KEY_CHALLENGE, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCKeyChallenge), STATIC_SIZE_PACKET));
Set(HEADER_GC_KEY_COMPLETE, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCKeyComplete), STATIC_SIZE_PACKET));
Set(HEADER_GC_ADD_FLY_TARGETING, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCFlyTargeting), STATIC_SIZE_PACKET));
Set(HEADER_GC_FLY_TARGETING, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCFlyTargeting), STATIC_SIZE_PACKET));
@@ -174,8 +173,6 @@ class CMainPacketHeaderMap : public CNetworkPacketHeaderMap
Set(HEADER_GC_DIG_MOTION, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCDigMotion), STATIC_SIZE_PACKET));
Set(HEADER_GC_DAMAGE_INFO, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCDamageInfo), STATIC_SIZE_PACKET));
Set(HEADER_GC_HYBRIDCRYPT_KEYS, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCHybridCryptKeys), DYNAMIC_SIZE_PACKET));
Set(HEADER_GC_HYBRIDCRYPT_SDB, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCHybridSDB), DYNAMIC_SIZE_PACKET));
Set(HEADER_GC_SPECIFIC_EFFECT, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCSpecificEffect), STATIC_SIZE_PACKET));
Set(HEADER_GC_DRAGON_SOUL_REFINE, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCDragonSoulRefine), STATIC_SIZE_PACKET));

View File

@@ -270,13 +270,10 @@ class CPythonNetworkStream : public CNetworkStream, public CSingleton<CPythonNet
bool RecvHandshakePacket();
bool RecvHandshakeOKPacket();
bool RecvHybridCryptKeyPacket();
bool RecvHybridCryptSDBPacket();
#ifdef _IMPROVED_PACKET_ENCRYPTION_
bool RecvKeyAgreementPacket();
bool RecvKeyAgreementCompletedPacket();
// Secure key exchange (libsodium/XChaCha20-Poly1305)
bool RecvKeyChallenge();
bool RecvKeyComplete();
#endif
// ETC
DWORD GetMainActorVID();
DWORD GetMainActorRace();
@@ -299,9 +296,7 @@ class CPythonNetworkStream : public CNetworkStream, public CSingleton<CPythonNet
void ClosePhase();
// Login Phase
bool SendLoginPacket(const char * c_szName, const char * c_szPassword);
bool SendLoginPacketNew(const char * c_szName, const char * c_szPassword);
bool SendDirectEnterPacket(const char * c_szName, const char * c_szPassword, UINT uChrSlot);
bool SendEnterGame();

View File

@@ -407,7 +407,7 @@ PyObject* netSendLoginPacket(PyObject* poSelf, PyObject* poArgs)
return Py_BuildException();
CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance();
rkNetStream.SendLoginPacket(szName, szPwd);
rkNetStream.SendLoginPacketNew(szName, szPwd);
return Py_BuildNone();
}

View File

@@ -599,29 +599,16 @@ void CPythonNetworkStream::GamePhase()
return;
break;
case HEADER_GC_HYBRIDCRYPT_KEYS:
RecvHybridCryptKeyPacket();
case HEADER_GC_KEY_CHALLENGE:
RecvKeyChallenge();
return;
break;
case HEADER_GC_HYBRIDCRYPT_SDB:
RecvHybridCryptSDBPacket();
case HEADER_GC_KEY_COMPLETE:
RecvKeyComplete();
return;
break;
#ifdef _IMPROVED_PACKET_ENCRYPTION_
case HEADER_GC_KEY_AGREEMENT:
RecvKeyAgreementPacket();
return;
break;
case HEADER_GC_KEY_AGREEMENT_COMPLETED:
RecvKeyAgreementCompletedPacket();
return;
break;
#endif
case HEADER_GC_SPECIFIC_EFFECT:
ret = RecvSpecificEffect();
break;

View File

@@ -2,7 +2,6 @@
#include "PythonNetworkStream.h"
#include "PythonApplication.h"
#include "Packet.h"
#include "PackLib/PackManager.h"
// HandShake ---------------------------------------------------------------------------
void CPythonNetworkStream::HandShakePhase()
@@ -39,9 +38,6 @@ void CPythonNetworkStream::HandShakePhase()
ELTimer_SetServerMSec(m_HandshakeData.dwTime+ m_HandshakeData.lDelta);
//m_dwBaseServerTime = m_HandshakeData.dwTime+ m_HandshakeData.lDelta;
//m_dwBaseClientTime = ELTimer_GetMSec();
m_HandshakeData.dwTime = m_HandshakeData.dwTime + m_HandshakeData.lDelta + m_HandshakeData.lDelta;
m_HandshakeData.lDelta = 0;
@@ -57,32 +53,21 @@ void CPythonNetworkStream::HandShakePhase()
return;
}
break;
case HEADER_GC_PING:
RecvPingPacket();
return;
break;
case HEADER_GC_HYBRIDCRYPT_KEYS:
RecvHybridCryptKeyPacket();
case HEADER_GC_KEY_CHALLENGE:
RecvKeyChallenge();
return;
break;
case HEADER_GC_HYBRIDCRYPT_SDB:
RecvHybridCryptSDBPacket();
case HEADER_GC_KEY_COMPLETE:
RecvKeyComplete();
return;
break;
#ifdef _IMPROVED_PACKET_ENCRYPTION_
case HEADER_GC_KEY_AGREEMENT:
RecvKeyAgreementPacket();
return;
break;
case HEADER_GC_KEY_AGREEMENT_COMPLETED:
RecvKeyAgreementCompletedPacket();
return;
break;
#endif
}
RecvErrorPacket(header);
@@ -107,7 +92,6 @@ void CPythonNetworkStream::SetHandShakePhase()
if (__DirectEnterMode_IsSet())
{
// None
}
else
{
@@ -157,103 +141,71 @@ bool CPythonNetworkStream::RecvHandshakeOKPacket()
return true;
}
bool CPythonNetworkStream::RecvHybridCryptKeyPacket()
// Secure key exchange handlers (libsodium/XChaCha20-Poly1305)
bool CPythonNetworkStream::RecvKeyChallenge()
{
int iFixedHeaderSize = TPacketGCHybridCryptKeys::GetFixedHeaderSize();
TDynamicSizePacketHeader header;
if( !Peek( sizeof(header), &header) )
return false;
TPacketGCHybridCryptKeys kPacket(header.size-iFixedHeaderSize);
if (!Recv(iFixedHeaderSize, &kPacket))
return false;
if (!Recv(kPacket.iKeyStreamLen, kPacket.m_pStream))
return false;
return true;
}
bool CPythonNetworkStream::RecvHybridCryptSDBPacket()
{
int iFixedHeaderSize = TPacketGCHybridSDB::GetFixedHeaderSize();
TDynamicSizePacketHeader header;
if( !Peek( sizeof(header), &header) )
return false;
TPacketGCHybridSDB kPacket(header.size-iFixedHeaderSize);
if (!Recv(iFixedHeaderSize, &kPacket))
return false;
if (!Recv(kPacket.iSDBStreamLen, kPacket.m_pStream))
return false;
return true;
}
#ifdef _IMPROVED_PACKET_ENCRYPTION_
bool CPythonNetworkStream::RecvKeyAgreementPacket()
{
TPacketKeyAgreement packet;
TPacketGCKeyChallenge packet;
if (!Recv(sizeof(packet), &packet))
{
return false;
}
Tracenf("KEY_AGREEMENT RECV %u", packet.wDataLength);
Tracen("SECURE KEY_CHALLENGE RECV");
TPacketKeyAgreement packetToSend;
size_t dataLength = TPacketKeyAgreement::MAX_DATA_LEN;
size_t agreedLength = Prepare(packetToSend.data, &dataLength);
if (agreedLength == 0)
SecureCipher& cipher = GetSecureCipher();
if (!cipher.Initialize())
{
// 초기화 실패
TraceError("Failed to initialize SecureCipher");
Disconnect();
return false;
}
assert(dataLength <= TPacketKeyAgreement::MAX_DATA_LEN);
if (Activate(packet.wAgreedLength, packet.data, packet.wDataLength))
if (!cipher.ComputeClientKeys(packet.server_pk))
{
// Key agreement 성공, 응답 전송
packetToSend.bHeader = HEADER_CG_KEY_AGREEMENT;
packetToSend.wAgreedLength = (WORD)agreedLength;
packetToSend.wDataLength = (WORD)dataLength;
if (!Send(sizeof(packetToSend), &packetToSend))
{
assert(!"Failed Sending KeyAgreement");
return false;
}
Tracenf("KEY_AGREEMENT SEND %u", packetToSend.wDataLength);
}
else
{
// 키 협상 실패
TraceError("Failed to compute client session keys");
Disconnect();
return false;
}
TPacketCGKeyResponse response;
response.bHeader = HEADER_CG_KEY_RESPONSE;
cipher.GetPublicKey(response.client_pk);
cipher.ComputeChallengeResponse(packet.challenge, response.challenge_response);
if (!Send(sizeof(response), &response))
{
TraceError("Failed to send KeyResponse");
return false;
}
Tracen("SECURE KEY_RESPONSE SENT");
return true;
}
bool CPythonNetworkStream::RecvKeyAgreementCompletedPacket()
bool CPythonNetworkStream::RecvKeyComplete()
{
TPacketKeyAgreementCompleted packet;
TPacketGCKeyComplete packet;
if (!Recv(sizeof(packet), &packet))
{
return false;
}
Tracenf("KEY_AGREEMENT_COMPLETED RECV");
Tracen("SECURE KEY_COMPLETE RECV");
ActivateCipher();
DecryptAlreadyReceivedData();
SecureCipher& cipher = GetSecureCipher();
uint8_t decrypted_token[SecureCipher::SESSION_TOKEN_SIZE];
if (!cipher.DecryptToken(packet.encrypted_token, sizeof(packet.encrypted_token),
packet.nonce, decrypted_token))
{
TraceError("Failed to decrypt session token");
Disconnect();
return false;
}
cipher.SetSessionToken(decrypted_token);
cipher.SetActivated(true);
Tracen("SECURE CIPHER ACTIVATED");
return true;
}
#endif // _IMPROVED_PACKET_ENCRYPTION_

View File

@@ -142,17 +142,16 @@ void CPythonNetworkStream::LoadingPhase()
return;
break;
case HEADER_GC_HYBRIDCRYPT_KEYS:
RecvHybridCryptKeyPacket();
case HEADER_GC_KEY_CHALLENGE:
RecvKeyChallenge();
return;
break;
case HEADER_GC_HYBRIDCRYPT_SDB:
RecvHybridCryptSDBPacket();
case HEADER_GC_KEY_COMPLETE:
RecvKeyComplete();
return;
break;
default:
GamePhase();
return;

View File

@@ -47,13 +47,13 @@ void CPythonNetworkStream::LoginPhase()
return;
break;
case HEADER_GC_HYBRIDCRYPT_KEYS:
RecvHybridCryptKeyPacket();
case HEADER_GC_KEY_CHALLENGE:
RecvKeyChallenge();
return;
break;
case HEADER_GC_HYBRIDCRYPT_SDB:
RecvHybridCryptSDBPacket();
case HEADER_GC_KEY_COMPLETE:
RecvKeyComplete();
return;
break;
@@ -68,11 +68,6 @@ void CPythonNetworkStream::LoginPhase()
void CPythonNetworkStream::SetLoginPhase()
{
const char* key = GetSecurityKey();
#ifndef _IMPROVED_PACKET_ENCRYPTION_
SetSecurityMode(true, key);
#endif
if ("Login" != m_strPhase)
m_phaseLeaveFunc.Run();
@@ -87,26 +82,25 @@ void CPythonNetworkStream::SetLoginPhase()
m_dwChangingPhaseTime = ELTimer_GetMSec();
if (0 == m_dwLoginKey)
{
TraceError("SetLoginPhase: no login key - cannot login without auth server");
ClearLoginInfo();
return;
}
if (__DirectEnterMode_IsSet())
{
if (0 != m_dwLoginKey)
SendLoginPacketNew(m_stID.c_str(), m_stPassword.c_str());
else
SendLoginPacket(m_stID.c_str(), m_stPassword.c_str());
SendLoginPacketNew(m_stID.c_str(), m_stPassword.c_str());
// 비밀번호를 메모리에 계속 갖고 있는 문제가 있어서, 사용 즉시 날리는 것으로 변경
ClearLoginInfo();
CAccountConnector & rkAccountConnector = CAccountConnector::Instance();
rkAccountConnector.ClearLoginInfo();
}
else
{
if (0 != m_dwLoginKey)
SendLoginPacketNew(m_stID.c_str(), m_stPassword.c_str());
else
SendLoginPacket(m_stID.c_str(), m_stPassword.c_str());
SendLoginPacketNew(m_stID.c_str(), m_stPassword.c_str());
// 비밀번호를 메모리에 계속 갖고 있는 문제가 있어서, 사용 즉시 날리는 것으로 변경
ClearLoginInfo();
CAccountConnector & rkAccountConnector = CAccountConnector::Instance();
rkAccountConnector.ClearLoginInfo();
@@ -208,43 +202,6 @@ bool CPythonNetworkStream::__RecvLoginFailurePacket()
return true;
}
bool CPythonNetworkStream::SendDirectEnterPacket(const char* c_szID, const char* c_szPassword, UINT uChrSlot)
{
TPacketCGDirectEnter kPacketDirectEnter;
kPacketDirectEnter.bHeader=HEADER_CG_DIRECT_ENTER;
kPacketDirectEnter.index=uChrSlot;
strncpy(kPacketDirectEnter.login, c_szID, ID_MAX_NUM);
strncpy(kPacketDirectEnter.passwd, c_szPassword, PASS_MAX_NUM);
if (!Send(sizeof(kPacketDirectEnter), &kPacketDirectEnter))
{
Tracen("SendDirectEnter");
return false;
}
return SendSequence();
}
bool CPythonNetworkStream::SendLoginPacket(const char* c_szName, const char* c_szPassword)
{
TPacketCGLogin LoginPacket;
LoginPacket.header = HEADER_CG_LOGIN;
strncpy(LoginPacket.name, c_szName, sizeof(LoginPacket.name)-1);
strncpy(LoginPacket.pwd, c_szPassword, sizeof(LoginPacket.pwd)-1);
LoginPacket.name[ID_MAX_NUM]='\0';
LoginPacket.pwd[PASS_MAX_NUM]='\0';
if (!Send(sizeof(LoginPacket), &LoginPacket))
{
Tracen("SendLogin Error");
return false;
}
return SendSequence();
}
bool CPythonNetworkStream::SendLoginPacketNew(const char * c_szName, const char * c_szPassword)
{
TPacketCGLogin2 LoginPacket;
@@ -254,11 +211,6 @@ bool CPythonNetworkStream::SendLoginPacketNew(const char * c_szName, const char
strncpy(LoginPacket.name, c_szName, sizeof(LoginPacket.name)-1);
LoginPacket.name[ID_MAX_NUM]='\0';
extern DWORD g_adwEncryptKey[4];
extern DWORD g_adwDecryptKey[4];
for (DWORD i = 0; i < 4; ++i)
LoginPacket.adwClientKey[i] = g_adwEncryptKey[i];
if (!Send(sizeof(LoginPacket), &LoginPacket))
{
Tracen("SendLogin Error");
@@ -273,9 +225,6 @@ bool CPythonNetworkStream::SendLoginPacketNew(const char * c_szName, const char
__SendInternalBuffer();
#ifndef _IMPROVED_PACKET_ENCRYPTION_
SetSecurityMode(true, (const char *) g_adwEncryptKey, (const char *) g_adwDecryptKey);
#endif
return true;
}

View File

@@ -2,9 +2,6 @@
#include "PythonNetworkStream.h"
#include "Packet.h"
extern DWORD g_adwEncryptKey[4];
extern DWORD g_adwDecryptKey[4];
// Select Character ---------------------------------------------------------------------------
void CPythonNetworkStream::SetSelectPhase()
{
@@ -17,10 +14,6 @@ void CPythonNetworkStream::SetSelectPhase()
m_strPhase = "Select";
#ifndef _IMPROVED_PACKET_ENCRYPTION_
SetSecurityMode(true, (const char *) g_adwEncryptKey, (const char *) g_adwDecryptKey);
#endif
m_dwChangingPhaseTime = ELTimer_GetMSec();
m_phaseProcessFunc.Set(this, &CPythonNetworkStream::SelectPhase);
m_phaseLeaveFunc.Set(this, &CPythonNetworkStream::__LeaveSelectPhase);
@@ -103,29 +96,16 @@ void CPythonNetworkStream::SelectPhase()
return;
break;
case HEADER_GC_HYBRIDCRYPT_KEYS:
RecvHybridCryptKeyPacket();
case HEADER_GC_KEY_CHALLENGE:
RecvKeyChallenge();
return;
break;
case HEADER_GC_HYBRIDCRYPT_SDB:
RecvHybridCryptSDBPacket();
case HEADER_GC_KEY_COMPLETE:
RecvKeyComplete();
return;
break;
#ifdef _IMPROVED_PACKET_ENCRYPTION_
case HEADER_GC_KEY_AGREEMENT:
RecvKeyAgreementPacket();
return;
break;
case HEADER_GC_KEY_AGREEMENT_COMPLETED:
RecvKeyAgreementCompletedPacket();
return;
break;
#endif
case HEADER_GC_PLAYER_POINT_CHANGE:
TPacketGCPointChange PointChange;
Recv(sizeof(TPacketGCPointChange), &PointChange);

View File

@@ -1,42 +1,5 @@
#include "StdAfx.h"
#include "PackLib/PackManager.h"
#include "EterBase/tea.h"
// CHINA_CRYPT_KEY
DWORD g_adwEncryptKey[4];
DWORD g_adwDecryptKey[4];
#include "AccountConnector.h"
inline const BYTE* GetKey_20050304Myevan()
{
volatile static DWORD s_adwKey[1938];
volatile DWORD seed=1491971513;
for (UINT i=0; i<BYTE(seed); i++)
{
seed^=2148941891;
seed+=3592385981;
s_adwKey[i]=seed;
}
return (const BYTE*)s_adwKey;
}
//#include <eterCrypt.h>
void CAccountConnector::__BuildClientKey_20050304Myevan()
{
const BYTE * c_pszKey = GetKey_20050304Myevan();
memcpy(g_adwEncryptKey, c_pszKey+157, 16);
for (DWORD i = 0; i < 4; ++i)
g_adwEncryptKey[i] = random();
tea_encrypt((DWORD *) g_adwDecryptKey, (const DWORD *) g_adwEncryptKey, (const DWORD *) (c_pszKey+37), 16);
// TEA_Encrypt((DWORD *) g_adwDecryptKey, (const DWORD *) g_adwEncryptKey, (const DWORD *) (c_pszKey+37), 16);
}
// END_OF_CHINA_CRYPT_KEY
PyObject * packExist(PyObject * poSelf, PyObject * poArgs)
{

View File

@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <utf8.h>
#include <sodium.h>
extern "C" {
extern int _fltused;
@@ -290,6 +291,12 @@ static bool Main(HINSTANCE hInstance, LPSTR lpCmdLine)
OpenLogFile(false); // false == uses syserr.txt only
#endif
if (sodium_init() < 0)
{
LogBox("sodium_init() failed");
return false;
}
static CLZO lzo;
CPackManager packMgr;

View File

@@ -1,6 +1,6 @@
add_subdirectory(cryptopp)
add_subdirectory(lzo-2.10)
add_subdirectory(mio)
add_subdirectory(libsodium)
## zstd is a bit tricky
set(ZSTD_BUILD_SHARED OFF CACHE BOOL "BUILD SHARED LIBRARIES" FORCE)
@@ -8,8 +8,8 @@ add_subdirectory(zstd-1.5.7/build/cmake zstd)
include_directories("zstd/lib")
if (WIN32)
set_target_properties(cryptopp-static PROPERTIES FOLDER vendor)
set_target_properties(lzo2 PROPERTIES FOLDER vendor)
set_target_properties(sodium PROPERTIES FOLDER vendor)
## zstd stuff
set_target_properties(zstd PROPERTIES FOLDER vendor/zstd)

View File

@@ -1,143 +0,0 @@
// 3way.cpp - modified by Wei Dai from Joan Daemen's 3way.c
// The original code and all modifications are in the public domain.
#include "pch.h"
#include "3way.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ThreeWay_TestInstantiations()
{
ThreeWay::Encryption x1;
ThreeWay::Decryption x2;
}
#endif
namespace
{
const word32 START_E = 0x0b0b; // round constant of first encryption round
const word32 START_D = 0xb1b1; // round constant of first decryption round
}
static inline word32 reverseBits(word32 a)
{
a = ((a & 0xAAAAAAAA) >> 1) | ((a & 0x55555555) << 1);
a = ((a & 0xCCCCCCCC) >> 2) | ((a & 0x33333333) << 2);
return ((a & 0xF0F0F0F0) >> 4) | ((a & 0x0F0F0F0F) << 4);
}
#define mu(a0, a1, a2) \
{ \
a1 = reverseBits(a1); \
word32 t = reverseBits(a0); \
a0 = reverseBits(a2); \
a2 = t; \
}
#define pi_gamma_pi(a0, a1, a2) \
{ \
word32 b0, b2; \
b2 = rotlConstant<1>(a2); \
b0 = rotlConstant<22>(a0); \
a0 = rotlConstant<1>(b0 ^ (a1|(~b2))); \
a2 = rotlConstant<22>(b2 ^ (b0|(~a1))); \
a1 ^= (b2|(~b0)); \
}
// thanks to Paulo Barreto for this optimized theta()
#define theta(a0, a1, a2) \
{ \
word32 b0, b1, c; \
c = a0 ^ a1 ^ a2; \
c = rotlConstant<16>(c) ^ rotlConstant<8>(c); \
b0 = (a0 << 24) ^ (a2 >> 8) ^ (a1 << 8) ^ (a0 >> 24); \
b1 = (a1 << 24) ^ (a0 >> 8) ^ (a2 << 8) ^ (a1 >> 24); \
a0 ^= c ^ b0; \
a1 ^= c ^ b1; \
a2 ^= c ^ (b0 >> 16) ^ (b1 << 16); \
}
#define rho(a0, a1, a2) \
{ \
theta(a0, a1, a2); \
pi_gamma_pi(a0, a1, a2); \
}
void ThreeWay::Base::UncheckedSetKey(const byte *uk, unsigned int length, const NameValuePairs &params)
{
AssertValidKeyLength(length);
m_rounds = GetRoundsAndThrowIfInvalid(params, this);
for (unsigned int i=0; i<3; i++)
m_k[i] = (word32)uk[4*i+3] | ((word32)uk[4*i+2]<<8) | ((word32)uk[4*i+1]<<16) | ((word32)uk[4*i]<<24);
if (!IsForwardTransformation())
{
theta(m_k[0], m_k[1], m_k[2]);
mu(m_k[0], m_k[1], m_k[2]);
m_k[0] = ByteReverse(m_k[0]);
m_k[1] = ByteReverse(m_k[1]);
m_k[2] = ByteReverse(m_k[2]);
}
}
void ThreeWay::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
typedef BlockGetAndPut<word32, BigEndian> Block;
word32 a0, a1, a2;
Block::Get(inBlock)(a0)(a1)(a2);
word32 rc = START_E;
for(unsigned i=0; i<m_rounds; i++)
{
a0 ^= m_k[0] ^ (rc<<16);
a1 ^= m_k[1];
a2 ^= m_k[2] ^ rc;
rho(a0, a1, a2);
rc <<= 1;
if (rc&0x10000) rc ^= 0x11011;
}
a0 ^= m_k[0] ^ (rc<<16);
a1 ^= m_k[1];
a2 ^= m_k[2] ^ rc;
theta(a0, a1, a2);
Block::Put(xorBlock, outBlock)(a0)(a1)(a2);
}
void ThreeWay::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
typedef BlockGetAndPut<word32, LittleEndian> Block;
word32 a0, a1, a2;
Block::Get(inBlock)(a0)(a1)(a2);
word32 rc = START_D;
mu(a0, a1, a2);
for(unsigned i=0; i<m_rounds; i++)
{
a0 ^= m_k[0] ^ (rc<<16);
a1 ^= m_k[1];
a2 ^= m_k[2] ^ rc;
rho(a0, a1, a2);
rc <<= 1;
if (rc&0x10000) rc ^= 0x11011;
}
a0 ^= m_k[0] ^ (rc<<16);
a1 ^= m_k[1];
a2 ^= m_k[2] ^ rc;
theta(a0, a1, a2);
mu(a0, a1, a2);
Block::Put(xorBlock, outBlock)(a0)(a1)(a2);
}
NAMESPACE_END

View File

@@ -1,63 +0,0 @@
// 3way.h - originally written and placed in the public domain by Wei Dai
/// \file 3way.h
/// \brief Classes for the 3-Way block cipher
#ifndef CRYPTOPP_THREEWAY_H
#define CRYPTOPP_THREEWAY_H
#include "config.h"
#include "seckey.h"
#include "secblock.h"
NAMESPACE_BEGIN(CryptoPP)
/// \brief ThreeWay block cipher information
struct ThreeWay_Info : public FixedBlockSize<12>, public FixedKeyLength<12>, public VariableRounds<11>
{
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "3-Way";}
};
/// \brief ThreeWay block cipher
/// \sa <a href="http://www.cryptopp.com/wiki/3-Way">3-Way</a>
class ThreeWay : public ThreeWay_Info, public BlockCipherDocumentation
{
/// \brief Class specific implementation and overrides used to operate the cipher.
/// \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<ThreeWay_Info>
{
public:
void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params);
protected:
unsigned int m_rounds;
FixedSizeSecBlock<word32, 3> m_k;
};
/// \brief Class specific methods used to operate the cipher in the forward direction.
/// \details Implementations and overrides in \p Enc apply to \p ENCRYPTION.
class CRYPTOPP_NO_VTABLE Enc : public Base
{
public:
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
};
/// \brief Class specific methods used to operate the cipher in the reverse direction.
/// \details Implementations and overrides in \p Dec apply to \p DECRYPTION.
class CRYPTOPP_NO_VTABLE Dec : public Base
{
public:
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
};
public:
typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
};
typedef ThreeWay::Encryption ThreeWayEncryption;
typedef ThreeWay::Decryption ThreeWayDecryption;
NAMESPACE_END
#endif

File diff suppressed because it is too large Load Diff

2429
vendor/cryptopp/Doxyfile vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,650 +0,0 @@
3way.cpp
3way.h
adhoc.cpp.proto
adv_simd.h
adler32.cpp
adler32.h
aes.h
aes_armv4.h
aes_armv4.S
algebra.cpp
algebra.h
algparam.cpp
algparam.h
allocate.cpp
allocate.h
arc4.cpp
arc4.h
ariatab.cpp
aria.cpp
aria_simd.cpp
aria.h
argnames.h
arm_simd.h
asn.cpp
asn.h
authenc.cpp
authenc.h
base32.cpp
base32.h
base64.cpp
base64.h
basecode.cpp
basecode.h
bench.h
bds10.zip
bench1.cpp
bench2.cpp
bench3.cpp
bfinit.cpp
blake2.cpp
blake2s_simd.cpp
blake2b_simd.cpp
blake2.h
blowfish.cpp
blowfish.h
blumshub.cpp
blumshub.h
camellia.cpp
camellia.h
cast.cpp
cast.h
casts.cpp
cbcmac.cpp
cbcmac.h
ccm.cpp
ccm.h
chacha.cpp
chacha_avx.cpp
chacha_simd.cpp
chacha.h
chachapoly.cpp
chachapoly.h
cham.cpp
cham_simd.cpp
cham.h
channels.cpp
channels.h
cmac.cpp
cmac.h
config.h
config_align.h
config_asm.h
config_cpu.h
config_cxx.h
config_dll.h
config_int.h
config_misc.h
config_ns.h
config_os.h
config_ver.h
cpu.cpp
cpu.h
crc.cpp
crc_simd.cpp
crc.h
cryptdll.vcxproj
cryptdll.vcxproj.filters
cryptest.sln
cryptest.vcxproj
cryptest.vcxproj.user
cryptest.vcxproj.filters
cryptest.mapfile
cryptest.nmake
cryptlib.cpp
cryptlib.h
cryptlib.vcxproj
cryptlib.vcxproj.filters
cryptopp.rc
darn.cpp
darn.h
datatest.cpp
default.cpp
default.h
des.cpp
des.h
dessp.cpp
dh.cpp
dh.h
dh2.cpp
dh2.h
dll.cpp
dll.h
dlltest.cpp
dlltest.vcxproj
dlltest.vcxproj.filters
dmac.h
drbg.h
donna.h
donna_32.h
donna_64.h
donna_sse.h
donna_32.cpp
donna_64.cpp
donna_sse.cpp
dsa.cpp
dsa.h
eax.cpp
eax.h
ec2n.cpp
ec2n.h
eccrypto.cpp
eccrypto.h
ecp.cpp
ecp.h
ecpoint.h
elgamal.cpp
elgamal.h
emsa2.cpp
emsa2.h
eprecomp.cpp
eprecomp.h
esign.cpp
esign.h
factory.h
fhmqv.cpp
fhmqv.h
files.cpp
files.h
filters.cpp
filters.h
fips140.cpp
fips140.h
fipsalgt.cpp
fipstest.cpp
fltrimpl.h
gcm_simd.cpp
gcm.cpp
gcm.h
gf256.cpp
gf256.h
gf2_32.cpp
gf2_32.h
gf2n_simd.cpp
gf2n.cpp
gf2n.h
gfpcrypt.cpp
gfpcrypt.h
gost.cpp
gost.h
gzip.cpp
gzip.h
hashfwd.h
hc128.cpp
hc128.h
hc256.cpp
hc256.h
hex.cpp
hex.h
hight.h
hight.cpp
hkdf.h
hmac.cpp
hmac.h
hmqv.cpp
hmqv.h
hrtimer.cpp
hrtimer.h
ida.cpp
ida.h
idea.cpp
idea.h
integer.cpp
integer.h
iterhash.cpp
iterhash.h
kalynatab.cpp
kalyna.cpp
kalyna.h
keccak.cpp
keccak_core.cpp
keccak_simd.cpp
keccak.h
lubyrack.h
lea.cpp
lea_simd.cpp
lea.h
lsh256.cpp
lsh256_sse.cpp
lsh256_avx.cpp
lsh512.cpp
lsh512_sse.cpp
lsh512_avx.cpp
lsh.h
luc.cpp
luc.h
mars.cpp
mars.h
marss.cpp
md2.cpp
md2.h
md4.cpp
md4.h
md5.cpp
md5.h
mdc.h
mersenne.h
misc.cpp
misc.h
modarith.h
modes.cpp
modes.h
modexppc.h
mqueue.cpp
mqueue.h
mqv.cpp
mqv.h
naclite.h
nbtheory.cpp
nbtheory.h
neon_simd.cpp
nr.h
oaep.cpp
oaep.h
oids.h
osrng.cpp
osrng.h
ossig.h
padlkrng.cpp
padlkrng.h
panama.cpp
panama.h
pch.cpp
pch.h
pkcspad.cpp
pkcspad.h
poly1305.cpp
poly1305.h
polynomi.cpp
polynomi.h
ppc_power7.cpp
ppc_power8.cpp
ppc_power9.cpp
ppc_simd.cpp
ppc_simd.h
pssr.cpp
pssr.h
pubkey.cpp
pubkey.h
pwdbased.h
queue.cpp
queue.h
rabin.cpp
rabin.h
randpool.cpp
randpool.h
rabbit.cpp
rabbit.h
rc2.cpp
rc2.h
rc5.cpp
rc5.h
rc6.cpp
rc6.h
rdrand.asm
rdrand.cpp
rdrand.h
rdseed.asm
rdtables.cpp
regtest1.cpp
regtest2.cpp
regtest3.cpp
regtest4.cpp
resource.h
rijndael.cpp
rijndael_simd.cpp
rijndael.h
ripemd.cpp
ripemd.h
rng.cpp
rng.h
rsa.cpp
rsa.h
rw.cpp
rw.h
safer.cpp
safer.h
salsa.cpp
salsa.h
scrypt.cpp
scrypt.h
seal.cpp
seal.h
secblock.h
secblockfwd.h
seckey.h
seed.cpp
seed.h
serpent.cpp
serpent.h
serpentp.h
sha.cpp
sha_simd.cpp
sha.h
sha1_armv4.h
sha1_armv4.S
sha256_armv4.h
sha256_armv4.S
sha512_armv4.h
sha512_armv4.S
sha3.cpp
sha3.h
shacal2.cpp
shacal2_simd.cpp
shacal2.h
shake.cpp
shake.h
shark.cpp
shark.h
sharkbox.cpp
simple.cpp
simple.h
siphash.h
simeck.cpp
simeck.h
simon.cpp
simon128_simd.cpp
simon.h
skipjack.cpp
skipjack.h
sm3.cpp
sm3.h
sm4.cpp
sm4_simd.cpp
sm4.h
smartptr.h
sosemanuk.cpp
sosemanuk.h
speck.cpp
speck128_simd.cpp
speck.h
square.cpp
square.h
squaretb.cpp
sse_simd.cpp
stdcpp.h
strciphr.cpp
strciphr.h
tea.cpp
tea.h
test.cpp
trap.h
tftables.cpp
threefish.cpp
threefish.h
tiger.cpp
tiger.h
tigertab.cpp
trunhash.h
ttmac.cpp
ttmac.h
tweetnacl.cpp
tweetnacl.h
twofish.cpp
twofish.h
validat0.cpp
validat1.cpp
validat2.cpp
validat3.cpp
validat4.cpp
validat5.cpp
validat6.cpp
validat7.cpp
validat8.cpp
validat9.cpp
validat10.cpp
validate.h
vmac.cpp
vmac.h
vs2005.zip
wake.cpp
wake.h
whrlpool.cpp
whrlpool.h
words.h
x64dll.asm
x64masm.asm
xed25519.h
xed25519.cpp
xtr.cpp
xtr.h
xtrcrypt.cpp
xtrcrypt.h
xts.cpp
xts.h
zdeflate.cpp
zdeflate.h
zinflate.cpp
zinflate.h
zlib.cpp
zlib.h
Doxyfile
GNUmakefile
GNUmakefile-cross
License.txt
Readme.txt
History.txt
Install.txt
Filelist.txt
cryptopp.supp
TestData/3desval.dat
TestData/3wayval.dat
TestData/aria.dat
TestData/camellia.dat
TestData/cast128v.dat
TestData/cast256v.dat
TestData/defdmac1.bin
TestData/defdmac2.bin
TestData/descert.dat
TestData/dh1024.dat
TestData/dh2048.dat
TestData/dlie1024.dat
TestData/dlie2048.dat
TestData/dsa1024.dat
TestData/dsa1024b.dat
TestData/dsa512.dat
TestData/ecies_p160.dat
TestData/ecies_t163.dat
TestData/ed25519.dat
TestData/ed25519_ver.dat
TestData/ed25519v0.dat
TestData/ed25519v1.dat
TestData/elgc1024.dat
TestData/esig1023.dat
TestData/esig1536.dat
TestData/esig2046.dat
TestData/fhmqv160.dat
TestData/fhmqv256.dat
TestData/fhmqv384.dat
TestData/fhmqv512.dat
TestData/gostval.dat
TestData/hmqv160.dat
TestData/hmqv256.dat
TestData/hmqv384.dat
TestData/hmqv512.dat
TestData/ideaval.dat
TestData/luc1024.dat
TestData/luc2048.dat
TestData/lucc1024.dat
TestData/lucc512.dat
TestData/lucd1024.dat
TestData/lucd512.dat
TestData/lucs1024.dat
TestData/lucs512.dat
TestData/marsval.dat
TestData/mqv1024.dat
TestData/mqv2048.dat
TestData/nr1024.dat
TestData/nr2048.dat
TestData/rabi1024.dat
TestData/rabi2048.dat
TestData/rc2val.dat
TestData/rc5val.dat
TestData/rc6val.dat
TestData/rijndael.dat
TestData/rsa1024.dat
TestData/rsa2048.dat
TestData/rsa2048a.dat
TestData/rsa400pb.dat
TestData/rsa400pv.dat
TestData/rsa512a.dat
TestData/rw1024.dat
TestData/rw2048.dat
TestData/saferval.dat
TestData/serpentv.dat
TestData/shacal2v.dat
TestData/sharkval.dat
TestData/skipjack.dat
TestData/squareva.dat
TestData/twofishv.dat
TestData/usage.dat
TestData/x25519.dat
TestData/x25519v0.dat
TestData/x25519v1.dat
TestData/xtrdh171.dat
TestData/xtrdh342.dat
TestVectors/aead.txt
TestVectors/aes.txt
TestVectors/all.txt
TestVectors/aria.txt
TestVectors/blake2.txt
TestVectors/blake2b.txt
TestVectors/blake2s.txt
TestVectors/camellia.txt
TestVectors/ccm.txt
TestVectors/chacha.txt
TestVectors/chacha_tls.txt
TestVectors/chacha20poly1305.txt
TestVectors/cham.txt
TestVectors/cmac.txt
TestVectors/dlies.txt
TestVectors/dsa.txt
TestVectors/dsa_1363.txt
TestVectors/dsa_rfc6979.txt
TestVectors/eax.txt
TestVectors/esign.txt
TestVectors/gcm.txt
TestVectors/hc128.txt
TestVectors/hc256.txt
TestVectors/hight.txt
TestVectors/hkdf.txt
TestVectors/hmac.txt
TestVectors/kalyna.txt
TestVectors/keccak.txt
TestVectors/lea.txt
TestVectors/lsh.txt
TestVectors/lsh256.txt
TestVectors/lsh512.txt
TestVectors/lsh512_256.txt
TestVectors/mars.txt
TestVectors/nr.txt
TestVectors/panama.txt
TestVectors/poly1305aes.txt
TestVectors/poly1305_tls.txt
TestVectors/rabbit.txt
TestVectors/Readme.txt
TestVectors/rsa_oaep.txt
TestVectors/rsa_pkcs1_1_5.txt
TestVectors/rsa_pss.txt
TestVectors/rw.txt
TestVectors/salsa.txt
TestVectors/seal.txt
TestVectors/seed.txt
TestVectors/sha.txt
TestVectors/sha1_160_fips_180.txt
TestVectors/sha1_fips_180.txt
TestVectors/sha2.txt
TestVectors/sha2_224_fips_180.txt
TestVectors/sha2_256_fips_180.txt
TestVectors/sha2_384_fips_180.txt
TestVectors/sha2_512_fips_180.txt
TestVectors/sha2_fips_180.txt
TestVectors/sha3.txt
TestVectors/sha3_224_fips_202.txt
TestVectors/sha3_256_fips_202.txt
TestVectors/sha3_384_fips_202.txt
TestVectors/sha3_512_fips_202.txt
TestVectors/sha3_fips_202.txt
TestVectors/shake.txt
TestVectors/shacal2.txt
TestVectors/simeck.txt
TestVectors/simon.txt
TestVectors/siphash.txt
TestVectors/skipjack.txt
TestVectors/sm3.txt
TestVectors/sm4.txt
TestVectors/sosemanuk.txt
TestVectors/speck.txt
TestVectors/tea.txt
TestVectors/threefish.txt
TestVectors/ttmac.txt
TestVectors/vmac.txt
TestVectors/wake.txt
TestVectors/whrlpool.txt
TestVectors/xchacha.txt
TestVectors/xts.txt
TestPrograms/test_32bit.cpp
TestPrograms/test_64bit.cpp
TestPrograms/test_arm_acle_header.cpp
TestPrograms/test_arm_aes.cpp
TestPrograms/test_arm_asimd.cpp
TestPrograms/test_arm_crc.cpp
TestPrograms/test_arm_neon.cpp
TestPrograms/test_arm_neon_header.cpp
TestPrograms/test_arm_pmull.cpp
TestPrograms/test_arm_sha1.cpp
TestPrograms/test_arm_sha256.cpp
TestPrograms/test_arm_sha3.cpp
TestPrograms/test_arm_sha512.cpp
TestPrograms/test_arm_sm3.cpp
TestPrograms/test_arm_sm4.cpp
TestPrograms/test_asm_mixed.cpp
TestPrograms/test_cxx11_alignas.cpp
TestPrograms/test_cxx11_alignof.cpp
TestPrograms/test_cxx11_assert.cpp
TestPrograms/test_cxx11_atomic.cpp
TestPrograms/test_cxx11_auto.cpp
TestPrograms/test_cxx11_constexpr.cpp
TestPrograms/test_cxx11.cpp
TestPrograms/test_cxx11_deletefn.cpp
TestPrograms/test_cxx11_staticinit.cpp
TestPrograms/test_cxx11_enumtype.cpp
TestPrograms/test_cxx11_initializer.cpp
TestPrograms/test_cxx11_lambda.cpp
TestPrograms/test_cxx11_noexcept.cpp
TestPrograms/test_cxx11_nullptr.cpp
TestPrograms/test_cxx11_sync.cpp
TestPrograms/test_cxx11_vartemplates.cpp
TestPrograms/test_cxx14.cpp
TestPrograms/test_cxx17_assert.cpp
TestPrograms/test_cxx17.cpp
TestPrograms/test_cxx17_exceptions.cpp
TestPrograms/test_cxx98_exception.cpp
TestPrograms/test_cxx.cpp
TestPrograms/test_glibc.cpp
TestPrograms/test_newlib.cpp
TestPrograms/test_ppc_aes.cpp
TestPrograms/test_ppc_altivec.cpp
TestPrograms/test_ppc_power7.cpp
TestPrograms/test_ppc_power8.cpp
TestPrograms/test_ppc_power9.cpp
TestPrograms/test_ppc_sha.cpp
TestPrograms/test_ppc_vmull.cpp
TestPrograms/test_pthreads.cpp
TestPrograms/test_x86_aes.cpp
TestPrograms/test_x86_avx2.cpp
TestPrograms/test_x86_avx512.cpp
TestPrograms/test_x86_avx.cpp
TestPrograms/test_x86_clmul.cpp
TestPrograms/test_x86_cpuid.cpp
TestPrograms/test_x86_rdrand.cpp
TestPrograms/test_x86_rdseed.cpp
TestPrograms/test_x86_sha.cpp
TestPrograms/test_x86_sse2.cpp
TestPrograms/test_x86_sse3.cpp
TestPrograms/test_x86_sse41.cpp
TestPrograms/test_x86_sse42.cpp
TestPrograms/test_x86_ssse3.cpp
TestPrograms/test_x86_via_aes.cpp
TestPrograms/test_x86_via_rng.cpp
TestPrograms/test_x86_via_sha.cpp

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,544 +0,0 @@
*** History ***
The History file contains the items that comprise the release notes. The
items in the list below used to be in Readme.txt. Readme.txt now contans the
last several releases.
1.0 - First public release
- Withdrawn at the request of RSA DSI over patent claims
- included Blowfish, BBS, DES, DH, Diamond, DSA, ElGamal, IDEA,
MD5, RC4, RC5, RSA, SHA, WAKE, secret sharing, DEFLATE compression
- had a serious bug in the RSA key generation code.
1.1 - Removed RSA, RC4, RC5
- Disabled calls to RSAREF's non-public functions
- Minor bugs fixed
2.0 - a completely new, faster multiprecision integer class
- added MD5-MAC, HAVAL, 3-WAY, TEA, SAFER, LUC, Rabin, BlumGoldwasser,
elliptic curve algorithms
- added the Lucas strong probable primality test
- ElGamal encryption and signature schemes modified to avoid weaknesses
- Diamond changed to Diamond2 because of key schedule weakness
- fixed bug in WAKE key setup
- SHS class renamed to SHA
- lots of miscellaneous optimizations
2.1 - added Tiger, HMAC, GOST, RIPE-MD160, LUCELG, LUCDIF, XOR-MAC,
OAEP, PSSR, SHARK
- added precomputation to DH, ElGamal, DSA, and elliptic curve algorithms
- added back RC5 and a new RSA
- optimizations in elliptic curves over GF(p)
- changed Rabin to use OAEP and PSSR
- changed many classes to allow copy constructors to work correctly
- improved exception generation and handling
2.2 - added SEAL, CAST-128, Square
- fixed bug in HAVAL (padding problem)
- fixed bug in triple-DES (decryption order was reversed)
- fixed bug in RC5 (couldn't handle key length not a multiple of 4)
- changed HMAC to conform to RFC-2104 (which is not compatible
with the original HMAC)
- changed secret sharing and information dispersal to use GF(2^32)
instead of GF(65521)
- removed zero knowledge prover/verifier for graph isomorphism
- removed several utility classes in favor of the C++ standard library
2.3 - ported to EGCS
- fixed incomplete workaround of min/max conflict in MSVC
3.0 - placed all names into the "CryptoPP" namespace
- added MD2, RC2, RC6, MARS, RW, DH2, MQV, ECDHC, CBC-CTS
- added abstract base classes PK_SimpleKeyAgreementDomain and
PK_AuthenticatedKeyAgreementDomain
- changed DH and LUCDIF to implement the PK_SimpleKeyAgreementDomain
interface and to perform domain parameter and key validation
- changed interfaces of PK_Signer and PK_Verifier to sign and verify
messages instead of message digests
- changed OAEP to conform to PKCS#1 v2.0
- changed benchmark code to produce HTML tables as output
- changed PSSR to track IEEE P1363a
- renamed ElGamalSignature to NR and changed it to track IEEE P1363
- renamed ECKEP to ECMQVC and changed it to track IEEE P1363
- renamed several other classes for clarity
- removed support for calling RSAREF
- removed option to compile old SHA (SHA-0)
- removed option not to throw exceptions
3.1 - added ARC4, Rijndael, Twofish, Serpent, CBC-MAC, DMAC
- added interface for querying supported key lengths of symmetric ciphers
and MACs
- added sample code for RSA signature and verification
- changed CBC-CTS to be compatible with RFC 2040
- updated SEAL to version 3.0 of the cipher specification
- optimized multiprecision squaring and elliptic curves over GF(p)
- fixed bug in MARS key setup
- fixed bug with attaching objects to Deflator
3.2 - added DES-XEX3, ECDSA, DefaultEncryptorWithMAC
- renamed DES-EDE to DES-EDE2 and TripleDES to DES-EDE3
- optimized ARC4
- generalized DSA to allow keys longer than 1024 bits
- fixed bugs in GF2N and ModularArithmetic that can cause calculation errors
- fixed crashing bug in Inflator when given invalid inputs
- fixed endian bug in Serpent
- fixed padding bug in Tiger
4.0 - added Skipjack, CAST-256, Panama, SHA-2 (SHA-256, SHA-384, and SHA-512),
and XTR-DH
- added a faster variant of Rabin's Information Dispersal Algorithm (IDA)
- added class wrappers for these operating system features:
* high resolution timers on Windows, Unix, and MacOS
* Berkeley and Windows style sockets
* Windows named pipes
* /dev/random and /dev/urandom on Linux and FreeBSD
* Microsoft's CryptGenRandom on Windows
- added support for SEC 1 elliptic curve key format and compressed points
- added support for X.509 public key format (subjectPublicKeyInfo) for
RSA, DSA, and elliptic curve schemes
- added support for DER and OpenPGP signature format for DSA
- added support for ZLIB compressed data format (RFC 1950)
- changed elliptic curve encryption to use ECIES (as defined in SEC 1)
- changed MARS key schedule to reflect the latest specification
- changed BufferedTransformation interface to support multiple channels
and messages
- changed CAST and SHA-1 implementations to use public domain source code
- fixed bug in StringSource
- optmized multi-precision integer code for better performance
4.1 - added more support for the recommended elliptic curve parameters in SEC 2
- added Panama MAC, MARC4
- added IV stealing feature to CTS mode
- added support for PKCS #8 private key format for RSA, DSA, and elliptic
curve schemes
- changed Deflate, MD5, Rijndael, and Twofish to use public domain code
- fixed a bug with flushing compressed streams
- fixed a bug with decompressing stored blocks
- fixed a bug with EC point decompression using non-trinomial basis
- fixed a bug in NetworkSource::GeneralPump()
- fixed a performance issue with EC over GF(p) decryption
- fixed syntax to allow GCC to compile without -fpermissive
- relaxed some restrictions in the license
4.2 - added support for longer HMAC keys
- added MD4 (which is not secure so use for compatibility purposes only)
- added compatibility fixes/workarounds for STLport 4.5, GCC 3.0.2,
and MSVC 7.0
- changed MD2 to use public domain code
- fixed a bug with decompressing multiple messages with the same object
- fixed a bug in CBC-MAC with MACing multiple messages with the same object
- fixed a bug in RC5 and RC6 with zero-length keys
- fixed a bug in Adler32 where incorrect checksum may be generated
5.0 - added ESIGN, DLIES, WAKE-OFB, PBKDF1 and PBKDF2 from PKCS #5
- added key validation for encryption and signature public/private keys
- renamed StreamCipher interface to SymmetricCipher, which is now implemented
by both stream ciphers and block cipher modes including ECB and CBC
- added keying interfaces to support resetting of keys and IVs without
having to destroy and recreate objects
- changed filter interface to support non-blocking input/output
- changed SocketSource and SocketSink to use overlapped I/O on Microsoft Windows
- grouped related classes inside structs to help templates, for example
AESEncryption and AESDecryption are now AES::Encryption and AES::Decryption
- where possible, typedefs have been added to improve backwards
compatibility when the CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY macro is defined
- changed Serpent, HAVAL and IDEA to use public domain code
- implemented SSE2 optimizations for Integer operations
- fixed a bug in HMAC::TruncatedFinal()
- fixed SKIPJACK byte ordering following NIST clarification dated 5/9/02
5.01 - added known answer test for X9.17 RNG in FIPS 140 power-up self test
- submitted to NIST/CSE, but not publicly released
5.02 - changed EDC test to MAC integrity check using HMAC/SHA1
- improved performance of integrity check
- added blinding to defend against RSA timing attack
5.03 - created DLL version of Crypto++ for FIPS 140-2 validation
- fixed vulnerabilities in GetNextIV for CTR and OFB modes
5.0.4 - Removed DES, SHA-256, SHA-384, SHA-512 from DLL
5.1 - added PSS padding and changed PSSR to track IEEE P1363a draft standard
- added blinding for RSA and Rabin to defend against timing attacks
on decryption operations
- changed signing and decryption APIs to support the above
- changed WaitObjectContainer to allow waiting for more than 64
objects at a time on Win32 platforms
- fixed a bug in CBC and ECB modes with processing non-aligned data
- fixed standard conformance bugs in DLIES (DHAES mode) and RW/EMSA2
signature scheme (these fixes are not backwards compatible)
- fixed a number of compiler warnings, minor bugs, and portability problems
- removed Sapphire
5.2 - merged in changes for 5.01 - 5.0.4
- added support for using encoding parameters and key derivation parameters
with public key encryption (implemented by OAEP and DL/ECIES)
- added Camellia, SHACAL-2, Two-Track-MAC, Whirlpool, RIPEMD-320,
RIPEMD-128, RIPEMD-256, Base-32 coding, FIPS variant of CFB mode
- added ThreadUserTimer for timing thread CPU usage
- added option for password-based key derivation functions
to iterate until a mimimum elapsed thread CPU time is reached
- added option (on by default) for DEFLATE compression to detect
uncompressible files and process them more quickly
- improved compatibility and performance on 64-bit platforms,
including Alpha, IA-64, x86-64, PPC64, Sparc64, and MIPS64
- fixed ONE_AND_ZEROS_PADDING to use 0x80 instead 0x01 as padding.
- fixed encoding/decoding of PKCS #8 privateKeyInfo to properly
handle optional attributes
5.2.1 - fixed bug in the "dlltest" DLL testing program
- fixed compiling with STLport using VC .NET
- fixed compiling with -fPIC using GCC
- fixed compiling with -msse2 on systems without memalign()
- fixed inability to instantiate PanamaMAC
- fixed problems with inline documentation
5.2.2 - added SHA-224
- put SHA-256, SHA-384, SHA-512, RSASSA-PSS into DLL
5.2.3 - fixed issues with FIPS algorithm test vectors
- put RSASSA-ISO into DLL
5.3 - ported to MSVC 2005 with support for x86-64
- added defense against AES timing attacks, and more AES test vectors
- changed StaticAlgorithmName() of Rijndael to "AES", CTR to "CTR"
5.4 - added Salsa20
- updated Whirlpool to version 3.0
- ported to GCC 4.1, Sun C++ 5.8, and Borland C++Builder 2006
5.5 - added VMAC and Sosemanuk (with x86-64 and SSE2 assembly)
- improved speed of integer arithmetic, AES, SHA-512, Tiger, Salsa20,
Whirlpool, and PANAMA cipher using assembly (x86-64, MMX, SSE2)
- optimized Camellia and added defense against timing attacks
- updated benchmarks code to show cycles per byte and to time key/IV setup
- started using OpenMP for increased multi-core speed
- enabled GCC optimization flags by default in GNUmakefile
- added blinding and computational error checking for RW signing
- changed RandomPool, X917RNG, GetNextIV, DSA/NR/ECDSA/ECNR to reduce
the risk of reusing random numbers and IVs after virtual machine state
rollback
- changed default FIPS mode RNG from AutoSeededX917RNG<DES_EDE3> to
AutoSeededX917RNG<AES>
- fixed PANAMA cipher interface to accept 256-bit key and 256-bit IV
- moved MD2, MD4, MD5, PanamaHash, ARC4, WAKE_CFB into the namespace "Weak"
- removed HAVAL, MD5-MAC, XMAC
5.5.1 - fixed VMAC validation failure on 32-bit big-endian machines
5.5.2 - ported x64 assembly language code for AES, Salsa20, Sosemanuk, and Panama
to MSVC 2005 (using MASM since MSVC doesn't support inline assembly on x64)
- fixed Salsa20 initialization crash on non-SSE2 machines
- fixed Whirlpool crash on Pentium 2 machines
- fixed possible branch prediction analysis (BPA) vulnerability in
MontgomeryReduce(), which may affect security of RSA, RW, LUC
- fixed link error with MSVC 2003 when using "debug DLL" form of runtime library
- fixed crash in SSE2_Add on P4 machines when compiled with
MSVC 6.0 SP5 with Processor Pack
- ported to MSVC 2008, GCC 4.2, Sun CC 5.9, Intel C++ Compiler 10.0,
and Borland C++Builder 2007
5.6.0 - added AuthenticatedSymmetricCipher interface class and Filter wrappers
- added CCM, GCM (with SSE2 assembly), EAX, CMAC, XSalsa20, and SEED
- added support for variable length IVs
- added OIDs for Brainpool elliptic curve parameters
- improved AES and SHA-256 speed on x86 and x64
- changed BlockTransformation interface to no longer assume data alignment
- fixed incorrect VMAC computation on message lengths
that are >64 mod 128 (x86 assembly version is not affected)
- fixed compiler error in vmac.cpp on x86 with GCC -fPIC
- fixed run-time validation error on x86-64 with GCC 4.3.2 -O2
- fixed HashFilter bug when putMessage=true
- fixed AES-CTR data alignment bug that causes incorrect encryption on ARM
- removed WORD64_AVAILABLE; compiler support for 64-bit int is now required
- ported to GCC 4.3, C++Builder 2009, Sun CC 5.10, Intel C++ Compiler 11
5.6.1 - added support for AES-NI and CLMUL instruction sets in AES and GMAC/GCM
- removed WAKE-CFB
- fixed several bugs in the SHA-256 x86/x64 assembly code:
* incorrect hash on non-SSE2 x86 machines on non-aligned input
* incorrect hash on x86 machines when input crosses 0x80000000
* incorrect hash on x64 when compiled with GCC with optimizations enabled
- fixed bugs in AES x86 and x64 assembly causing crashes in some MSVC build configurations
- switched to a public domain implementation of MARS
- ported to MSVC 2010, GCC 4.5.1, Sun Studio 12u1, C++Builder 2010, Intel C++ Compiler 11.1
- renamed the MSVC DLL project to "cryptopp" for compatibility with MSVC 2010
5.6.2 - changed license to Boost Software License 1.0
- added SHA-3 (Keccak)
- updated DSA to FIPS 186-3 (see DSA2 class)
- fixed Blowfish minimum keylength to be 4 bytes (32 bits)
- fixed Salsa validation failure when compiling with GCC 4.6
- fixed infinite recursion when on x64, assembly disabled, and no AESNI
- ported to MSVC 2012, GCC 4.7, Clang 3.2, Solaris Studio 12.3, Intel C++ Compiler 13.0
5.6.3 - maintenance release, honored API/ABI/Versioning requirements
- expanded processes to include community and its input
* 12 unique contributors for this release
- fixed CVE-2015-2141
- cleared most Undefined Behavior Sanitizer (UBsan) findings
- cleared all Address Sanitizer (Asan) findings
- cleared all Valgrind findings
- cleared all Coverity findings
- cleared all Enterprise Analysis (/analyze) findings
- cleared most GCC warnings with -Wall
- cleared most Clang warnings with -Wall
- cleared most MSVC warnings with /W4
- added -fPIC 64-bit builds. Off by default for i386
- added HKDF class from RFC 5868
- switched to member_ptr due to C++ 11 warnings for auto_ptr
- initialization of C++ static objects, off by default
* GCC and init_priotirty/constructor attributes
* MSVC and init_seg(lib)
* CRYPTOPP_INIT_PRIORITY disabled by default, but available
- improved OS X support
- improved GNUmakefile support for Testing and QA
- added self tests for additional Testing and QA
- added cryptest.sh for systematic Testing and QA
- added GNU Gold linker support
- added Visual Studio 2010 solution and project files in vs2010.zip
- added Clang integrated assembler support
- unconditionally define CRYPTOPP_NO_UNALIGNED_DATA_ACCESS for Makefile
target 'ubsan' and at -O3 due to GCC vectorization on x86 and x86_64
- workaround ARMEL/GCC 5.2 bug and failed self test
- fixed crash in MQV due to GCC 4.9+ and inlining
- fixed hang in SHA due to GCC 4.9+ and inlining
- fixed missing rdtables::Te under VS with ALIGNED_DATA_ACCESS
- fixed S/390 and big endian feature detection
- fixed S/390 and int128_t/uint128_t detection
- fixed X32 (ILP32) feature detection
- removed _CRT_SECURE_NO_DEPRECATE for Microsoft platforms
- utilized bound checking interfaces from ISO/IEC TR 24772 when available
- improved ARM, ARM64, MIPS, MIPS64, S/390 and X32 (ILP32) support
- introduced CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
- added additional Doxygen-based documentation
- ported to MSVC 2015, Xcode 7.2, GCC 5.2, Clang 3.7, Intel C++ 16.00
5.6.4 - September 11, 2016
- maintenance release, honored API/ABI/Versioning requirements
- expanded community input and support
* 22 unique contributors for this release
- fixed CVE-2016-3995
- changed SHA3 to FIPS 202 (F1600, XOF d=0x06)
- added Keccak (F1600, XOF d=0x01)
- added ChaCha (ChaCha8/12/20)
- added HMQV and FHMQV
* Hashed and Fully Hashed MQV
- added BLAKE2 (BLAKE2s and BLAKE2b)
* C++, SSE2, SSE4, ARM NEON and ARMv8 ASIMD
- added CRC32-C
* C/C++, Amd64 CRC, and ARMv8 CRC
- improved Rabin-William signatures
* Tweaked roots <em>e</em> and <em>f</em>
- improved C++11 support
* atomics, threads and fences
* alginof, alignas
* constexpr
* noexcept
- improved GCM mode
* ARM NEON and ARMv8 ASIMD
* ARMv8 carry-less multiply
- improved Windows 8 and 10 support
* Windows Phone, Universal Windows Platform, Windows Store
- improved MIPS, ARMv7 and ARMv8 support
* added scripts setenv-{android|embedded|ios}.sh for GNUmakefile-cross
* aggressive use of -march=<arch> and -mfpu=<fpu> in cryptest.sh
- improved build systems
* Visual Studio 2010 default
* added CMake support (lacks FindCryptopp.cmake)
* archived VC++ 5/0/6.0 project files (vc60.zip)
* archived VS2005 project files (vs2005.zip)
* archived Borland project files (bds10.zip)
- improved Testing and QA
* expanded platforms and compilers
* added code generation tests based on CPU features
* added C++03, C++11, C++14, C++17 testing
* added -O3, -O5, -Ofast and -Os testing
- ported to MSVC 2015 SP3, Xcode 9.0, Sun Studio 12.5, GCC 7.0,
MacPorts GCC 7.0, Clang 3.8, Intel C++ 17.00
5.6.5 - October 11, 2016
- maintenance release, recompile of programs recommended
- expanded community input and support
* 25 unique contributors as of this release
- fixed CVE-2016-7420 (Issue 277, document NDEBUG for production/release)
- fixed CVE-2016-7544 (Issue 302, avoid _malloca and _freea)
- shipped library in recommended state
* backwards compatibility achieved with <config.compat>
- Visual Studio project file cleanup
* improved X86 and X64 MSBuild support
* added ARM-based MSBuild awareness
- improved Testing and QA
* expanded platforms and compilers
* expanded Coverity into OS X and Windows platforms
* added Windows test scripts using Strawberry Perl
- ported to MSVC 2015 SP3, Xcode 7.3, Sun Studio 12.5, GCC 7.0,
MacPorts GCC 7.0, Clang 3.8, Intel C++ 17.00
6.0.0 - January 22, 2018
- Major release, recompile of programs required
- expanded community input and support
* 43 unique contributors as of this release
- fixed CVE-2016-9939 (Issue 346, transient DoS)
- fixed CVE-2017-9434 (Issue 414, misidentified memory error)
- converted to BASE+SIMD implementation
* BASE provides an architecture neutral C++ implementation
* SIMD provides architecture specific hardware acceleration
- improved PowerPC Power4, Power7 and Power8 support
- added ARIA, EC German DSA, Deterministic signatures (RFC 6979),
Kalyna, NIST Hash and HMAC DRBG, Padlock RNG, Poly1305, SipHash,
Simon, Speck, SM3, SM4, Threefish algorithms
- added NaCl interface from the compact library
* x25519 key exhange and ed25519 signing provided through NaCl interface
- improved Testing and QA
- ported to MSVC 2017, Xcode 8.1, Sun Studio 12.5, GCC 7.0,
MacPorts GCC 7.0, Clang 4.0, Intel C++ 17.00, IBM XL C/C++ 13.1
6.1.0 - February 22, 2018
- minor release, maintenance items
- expanded community input and support
* 46 unique contributors as of this release
- use 2048-bit modulus default for DSA
- fix build under Linuxbrew
- use /bin/sh in GNUmakefile
- fix missing flags for SIMON and SPECK in GNUMakefile-cross
- fix ARM and MinGW misdetection
- port setenv-android.sh to latest NDK
- fix Clang check for C++11 lambdas
- Simon and Speck to little-endian implementation
- use LIB_MAJOR for ABI compatibility
- fix ODR violation in AdvancedProcessBlocks_{ARCH} templates
- handle C++17 std::uncaught_exceptions
- ported to MSVC 2017, Xcode 8.1, Sun Studio 12.5, GCC 8.0.1,
MacPorts GCC 7.0, Clang 4.0, Intel C++ 17.00, IBM XL C/C++ 13.1
7.0.0 - April 8, 2018
- major release, recompile of programs required
- expanded community input and support
* 48 unique contributors as of this release
- fix incorrect result when using Integer::ModInverse
* may be CVE worthy, but request was not submitted
- fix ARIA/CTR bus error on Sparc64
- fix incorrect result when using a_exp_b_mod_c
- fix undeclared identifier uint32_t on early Visual Studio
- fix iPhoneSimulator build on i386
- fix incorrect adler32 in ZlibDecompressor
- fix Power7 test using PPC_FEATURE_ARCH_2_06
- workaround incorrect Glibc sysconf return value on ppc64-le
- add KeyDerivationFunction interface
- add scrypt key derivation function
- add Salsa20_Core transform callable from outside class
- add sbyte, sword16, sword32 and sword64
- remove s_nullNameValuePairs from unnamed namespace
- ported to MSVC 2017, Xcode 9.3, Sun Studio 12.5, GCC 8.0.1,
MacPorts GCC 7.0, Clang 4.0, Intel C++ 17.00, IBM XL C/C++ 13.1
8.0.0 - December 28, 2018
- major release, recompile of programs required
- expanded community input and support
* 54 unique contributors as of this release
- add x25519 key exchange and ed25519 signature scheme
- add limited Asymmetric Key Package support from RFC 5958
- add Power9 DARN random number generator support
- add CHAM, HC-128, HC-256, Hight, LEA, Rabbit, Simeck
- fix FixedSizeAllocatorWithCleanup may be unaligned on some platforms
- cutover to GNU Make-based cpu feature tests
- rename files with dashes to underscores
- fix LegacyDecryptor and LegacyDecryptorWithMAC use wrong MAC
- fix incorrect AES/CBC decryption on Windows
- avoid Singleton<T> when possible, avoid std::call_once completely
- fix SPARC alignment problems due to GetAlignmentOf<T>() on word64
- add ARM AES asm implementation from Cryptogams
- remove CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS support
8.1.0 - February 22, 2019
- minor release, no recompile of programs required
- expanded community input and support
* 56 unique contributors as of this release
- fix OS X PowerPC builds with Clang
- add Microsoft ARM64 support
- fix iPhone Simulator build due to missing symbols
- add CRYPTOPP_BUGGY_SIMD_LOAD_AND_STORE
- add carryless multiplies for NIST b233 and k233 curves
- fix OpenMP build due to use of OpenMP 4 with down-level compilers
- add SignStream and VerifyStream for ed25519 and large files
- fix missing AlgorithmProvider in PanamaHash
- add SHAKE-128 and SHAKE-256
- fix AVX2 build due to _mm256_broadcastsi128_si256
- add IETF ChaCha, XChaCha, ChaChaPoly1305 and XChaChaPoly1305
8.2.0 - April 28, 2019
- minor release, no recompile of programs required
- expanded community input and support
* 56 unique contributors as of this release
- use PowerPC unaligned loads and stores with Power8
- add SKIPJACK test vectors
- fix SHAKE-128 and SHAKE-256 compile
- removed IS_NEON from Makefile
- fix Aarch64 build on Fedora 29
- fix missing GF2NT_233_Multiply_Reduce_CLMUL in FIPS DLL
- add missing BLAKE2 constructors
- fix missing BlockSize() in BLAKE2 classes
8.3.0 - December 20, 2020
- minor release, recompile of programs required
- expanded community input and support
* 66 unique contributors as of this release
- fix use of macro CRYPTOPP_ALIGN_DATA
- fix potential out-of-bounds read in ECDSA
- fix std::bad_alloc when using ByteQueue in pipeline
- fix missing CRYPTOPP_CXX17_EXCEPTIONS with Clang
- fix potential out-of-bounds read in GCM mode
- add configure.sh when preprocessor macros fail
- fix potential out-of-bounds read in SipHash
- fix compile error on POWER9 due to vec_xl_be
- fix K233 curve on POWER8
- add Cirrus CI testing
- fix broken encryption for some 64-bit ciphers
- fix Android cpu-features.c using C++ compiler
- disable RDRAND and RDSEED for some AMD processors
- fix BLAKE2 hash calculation using Salt and Personalization
- refresh Android and iOS build scripts
- add XTS mode
- fix circular dependency between misc.h and secblock.h
- add Certificate interface
- fix recursion in AES::Encryption without AESNI
- add missing OID for ElGamal encryption
- fix missing override in KeyDerivationFunction-derived classes
- fix RDSEED assemble under MSVC
- fix elliptic curve timing leaks (CVE-2019-14318)
- add link-library variable to Makefiles
- fix SIZE_MAX definition in misc.h
- add GetWord64 and PutWord64 to BufferedTransformation
- use HKDF in AutoSeededX917RNG::Reseed
- fix Asan finding in VMAC on i686 in inline asm
- fix undeclared identifier _mm_roti_epi64 on Gentoo
- fix ECIES and GetSymmetricKeyLength
- fix possible divide by zero in PKCS5_PBKDF2_HMAC
- refine ASN.1 encoders and decoders
- disable BMI2 code paths in Integer class
- fix use of CRYPTOPP_CLANG_VERSION
- add NEON SHA1, SHA256 and SHA512 from Cryptogams
- add ARM SHA1, SHA256 and SHA512 from Cryptogams
- make config.h more autoconf friendly
- handle Clang triplet armv8l-unknown-linux-gnueabihf
- fix reference binding to misaligned address in xed25519
- clear asserts in TestDataNameValuePairs
8.4.0 - January 2, 2021
- minor release, recompile of programs required
- expanded community input and support
* 67 unique contributors as of this release
- fix SIGILL on POWER8 when compiling with GCC 10
- fix potential out-of-bounds write in FixedSizeAllocatorWithCleanup
- fix compile on AIX POWER7 with IBM XLC 12.01
- fix compile on Solaris with SunCC 12.6
- revert changes for constant-time elliptic curve algorithms
- fix makefile clean and distclean recipes
8.5.0 - March 7, 2021
- minor release, no recompile of programs required
- expanded community input and support
* 70 unique contributors as of this release
- port to Apple M1 hardware

View File

@@ -1,241 +0,0 @@
CONTENTS OF THIS FILE
---------------------
* Introduction
* Prerequisites
* Building the Library
* Alternate Build Systems
* Installing the Library
* Makefile Targets
* Dynamic Analysis
* Acceptance Testing
* Reporting problems
INTRODUCTION
------------
Crypto++ Library is a free C++ class library of cryptographic algorithms and schemes. The library was originally written and placed in public domain by Wei Dai, but it is now maintained by the community. The library homepage is at http://www.cryptopp.com/. The latest library source code can be found at http://github.com/weidai11/cryptopp. For licensing and copyright information, please see License.txt.
These are general instructions for AIX, BSDs, Linux, OS X, Solaris and Unix. The library uses GNU Make and a GNUmakefile to avoid anemic make. On AIX, BSD and Solaris you will likely have to use `gmake` to build the library. On Linux and OS X, the system's make should be OK. On Windows, Crypto++ provides Visual Studio solutions.
You should look through the GNUmakefile and config.h to ensure settings look reasonable before building. There are two wiki pages that help explain them at http://www.cryptopp.com/wiki/GNUmakefile and http://www.cryptopp.com/wiki/Config.h.
Wiki pages are available for some platforms with specific build instructions. The pages include Android, ARM, iOS, MSBuild and Solaris. Solaris users should visit the wiki for important information on compiling the library with different versions of SunCC and options, and information on improving library performance and features.
Crypto++ does not depend upon other tools or libraries. The library only needs GNU Make 3.80 on Unix & Linux; or Visual Studio 2010 and above build tools on Windows. The library does not use Autotools, does not use CMake, and does not use Boost.
Autotools and CMake projects are not officially supported. The build systems take too much time and effort. Unofficial projects are available at https://github.com/noloader/cryptopp-autotools and https://github.com/noloader/cryptopp-cmake. The projects provide a central location to support Autotools and CMake. Collaborators for Autotools and CMake are welcomed.
PREREQUISITES
-------------
The library requires a semi-modern C++ compiler and GNU Make 3.81 or above. The compiler must support 64-bit words, C++03, namespaces, RTTI and exceptions.
The library does not depend on other build systems, like Autotools or CMake. The library does not depend on other libraries, like Boost.
BUILDING THE LIBRARY
--------------------
In general, all you should have to do is open a terminal, cd to the cryptopp directory, and then:
make
make test
sudo make install
The command above builds the static library and cryptest.exe program. It also uses a sane default flags, which are usually "-DNDEBUG -g2 -O3 -fPIC".
If you want to build the shared object, then issue:
make static dynamic cryptest.exe
Or:
make libcryptopp.a libcryptopp.so cryptest.exe
If you would like to use a different compiler, the set CXX:
export CXX=/opt/intel/bin/icpc
make
Or:
CXX=/opt/solarisstudio12.4/bin/CC make
If you want to build using C++11, then:
export CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11"
make
Or:
CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11" make
LLVM's libc++ is also supported, so you can:
export CXXFLAGS="-std=c++11 -stdlib=libc++"
make
If you are using the library on OS X with XCode then you should add LLVM's libc++. You can do so by modifying CXXFLAGS, or you can modify the GNUmakefile. To modify the GNUmakefile, open it and find the line for OS X builds around line 150:
ifneq ($(IS_DARWIN),0)
CXX ?= c++
CRYPTOPP_CXXFLAGS += -stdlib=libc++
AR = libtool
ARFLAGS = -static -o
endif
If you target 32-bit IA-32 machines (i386, i586 or i686), then the makefile forgoes -fPIC due to register pressures. You should add -fPIC yourself, if needed:
CXXFLAGS="-DNDEBUG -g2 -O3 -fPIC" make
You can also override a variable so that only your flags are present. That is, the makefile will not add additional flags. For example, the following builds with only -std=c++11:
make CXXFLAGS="-std=c++11"
Crypto++ does not engage Specter remediations at this time. You can build with Specter resistance with the following flags:
CXXFLAGS="-DNDEBUG -g2 -O3 -mfunction-return=thunk -mindirect-branch=thunk" make
The library does not support out-of-tree builds. You must cd to the Crypto++ directory before building. `make distclean` will return the Crypto++ directory to a pristine state.
BUILDING WITH VCPKG
-------------------
You can download and install cryptopp using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install cryptopp
The cryptopp port in vcpkg is kept up to date by Microsoft team members and community contributors.
If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
ALTERNATE BUILD SYSTEMS
-----------------------
The Crypto++ library is Make based and uses GNU Make by default. The makefile uses '-DNDEBUG -g2 -O2' CXXFLAGS by default. If you use an alternate build system, like Autotools or CMake, then ensure the build system includes '-DNDEBUG' for production or release builds. The Crypto++ library uses asserts for debugging and diagnostics during development; it does not rely on them to crash a program at runtime.
If an assert triggers in production software, then unprotected sensitive information could be written to the filesystem and could be egressed to the platform's error reporting program, like Apport on Ubuntu, CrashReporter on Apple and Windows Error Reporting on Microsoft OSes.
The makefile orders object files to help remediate problems associated with C++ static initialization order. The library does not use custom linker scripts. If you use an alternate build system, like Autotools or CMake, and collect source files into a list, then ensure these three are at the head of the list: 'cryptlib.cpp cpu.cpp integer.cpp <other sources>'. They should be linked in the same order: 'cryptlib.o cpu.o integer.o <other objects>'.
If your linker supports initialization attributes, like init_priority, then you can define CRYPTOPP_INIT_PRIORITY to control object initialization order. Set it to a value like 250. User programs can use CRYPTOPP_USER_PRIORITY to avoid conflicts with library values. Initialization attributes are more reliable than object file ordering, but its not ubiquitously supported by linkers.
The makefile links to the static version of the Crypto++ library to avoid missing dynamic libraries, incorrect dynamic libraries, binary planting and other LD_PRELOAD tricks. You should use the static version of the library in your programs to help avoid unwanted redirections.
INSTALLING THE LIBRARY
----------------------
To install the library into a user selected directory, perform:
make install PREFIX=/usr/local
If you are going to run `make install PREFIX=/usr/local`, then you should build with '-DCRYPTOPP_DATA_DIR='\"$PREFIX/share/cryptopp/\"' to ensure cryptest.exe can locate the test data files and test vectors after installation. The trailing slash in the path is needed because simple preprocessor concatenation is used.
During install, the makefile copies cryptest.exe into $PREFIX/bin, copies headers into $PREFIX/include/cryptopp, and copies libraries into $PREFIX/lib. If you only built a static or dynamic version of the library, then only one library is copied. The install recipe does not fail if the static library or shared object is not built.
PREFIX is non-standard, but its retained for historical purposes. The makefile also responds to `prefix=<path>`.
MAKEFILE TARGETS
----------------
The following are some of the targets provided by the GNU makefile.
`make` invokes the default rule, which builds the Crypto++ static library and test harness. They are called `libcryptopp.a` and `cryptest.exe`, respectively. `cryptest.exe` links against `libcryptopp.a`, so the static library is a prerequisite for the target.
`make libcryptopp.a` and `make static` build the static version of the library.
`make libcryptopp.so` and `make dynamic` build the dynamic version of the library. On Mac OS X, the recipe builds `libcryptopp.dylib` instead.
`make cryptest.exe` builds the library test harness.
`make test` and `make check` are the same recipe and invoke the test harness with the validation option. That is, it executes `cryptest.exe v`.
`make install` installs the library. By default, the makefile copies into `/usr/local` by default.
`make clean` cleans most transient and temporary objects.
`make disclean` cleans most objects that are not part of the original distribution.
`make dist` and `make zip` builds ZIP file that is suitable for distribution.
`make iso` builds an ISO on Linux or OS X that is suitable for alternate distribution.
`make ubsan` and `make asan` builds the library with the respective sanitizer.
DYNAMIC ANALYSIS
----------------
The Crypto++ embraces tools like Undefined Behavior sanitizer (UBsan), Address sanitizer (Asan), Bounds sanitizer (Bsan), Coverity Scan and Valgrind. Both Clang 3.2 and above and GCC 4.8 and above provide sanitizers. Please check with your distribution on how to install the compiler with its sanitizer libraries (they are sometimes a separate install item).
UBsan and Asan are mutually exclusive options, so you can perform only one of these at a time:
make ubsan
./cryptest.exe v 2>&1 | grep -E "(error:|FAILED)"
./cryptest.exe tv all 2>&1 | grep -E "(error:|FAILED)"
Or:
make asan
./cryptest.exe v 2>&1 | grep -E "(error:|FAILED)"
./cryptest.exe tv all 2>&1 | grep -E "(error:|FAILED)"
If you experience failures under Asan, then gather more information with asan_symbolize. You may not need asan_symbolize nowadays:
./cryptest.exe v 2>&1 | asan_symbolize
If you moved Crypto++ such that the paths have changed, then perform:
./cryptest.exe v 2>&1 | sed "s/<old path>/<new path>/g" | asan_symbolize
ACCEPTANCE TESTING
------------------
Crypto++ uses five security gates in its engineering process. The library must maintain the quality provided by the review system and integrity of the test suites. You can use the information to decide if the Crypto++ library suits your needs and provides a compatible security posture.
The first gate is code review and discussion of proposed chnages. Git commits often cross reference a User Group discussions.
Second is the compiler warning system. The code must clean compile under the equivalent of GCC's -Wall -Wextra (modulo -Wno-type-limits -Wno-unknown-pragmas). This is a moving target as compiler analysis improves.
Third, the code must pass cleanly though GCC and Clang's Undefined Behavior sanitizer (UBsan), Address sanitizer (Asan) and Bounds sanitizer (Bsan). See DYNAMIC ANALYSIS above on how to execute them.
Fourth, the code must pass cleanly though Coverity Scan and Valgrind. Valgrind testing is performed at -O1 in accordance with Valgrind recommendations.
Fifth, the test harness provides a "validation" option which performs basic system checks (like endianness and word sizes) and exercises algorithms (like AES and SHA). You run the validation suite as shown below. The tail of the output should indicate 0 failed tests.
./cryptest.exe v
...
Seed used was 1612313449
Test started at Tue Feb 2 19:50:49 2021
Test ended at Tue Feb 2 19:50:52 2021
Sixth, the test harness provides a "test vector" option which uses many known test vectors, even those published by other people (like Brian Gladman for AES). You run the test vectors as shown below. The tail of the output should indicate 0 failed tests.
./cryptest.exe tv all
...
Testing SymmetricCipher algorithm AES/XTS.
.....................
Tests complete. Total tests = 11260. Failed tests = 0.
The library also offers its test script for those who want to use it. The test script is names cryptest.sh, and it repeatedly builds the library and exectues the tests under various configurations. It takes about 4 hours to run on a semi-modern desktop or server; and several days to run on an IoT gadget. Also see http://github.com/weidai11/cryptopp/blob/master/cryptest.sh and http://cryptopp.com/wiki/Cryptest.sh.
REPORTING PROBLEMS
------------------
Build failures, dirty compiles and failures in the validation suite or test vectors should be reported at the Crypto++ User Group. The User Group is located at http://groups.google.com/forum/#!forum/cryptopp-users.
The library uses Wei Dai's GitHub to track issues. The tracker is located at http://github.com/weidai11/cryptopp/issues. Please do not ask questions in the bug tracker; ask questions on the mailing list instead. Also see http://www.cryptopp.com/wiki/Bug_Report.

View File

@@ -1,83 +0,0 @@
Compilation Copyright (c) 1995-2019 by Wei Dai. All rights reserved.
This copyright applies only to this software distribution package
as a compilation, and does not imply a copyright on any particular
file in the package.
All individual files in this compilation are placed in the public domain by
Wei Dai and other contributors.
I would like to thank the following authors for placing their works into
the public domain:
Joan Daemen - 3way.cpp
Leonard Janke - cast.cpp, seal.cpp
Steve Reid - cast.cpp
Phil Karn - des.cpp
Andrew M. Kuchling - md2.cpp, md4.cpp
Colin Plumb - md5.cpp
Seal Woods - rc6.cpp
Chris Morgan - rijndael.cpp
Paulo Baretto - rijndael.cpp, skipjack.cpp, square.cpp
Richard De Moliner - safer.cpp
Matthew Skala - twofish.cpp
Kevin Springle - camellia.cpp, shacal2.cpp, ttmac.cpp, whrlpool.cpp, ripemd.cpp
Ronny Van Keer - sha3.cpp
Aumasson, Neves, Wilcox-O'Hearn and Winnerlein - blake2.cpp, blake2b_simd.cpp, blake2s_simd.cpp
Aaram Yun - aria.cpp, aria_simd.cpp
Han Lulu, Markku-Juhani O. Saarinen - sm4.cpp sm4_simd.cpp
Daniel J. Bernstein, Jack Lloyd - chacha.cpp, chacha_simd.cpp, chacha_avx.cpp
Andrew Moon - ed25519, x25519, donna_32.cpp, donna_64.cpp, donna_sse.cpp
The Crypto++ Library uses portions of Andy Polyakov's CRYPTOGAMS for Poly1305
scalar multiplication, aes_armv4.S, sha1_armv4.S and sha256_armv4.S. CRYPTOGAMS
is dual licensed with a permissive BSD-style license. The CRYPTOGAMS license is
reproduced below.
The Crypto++ Library uses portions of Jack Lloyd's Botan for ChaCha SSE2 and
AVX. Botan placed the code in public domain for Crypto++ to use.
The Crypto++ Library (as a compilation) is currently licensed under the Boost
Software License 1.0 (http://www.boost.org/users/license.html).
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
CRYPTOGAMS License
Copyright (c) 2006-2017, CRYPTOGAMS by <appro@openssl.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain copyright notices,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of the CRYPTOGAMS nor the names of its copyright
holder and contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

View File

@@ -1,436 +0,0 @@
Crypto++: free C++ Class Library of Cryptographic Schemes
Version 8.6 - TBD
Crypto++ Library is a free C++ class library of cryptographic schemes.
Currently the library contains the following algorithms:
algorithm type name
authenticated encryption schemes GCM, CCM, EAX, ChaCha20Poly1305 and
XChaCha20Poly1305
high speed stream ciphers ChaCha (8/12/20), ChaCha (IETF), Panama, Salsa20,
Sosemanuk, XSalsa20, XChaCha20
AES and AES candidates AES (Rijndael), RC6, MARS, Twofish, Serpent,
CAST-256
ARIA, Blowfish, Camellia, CHAM, HIGHT, IDEA,
Kalyna (128/256/512), LEA, SEED, RC5, SHACAL-2,
other block ciphers SIMON (64/128), Skipjack, SPECK (64/128),
Simeck, SM4, Threefish (256/512/1024),
Triple-DES (DES-EDE2 and DES-EDE3), TEA, XTEA
block cipher modes of operation ECB, CBC, CBC ciphertext stealing (CTS),
CFB, OFB, counter mode (CTR), XTS
message authentication codes BLAKE2s, BLAKE2b, CMAC, CBC-MAC, DMAC, GMAC, HMAC,
Poly1305, Poly1305 (IETF), SipHash, Two-Track-MAC,
VMAC
BLAKE2s, BLAKE2b, Keccack (F1600), LSH (256/512),
hash functions SHA-1, SHA-2 (224/256/384/512), SHA-3 (224/256),
SHA-3 (384/512), SHAKE (128/256), SipHash, SM3, Tiger,
RIPEMD (128/160/256/320), WHIRLPOOL
RSA, DSA, Deterministic DSA, ElGamal,
public-key cryptography Nyberg-Rueppel (NR), Rabin-Williams (RW), LUC,
LUCELG, EC-based German Digital Signature (ECGDSA),
DLIES (variants of DHAES), ESIGN
padding schemes for public-key PKCS#1 v2.0, OAEP, PSS, PSSR, IEEE P1363
systems EMSA2 and EMSA5
Diffie-Hellman (DH), Unified Diffie-Hellman (DH2),
key agreement schemes Menezes-Qu-Vanstone (MQV), Hashed MQV (HMQV),
Fully Hashed MQV (FHMQV), LUCDIF, XTR-DH
elliptic curve cryptography ECDSA, Deterministic ECDSA, ed25519, ECNR, ECIES,
ECDH, ECMQV, x25519
insecure or obsolescent MD2, MD4, MD5, Panama Hash, DES, ARC4, SEAL
algorithms retained for backwards 3.0, WAKE-OFB, DESX (DES-XEX3), RC2,
compatibility and historical SAFER, 3-WAY, GOST, SHARK, CAST-128, Square
value
Other features include:
* pseudo random number generators (PRNG): ANSI X9.17 appendix C, RandomPool,
DARN, VIA Padlock, RDRAND, RDSEED, NIST Hash and HMAC DRBGs
* password based key derivation functions: PBKDF1 and PBKDF2 from PKCS #5,
PBKDF from PKCS #12 appendix B, HKDF from RFC 5869, Scrypt from RFC 7914
* Shamir's secret sharing scheme and Rabin's information dispersal algorithm
(IDA)
* fast multi-precision integer (bignum) and polynomial operations
* finite field arithmetics, including GF(p) and GF(2^n)
* prime number generation and verification
* useful non-cryptographic algorithms
+ DEFLATE (RFC 1951) compression/decompression with gzip (RFC 1952) and
zlib (RFC 1950) format support
+ Hex, base-32, base-64, URL safe base-64 encoding and decoding
+ 32-bit CRC, CRC-C and Adler32 checksum
* class wrappers for these platform and operating system features (optional):
+ high resolution timers on Windows, Unix, and Mac OS
+ /dev/random, /dev/urandom, /dev/srandom
+ Microsoft's CryptGenRandom or BCryptGenRandom on Windows
* A high level interface for most of the above, using a filter/pipeline
metaphor
* benchmarks and validation testing
* x86, x64 (x86-64), x32 (ILP32), ARM-32, Aarch32, Aarch64 and Power8
in-core code for the commonly used algorithms
+ run-time CPU feature detection and code selection
+ supports GCC-style and MSVC-style inline assembly, and MASM for x64
+ x86, x64 (x86-64), x32 provides MMX, SSE2, and SSE4 implementations
+ ARM-32, Aarch32 and Aarch64 provides NEON, ASIMD and ARMv8 implementations
+ Power8 provides in-core AES using NX Crypto Acceleration
The Crypto++ library was originally written by Wei Dai. The library is now
maintained by several team members and the community. You are welcome to use it
for any purpose without paying anyone, but see License.txt for the fine print.
The following compilers are supported for this release. Please visit
http://www.cryptopp.com the most up to date build instructions and porting notes.
* Visual Studio 2003 - 2019
* GCC 3.3 - 10.1
* Apple Clang 4.3 - 12.0
* LLVM Clang 2.9 - 11.0
* C++ Builder 2015
* Intel C++ Compiler 9 - 16.0
* Sun Studio 12u1 - 12.6
* IBM XL C/C++ 10.0 - 14.0
*** Important Usage Notes ***
1. If a constructor for A takes a pointer to an object B (except primitive
types such as int and char), then A owns B and will delete B at A's
destruction. If a constructor for A takes a reference to an object B,
then the caller retains ownership of B and should not destroy it until
A no longer needs it.
2. Crypto++ is thread safe at the class level. This means you can use
Crypto++ safely in a multithreaded application, but you must provide
synchronization when multiple threads access a common Crypto++ object.
*** MSVC-Specific Information ***
To compile Crypto++ with MSVC, open "cryptest.sln" (for MSVC 2003 - 2015)
and build one or more of the following projects:
cryptest Non-DLL-Import Configuration - This builds the full static library
along with a full test driver.
cryptest DLL-Import Configuration - This builds a static library containing
only algorithms not in the DLL, along with a full test driver that uses
both the DLL and the static library.
cryptdll - This builds the DLL. Please note that if you wish to use Crypto++
as a FIPS validated module, you must use a pre-built DLL that has undergone
the FIPS validation process instead of building your own.
dlltest - This builds a sample application that only uses the DLL.
The DLL used to provide FIPS validated cryptography. The library was moved
to the CMVP's [Historical Validation List](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140val-historical.htm).
The library and the DLL are no longer considered
validated. You should no longer use the DLL.
To use the Crypto++ DLL in your application, #include "dll.h" before including
any other Crypto++ header files, and place the DLL in the same directory as
your .exe file. dll.h includes the line #pragma comment(lib, "cryptopp")
so you don't have to explicitly list the import library in your project
settings. To use a static library form of Crypto++, make the "cryptlib"
project a dependency of your application project, or specify it as
an additional library to link with in your project settings.
In either case you should check the compiler options to
make sure that the library and your application are using the same C++
run-time libraries and calling conventions.
*** DLL Memory Management ***
Because it's possible for the Crypto++ DLL to delete objects allocated
by the calling application, they must use the same C++ memory heap. Three
methods are provided to achieve this.
1. The calling application can tell Crypto++ what heap to use. This method
is required when the calling application uses a non-standard heap.
2. Crypto++ can tell the calling application what heap to use. This method
is required when the calling application uses a statically linked C++ Run
Time Library. (Method 1 does not work in this case because the Crypto++ DLL
is initialized before the calling application's heap is initialized.)
3. Crypto++ can automatically use the heap provided by the calling application's
dynamically linked C++ Run Time Library. The calling application must
make sure that the dynamically linked C++ Run Time Library is initialized
before Crypto++ is loaded. (At this time it is not clear if it is possible
to control the order in which DLLs are initialized on Windows 9x machines,
so it might be best to avoid using this method.)
When Crypto++ attaches to a new process, it searches all modules loaded
into the process space for exported functions "GetNewAndDeleteForCryptoPP"
and "SetNewAndDeleteFromCryptoPP". If one of these functions is found,
Crypto++ uses methods 1 or 2, respectively, by calling the function.
Otherwise, method 3 is used.
*** Linux and Unix-like Specific Information ***
A makefile is included for you to compile Crypto++ with GCC and compatibles.
Make sure you are using GNU Make and GNU ld. The make process will produce
two files, libcryptopp.a and cryptest.exe. Run "cryptest.exe v" for the
validation suite and "cryptest.exe tv all" for additional test vectors.
The makefile uses '-DNDEBUG -g2 -O2' CXXFLAGS by default. If you use an
alternate build system, like Autotools or CMake, then ensure the build system
includes '-DNDEBUG' for production or release builds. The Crypto++ library uses
asserts for debugging and diagnostics during development; it does not
rely on them to crash a program at runtime.
If an assert triggers in production software, then unprotected sensitive
information could be egressed from the program to the filesystem or the
platform's error reporting program, like Apport on Ubuntu or CrashReporter
on Apple.
The makefile orders object files to help remediate problems associated with
C++ static initialization order. The library does not use custom linker scripts.
If you use an alternate build system, like Autotools or CMake, and collect source
files into a list, then ensure these three are at the head of the list: 'cryptlib.cpp
cpu.cpp integer.cpp <other sources>'. They should be linked in the same order:
'cryptlib.o cpu.o integer.o <other objects>'.
If your linker supports initialization attributes, like init_priority, then you can
define CRYPTOPP_INIT_PRIORITY to control object initialization order. Set it to a
value like 250. User programs can use CRYPTOPP_USER_PRIORITY to avoid conflicts with
library values. Initialization attributes are more reliable than object file ordering,
but its not ubiquitously supported by linkers.
The makefile links to the static version of the Crypto++ library to avoid binary
planting and other LD_PRELOAD tricks. You should use the static version of the
library in your programs to help avoid unwanted redirections.
*** Side Channel Attacks ***
Crypto++ attempts to resist side channel attacks using various remediations.
The remdiations are applied as a best effort but are probably incomplete. They
are incomplete due to cpu speculation bugs like Spectre, Meltdown, Foreshadow.
The attacks target both cpu caches and internal buffers. Intel generally refers
to internal buffer attacks as "Microarchitectural Data Sampling" (MDS).
The library uses hardware instructions when possible for block ciphers, hashes
and other operations. The hardware acceleration remediates some timing
attacks. The library also uses cache-aware algorithms and access patterns
to minimize leakage cache evictions.
Elliptic curves over binary fields are believed to leak information. The task is a
work in progress. We don't believe binary fields are used in production, so we feel it
is a low risk at the moment.
Crypto++ does not engage Specter remediations at this time. The GCC options
for Specter are -mfunction-return=thunk and -mindirect-branch=thunk, and the
library uses them during testing. If you want the Specter workarounds then add
the GCC options to your CXXFLAGS when building the library.
To help resist attacks you should disable hyperthreading on cpus. If you
suspect or find an information leak then please report it.
*** Documentation and Support ***
Crypto++ is documented through inline comments in header files, which are
processed through Doxygen to produce an HTML reference manual. You can find
a link to the manual from http://www.cryptopp.com. Also at that site is
the Crypto++ FAQ, which you should browse through before attempting to
use this library, because it will likely answer many of questions that
may come up. Finally, the site provide the wiki which has many topics
and code examples.
If you run into any problems, please try the Crypto++ mailing list.
The subscription information and the list archive are available on
http://www.cryptopp.com.
*** Source Code and Contributing ***
The source code and its planned changes are available at the following locations.
* The Crypto++ GitHub repository allows you to view the latest (unreleased)
Crypto++ source code via the Linux kernel's git beginning around June 2015.
Its also serves as an incubator to nurture and grow the library.
* The former Crypto++ SourceForge repository allows you to view the Crypto++
source code via Apache's subversion until about July 2015. At that time,
SourceForge had infrastructure problems and a cutover to GutHub was performed.
* The Roadmap on the wiki provides the general direction the library is heading.
It includes planned features and releases, and even some wishlist items.
Contributions of all types are welcomed. Contributions include the following.
* Bug finding and fixes
* Features and enhancements
* Test scripts and test cases
* Branch and release testing
* Documentation and updates
If you think you have found a bug in the library, then you should discuss it on the
Users mailing list. Discussing it will help bring the issue to the attention of folks
who can help resolve the issue. If you want to contribute a bug fix to the library,
then make a Pull Request or make a Diff available somewhere. Also see Bug Reports on
the wiki.
Features and enhancements are welcomend additions to the library. This category tends
to be time consuming because algorithms and their test cases need to be reviewed and
merged. Please be mindful of the test cases, and attempt to procure them from an
independent source.
The library cherishes test scripts and test cases. They ensure the library is fit and
they help uncover issues with the library before users experience them. If you have
some time, then write some test cases, especially the ones that are intended to break
things.
Branch and release testing is your chance to ensure Master (and planned merges) meets
your expectations and perform as expected. If you have a few spare cycles, then please
test Master on your favorite platform. We need more testing on MinGW, Windows Phone,
Windows Store, Solaris 10 (and below), and modern iOS and OS X (including TV and
Watch builds).
Documentation and updates includes both the inline source code annotations using
Doxygen, and the online information provided in the wiki. The wiki is more verbose and
usually provides more contextual information than the API reference. Besides testing,
documentation is one of the highest returns on investment.
*** History ***
The items in this section comprise the most recent history. Please see History.txt
for the record back to Crypto++ 1.0.
8.6.0 - September 21, 2021
- minor release, recompile of programs required
- expanded community input and support
* 74 unique contributors as of this release
- fix ElGamal encryption
- fix ChaCha20 AVX2 implementation
- add octal and decimal literal prefix parsing to Integer
- add missing overload in ed25519Signer and ed25519Verifier
- make SHA-NI independent of AVX and AVX2
- fix OldRandomPool GenerateWord32
- use CPPFLAGS during feature testing
- fix compile on CentOS 5
- fix compile on FreeBSD
- fix feature testing on ARM A-32 and Aarch64
- enable inline ASM for CRC and PMULL on Apple M1
- fix Intel oneAPI compile
- rename test files with *.cpp extension
- fix GCC compile error due to missing _mm256_set_m128i
- add LSH-256 and LSH-512 hash functions
- add ECIES_P1363 for backwards compatibility
- fix AdditiveCipherTemplate<T> ProcessData
- remove CRYPTOPP_NO_CXX11 define
- add -fno-common for Darwin builds
- update documentation
8.5.0 - March 7, 2021
- minor release, no recompile of programs required
- expanded community input and support
* 70 unique contributors as of this release
- port to Apple M1 hardware
8.4.0 - January 2, 2021
- minor release, recompile of programs required
- expanded community input and support
* 67 unique contributors as of this release
- fix SIGILL on POWER8 when compiling with GCC 10
- fix potential out-of-bounds write in FixedSizeAllocatorWithCleanup
- fix compile on AIX POWER7 with IBM XLC 12.01
- fix compile on Solaris with SunCC 12.6
- revert changes for constant-time elliptic curve algorithms
- fix makefile clean and distclean recipes
8.3.0 - December 20, 2020
- minor release, recompile of programs required
- expanded community input and support
* 66 unique contributors as of this release
- fix use of macro CRYPTOPP_ALIGN_DATA
- fix potential out-of-bounds read in ECDSA
- fix std::bad_alloc when using ByteQueue in pipeline
- fix missing CRYPTOPP_CXX17_EXCEPTIONS with Clang
- fix potential out-of-bounds read in GCM mode
- add configure.sh when preprocessor macros fail
- fix potential out-of-bounds read in SipHash
- fix compile error on POWER9 due to vec_xl_be
- fix K233 curve on POWER8
- add Cirrus CI testing
- fix broken encryption for some 64-bit ciphers
- fix Android cpu-features.c using C++ compiler
- disable RDRAND and RDSEED for some AMD processors
- fix BLAKE2 hash calculation using Salt and Personalization
- refresh Android and iOS build scripts
- add XTS mode
- fix circular dependency between misc.h and secblock.h
- add Certificate interface
- fix recursion in AES::Encryption without AESNI
- add missing OID for ElGamal encryption
- fix missing override in KeyDerivationFunction-derived classes
- fix RDSEED assemble under MSVC
- fix elliptic curve timing leaks (CVE-2019-14318)
- add link-library variable to Makefiles
- fix SIZE_MAX definition in misc.h
- add GetWord64 and PutWord64 to BufferedTransformation
- use HKDF in AutoSeededX917RNG::Reseed
- fix Asan finding in VMAC on i686 in inline asm
- fix undeclared identifier _mm_roti_epi64 on Gentoo
- fix ECIES and GetSymmetricKeyLength
- fix possible divide by zero in PKCS5_PBKDF2_HMAC
- refine ASN.1 encoders and decoders
- disable BMI2 code paths in Integer class
- fix use of CRYPTOPP_CLANG_VERSION
- add NEON SHA1, SHA256 and SHA512 from Cryptogams
- add ARM SHA1, SHA256 and SHA512 from Cryptogams
- make config.h more autoconf friendly
- handle Clang triplet armv8l-unknown-linux-gnueabihf
- fix reference binding to misaligned address in xed25519
- clear asserts in TestDataNameValuePairs
8.2.0 - April 28, 2019
- minor release, no recompile of programs required
- expanded community input and support
* 56 unique contributors as of this release
- use PowerPC unaligned loads and stores with Power8
- add SKIPJACK test vectors
- fix SHAKE-128 and SHAKE-256 compile
- removed IS_NEON from Makefile
- fix Aarch64 build on Fedora 29
- fix missing GF2NT_233_Multiply_Reduce_CLMUL in FIPS DLL
- add missing BLAKE2 constructors
- fix missing BlockSize() in BLAKE2 classes
8.1.0 - February 22, 2019
- minor release, no recompile of programs required
- expanded community input and support
* 56 unique contributors as of this release
- fix OS X PowerPC builds with Clang
- add Microsoft ARM64 support
- fix iPhone Simulator build due to missing symbols
- add CRYPTOPP_BUGGY_SIMD_LOAD_AND_STORE
- add carryless multiplies for NIST b233 and k233 curves
- fix OpenMP build due to use of OpenMP 4 with down-level compilers
- add SignStream and VerifyStream for ed25519 and large files
- fix missing AlgorithmProvider in PanamaHash
- add SHAKE-128 and SHAKE-256
- fix AVX2 build due to _mm256_broadcastsi128_si256
- add IETF ChaCha, XChaCha, ChaChaPoly1305 and XChaChaPoly1305
8.0.0 - December 28, 2018
- major release, recompile of programs required
- expanded community input and support
* 54 unique contributors as of this release
- add x25519 key exchange and ed25519 signature scheme
- add limited Asymmetric Key Package support from RFC 5958
- add Power9 DARN random number generator support
- add CHAM, HC-128, HC-256, Hight, LEA, Rabbit, Simeck
- fix FixedSizeAllocatorWithCleanup may be unaligned on some platforms
- cutover to GNU Make-based cpu feature tests
- rename files with dashes to underscores
- fix LegacyDecryptor and LegacyDecryptorWithMAC use wrong MAC
- fix incorrect AES/CBC decryption on Windows
- avoid Singleton<T> when possible, avoid std::call_once completely
- fix SPARC alignment problems due to GetAlignmentOf<T>() on word64
- add ARM AES asm implementation from Cryptogams
- remove CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS support
June 2015 - Changing of the guard. Wei Dai turned the library over to the
community. The first community release was Crypto++ 5.6.3. Wei is
no longer involved with the daily operations of the project. Wei
still provides guidance when we have questions.
Originally written by Wei Dai, maintained by the Crypto++ Project

View File

@@ -1,3 +0,0 @@
0123456789abcdeffedcba9876543210 0123456789abcde7 7f1d0a77826b8aff
0123456789abcdeffedcba987654321089abcdef01234567 0123456789abcde7 de0b7c06ae5e0ed5
0123456789ABCDEF01010101010101011011121314151617 94DBE082549A14EF 9011121314151617

View File

@@ -1,5 +0,0 @@
000000000000000000000000 000000010000000100000001 4059c76e83ae9dc4ad21ecf7
000000060000000500000004 000000030000000200000001 d2f05b5ed6144138cab920cd
def01234456789abbcdef012 234567899abcdef001234567 0aa55dbb9cdddb6d7cdb76b2
d2f05b5ed6144138cab920cd 4059c76e83ae9dc4ad21ecf7 478ea8716b13f17c15b155ed

View File

@@ -1,45 +0,0 @@
0123456789ABCDEFFEDCBA9876543210 0123456789ABCDEFFEDCBA9876543210 7DC1917AE0D38FAE8D4A7D1959AEF27C
80000000000000000000000000000000 00000000000000000000000000000000 4ABA3055788204D82F4539D81BC9384B
00000000000000000000000000000001 00000000000000000000000000000000 5FA57C3B2E71144C3E5E1E9BE4F0FE7E
00000000000000000000000000000000 80000000000000000000000000000000 92E51E737DABB6BFD0EABC8D32224F77
00000000000000000000000000000000 00000000000000000000000000000001 B426E1A441F6DBFC2B2D2412D0066D20
00000000000000000000000000000000 00000000000000000000000000000000 4B40A63C7F0171EE3CDDA4363FBFAE75
01010101010101010101010101010101 01010101010101010101010101010101 CCE5D964A71D7A5E93986BCA572BB050
02020202020202020202020202020202 02020202020202020202020202020202 A04100328F459F6AAE8EBAB3B5FE90A8
04040404040404040404040404040404 04040404040404040404040404040404 BFE5C38FE204ADC614A321786CDCA08E
08080808080808080808080808080808 08080808080808080808080808080808 95A3371D4879057FAEB2E573CCE8A7F5
10101010101010101010101010101010 10101010101010101010101010101010 80AF7861CA5855FBED523345D36619EC
20202020202020202020202020202020 20202020202020202020202020202020 82E9D82550AECD0E0BB1B63E4B30CEC3
40404040404040404040404040404040 40404040404040404040404040404040 C80C04BA36ED0DA52B3E6CB430617FAC
80808080808080808080808080808080 80808080808080808080808080808080 41305D0632AC493419B04F3BCDBA6AE4
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF B99D80EF798362ACEB9E960AAE7EECC2
0123456789ABCDEFFEDCBA98765432100011223344556677 0123456789ABCDEFFEDCBA9876543210 6DC2DBDAC3C563E522F5A75942B8AFAC
800000000000000000000000000000000000000000000000 00000000000000000000000000000000 F9BA9C6E7E3C86FAE4BEB607F387548E
000000000000000000000000000000000000000000000001 00000000000000000000000000000000 5BC2C08F01C0CDC2F983073CBE9194D2
000000000000000000000000000000000000000000000000 80000000000000000000000000000000 AE56BF59874ED4DBD7B905878894ADEE
000000000000000000000000000000000000000000000000 00000000000000000000000000000001 D53236B0CDE20C26F57675A7405A9F98
000000000000000000000000000000000000000000000000 00000000000000000000000000000000 D5526B5E6A1E3DF23AD8ECAF20F281D0
010101010101010101010101010101010101010101010101 01010101010101010101010101010101 6E4C91AB71707075F375FFB7B3D27328
020202020202020202020202020202020202020202020202 02020202020202020202020202020202 D686D2A6F3BBBC5E703528FD4B1DBA8F
040404040404040404040404040404040404040404040404 04040404040404040404040404040404 ADE1730DA6F15693FD9F063DFC8EC4D1
080808080808080808080808080808080808080808080808 08080808080808080808080808080808 6A3FCA9070151FF14142B1700BE075EB
101010101010101010101010101010101010101010101010 10101010101010101010101010101010 773EC2820CCD29CA650DEA05E04CEB80
202020202020202020202020202020202020202020202020 20202020202020202020202020202020 531A8B8F5F1228E16B57E5365A1FB02B
404040404040404040404040404040404040404040404040 40404040404040404040404040404040 C0166DB2A70DF611921E7F0AB0E0F15D
808080808080808080808080808080808080808080808080 80808080808080808080808080808080 70F3361D505A220B1C2328EBE32ED731
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF F275975CCC163ED53AA0510443239638
0123456789ABCDEFFEDCBA987654321000112233445566778899AABBCCDDEEFF 0123456789ABCDEFFEDCBA9876543210 2F4792014AE2D9B812ADBAC663DC762B
8000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 9250C9771F5A5A8612400AA917491263
0000000000000000000000000000000000000000000000000000000000000001 00000000000000000000000000000000 1A6AED07EC57E4373E988BFBB396406F
0000000000000000000000000000000000000000000000000000000000000000 80000000000000000000000000000000 209ACF63CE6DFB56B1F9821DDBFE86E3
0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000001 678FFFFDCE3177605F9320FEC4D30B5E
0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 C20857DD9106DDDE286EC59FA98D77CC
0101010101010101010101010101010101010101010101010101010101010101 01010101010101010101010101010101 15C28D4EC27D8BEDDD8E6B3745A9A261
0202020202020202020202020202020202020202020202020202020202020202 02020202020202020202020202020202 5279DA1773C078835D506B25FED6513E
0404040404040404040404040404040404040404040404040404040404040404 04040404040404040404040404040404 7AED38F56F62FC75F7DB88F7E59D0B02
0808080808080808080808080808080808080808080808080808080808080808 08080808080808080808080808080808 6EB3C2BC1AC20926E860E688786DB872
1010101010101010101010101010101010101010101010101010101010101010 10101010101010101010101010101010 54A8718B4DD1A03B1A4ED06C30B9E6AB
2020202020202020202020202020202020202020202020202020202020202020 20202020202020202020202020202020 A876FA5538F926B373702DABF33025B6
4040404040404040404040404040404040404040404040404040404040404040 40404040404040404040404040404040 B71AB43F56E09592E69E315E7CD06E8A
8080808080808080808080808080808080808080808080808080808080808080 80808080808080808080808080808080 E975FB1435D92A0CF3E1A2487774D699
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 6C833E3962286C0DE0395446ED30F646

View File

@@ -1,45 +0,0 @@
0123456789ABCDEFFEDCBA9876543210 0123456789ABCDEFFEDCBA9876543210 67673138549669730857065648EABE43
80000000000000000000000000000000 00000000000000000000000000000000 6C227F749319A3AA7DA235A9BBA05A2C
00000000000000000000000000000001 00000000000000000000000000000000 41E0E6DC2DDEC65D8B8120E60977B82D
00000000000000000000000000000000 80000000000000000000000000000000 07923A39EB0A817D1C4D87BDB82D1F1C
00000000000000000000000000000000 00000000000000000000000000000001 F5574ACC3148DFCB9015200631024DF9
00000000000000000000000000000000 00000000000000000000000000000000 3D028025B156327C17F762C1F2CBCA71
01010101010101010101010101010101 01010101010101010101010101010101 637084CB1120D6F25DB618893040AA27
02020202020202020202020202020202 02020202020202020202020202020202 612834AAC9EF906BAEAA076E1C75179D
04040404040404040404040404040404 04040404040404040404040404040404 B24FAF8A579E4EFE986571FB2F68B5B4
08080808080808080808080808080808 08080808080808080808080808080808 3E5CAFBB70545AABB1109293A1C44C14
10101010101010101010101010101010 10101010101010101010101010101010 E1FA5FD3F40B766BBE3DF469AF41B420
20202020202020202020202020202020 20202020202020202020202020202020 7E724027BB2F591C63254D936FCC4B43
40404040404040404040404040404040 40404040404040404040404040404040 538ADCBE104A3483B3C2A3D8CE72FBD6
80808080808080808080808080808080 80808080808080808080808080808080 AA7627F70F6B54C217C3EF232D362459
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 25DD9EB9DD67FBC6E8431F56F4FBE651
0123456789ABCDEFFEDCBA98765432100011223344556677 0123456789ABCDEFFEDCBA9876543210 B4993401B3E996F84EE5CEE7D79B09B9
800000000000000000000000000000000000000000000000 00000000000000000000000000000000 1B6220D365C2176C1D41A5826520FCA1
000000000000000000000000000000000000000000000001 00000000000000000000000000000000 E37577F71E0E643C4D3F55219ABA1394
000000000000000000000000000000000000000000000000 80000000000000000000000000000000 3EB6CC5618EFC98455B5992050D474E7
000000000000000000000000000000000000000000000000 00000000000000000000000000000001 BA9AE89FDDCE4B51131E17C4D65CE587
000000000000000000000000000000000000000000000000 00000000000000000000000000000000 56E1E129CA5C02C7F9AC6AFDEF86ADC3
010101010101010101010101010101010101010101010101 01010101010101010101010101010101 8F764397C10BE84BA876CEEFA4225BFF
020202020202020202020202020202020202020202020202 02020202020202020202020202020202 60B00674BFD444D07B5A19851E6151CD
040404040404040404040404040404040404040404040404 04040404040404040404040404040404 81B26FF4F6B4377CC555873504B3A38B
080808080808080808080808080808080808080808080808 08080808080808080808080808080808 A2AA1C6693DC2B70D75C9B39B9B214D0
101010101010101010101010101010101010101010101010 10101010101010101010101010101010 A907BFDAEEF8C81D05855235E8D3BE08
202020202020202020202020202020202020202020202020 20202020202020202020202020202020 87F8EA30332036F17CEAC0097CE33BC1
404040404040404040404040404040404040404040404040 40404040404040404040404040404040 A2C32EA499E41A248565253BACC11E3B
808080808080808080808080808080808080808080808080 80808080808080808080808080808080 F602BA7F515B082983B8F7A27F92408F
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 3F8D5676F51CE23DC3BDB627F8B3883E
0123456789ABCDEFFEDCBA987654321000112233445566778899AABBCCDDEEFF 0123456789ABCDEFFEDCBA9876543210 9ACC237DFF16D76C20EF7C919E3A7509
8000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 2136FABDA091DFB5171B94B8EFBB5D08
0000000000000000000000000000000000000000000000000000000000000001 00000000000000000000000000000000 AFCD38B195E0A736304E89B9AE3019D3
0000000000000000000000000000000000000000000000000000000000000000 80000000000000000000000000000000 B0C6B88AEA518AB09E847248E91B1B9D
0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000001 9CDB269B5D293BC5DB9C55B057D9B591
0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 396154111ADEFC500CF6E5C99038BC17
0101010101010101010101010101010101010101010101010101010101010101 01010101010101010101010101010101 438D0C2E7E86869B56EBA23B66086A01
0202020202020202020202020202020202020202020202020202020202020202 02020202020202020202020202020202 D4F553BFA794F55EF3B7A578629F6DEA
0404040404040404040404040404040404040404040404040404040404040404 04040404040404040404040404040404 5E858730ABC9823A93CA4CAB67F0B423
0808080808080808080808080808080808080808080808080808080808080808 08080808080808080808080808080808 F9A9C1540AE1B314DBEDF9A49054DC9D
1010101010101010101010101010101010101010101010101010101010101010 10101010101010101010101010101010 6693FC130669F194F81E8D175194DDA2
2020202020202020202020202020202020202020202020202020202020202020 20202020202020202020202020202020 F3E1FDA6B9C8314799F4654C29F1C690
4040404040404040404040404040404040404040404040404040404040404040 40404040404040404040404040404040 4A30476F1141FBF303ED63FCD3CB0536
8080808080808080808080808080808080808080808080808080808080808080 80808080808080808080808080808080 0C765AA494E048FC8BB23139F2124CB6
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 4F05F28CA23EEAE205B67B1C95CD5280

View File

@@ -1,11 +0,0 @@
01 23 45 67 12 34 56 78 23 45 67 89 34 56 78 9A
01 23 45 67 89 AB CD EF
23 8B 4F E5 84 7E 44 B2
01 23 45 67 12 34 56 78 23 45
01 23 45 67 89 AB CD EF
EB 6A 71 1A 2C 02 27 1B
01 23 45 67 12
01 23 45 67 89 AB CD EF
7A C8 16 D1 6E 9B 30 2E

View File

@@ -1,11 +0,0 @@
2342bb9efa38542c0af75647f29f615d
00000000000000000000000000000000
c842a08972b43d20836c91d1b7530f6b
2342bb9efa38542cbed0ac83940ac298bac77a7717942863
00000000000000000000000000000000
1b386c0210dcadcbdd0e41aa08a7a7e8
2342bb9efa38542cbed0ac83940ac2988d7c47ce264908461cc1b5137ae6b604
00000000000000000000000000000000
4f6a2038286897b9c9870136553317fa

View File

@@ -1 +0,0 @@
nCBţ pIbź_¤_ĺ|źâ+"w˙¶¶†Ž˝í#Aýíż‡„nŢmÖéŠČ‡ű%±kXřťąRňłüw`Ză^s.+ÚÚµ<C39A>ř„Š`ŠÝBf]zó•}¦R`}\ŘdiśbfttÉ^ř˛

Binary file not shown.

View File

@@ -1,171 +0,0 @@
0101010101010101 95F8A5E5DD31D900 8000000000000000
0101010101010101 DD7F121CA5015619 4000000000000000
0101010101010101 2E8653104F3834EA 2000000000000000
0101010101010101 4BD388FF6CD81D4F 1000000000000000
0101010101010101 20B9E767B2FB1456 0800000000000000
0101010101010101 55579380D77138EF 0400000000000000
0101010101010101 6CC5DEFAAF04512F 0200000000000000
0101010101010101 0D9F279BA5D87260 0100000000000000
0101010101010101 D9031B0271BD5A0A 0080000000000000
0101010101010101 424250B37C3DD951 0040000000000000
0101010101010101 B8061B7ECD9A21E5 0020000000000000
0101010101010101 F15D0F286B65BD28 0010000000000000
0101010101010101 ADD0CC8D6E5DEBA1 0008000000000000
0101010101010101 E6D5F82752AD63D1 0004000000000000
0101010101010101 ECBFE3BD3F591A5E 0002000000000000
0101010101010101 F356834379D165CD 0001000000000000
0101010101010101 2B9F982F20037FA9 0000800000000000
0101010101010101 889DE068A16F0BE6 0000400000000000
0101010101010101 E19E275D846A1298 0000200000000000
0101010101010101 329A8ED523D71AEC 0000100000000000
0101010101010101 E7FCE22557D23C97 0000080000000000
0101010101010101 12A9F5817FF2D65D 0000040000000000
0101010101010101 A484C3AD38DC9C19 0000020000000000
0101010101010101 FBE00A8A1EF8AD72 0000010000000000
0101010101010101 750D079407521363 0000008000000000
0101010101010101 64FEED9C724C2FAF 0000004000000000
0101010101010101 F02B263B328E2B60 0000002000000000
0101010101010101 9D64555A9A10B852 0000001000000000
0101010101010101 D106FF0BED5255D7 0000000800000000
0101010101010101 E1652C6B138C64A5 0000000400000000
0101010101010101 E428581186EC8F46 0000000200000000
0101010101010101 AEB5F5EDE22D1A36 0000000100000000
0101010101010101 E943D7568AEC0C5C 0000000080000000
0101010101010101 DF98C8276F54B04B 0000000040000000
0101010101010101 B160E4680F6C696F 0000000020000000
0101010101010101 FA0752B07D9C4AB8 0000000010000000
0101010101010101 CA3A2B036DBC8502 0000000008000000
0101010101010101 5E0905517BB59BCF 0000000004000000
0101010101010101 814EEB3B91D90726 0000000002000000
0101010101010101 4D49DB1532919C9F 0000000001000000
0101010101010101 25EB5FC3F8CF0621 0000000000800000
0101010101010101 AB6A20C0620D1C6F 0000000000400000
0101010101010101 79E90DBC98F92CCA 0000000000200000
0101010101010101 866ECEDD8072BB0E 0000000000100000
0101010101010101 8B54536F2F3E64A8 0000000000080000
0101010101010101 EA51D3975595B86B 0000000000040000
0101010101010101 CAFFC6AC4542DE31 0000000000020000
0101010101010101 8DD45A2DDF90796C 0000000000010000
0101010101010101 1029D55E880EC2D0 0000000000008000
0101010101010101 5D86CB23639DBEA9 0000000000004000
0101010101010101 1D1CA853AE7C0C5F 0000000000002000
0101010101010101 CE332329248F3228 0000000000001000
0101010101010101 8405D1ABE24FB942 0000000000000800
0101010101010101 E643D78090CA4207 0000000000000400
0101010101010101 48221B9937748A23 0000000000000200
0101010101010101 DD7C0BBD61FAFD54 0000000000000100
0101010101010101 2FBC291A570DB5C4 0000000000000080
0101010101010101 E07C30D7E4E26E12 0000000000000040
0101010101010101 0953E2258E8E90A1 0000000000000020
0101010101010101 5B711BC4CEEBF2EE 0000000000000010
0101010101010101 CC083F1E6D9E85F6 0000000000000008
0101010101010101 D2FD8867D50D2DFE 0000000000000004
0101010101010101 06E7EA22CE92708F 0000000000000002
0101010101010101 166B40B44ABA4BD6 0000000000000001
8001010101010101 0000000000000000 95A8D72813DAA94D
4001010101010101 0000000000000000 0EEC1487DD8C26D5
2001010101010101 0000000000000000 7AD16FFB79C45926
1001010101010101 0000000000000000 D3746294CA6A6CF3
0801010101010101 0000000000000000 809F5F873C1FD761
0401010101010101 0000000000000000 C02FAFFEC989D1FC
0201010101010101 0000000000000000 4615AA1D33E72F10
0180010101010101 0000000000000000 2055123350C00858
0140010101010101 0000000000000000 DF3B99D6577397C8
0120010101010101 0000000000000000 31FE17369B5288C9
0110010101010101 0000000000000000 DFDD3CC64DAE1642
0108010101010101 0000000000000000 178C83CE2B399D94
0104010101010101 0000000000000000 50F636324A9B7F80
0102010101010101 0000000000000000 A8468EE3BC18F06D
0101800101010101 0000000000000000 A2DC9E92FD3CDE92
0101400101010101 0000000000000000 CAC09F797D031287
0101200101010101 0000000000000000 90BA680B22AEB525
0101100101010101 0000000000000000 CE7A24F350E280B6
0101080101010101 0000000000000000 882BFF0AA01A0B87
0101040101010101 0000000000000000 25610288924511C2
0101020101010101 0000000000000000 C71516C29C75D170
0101018001010101 0000000000000000 5199C29A52C9F059
0101014001010101 0000000000000000 C22F0A294A71F29F
0101012001010101 0000000000000000 EE371483714C02EA
0101011001010101 0000000000000000 A81FBD448F9E522F
0101010801010101 0000000000000000 4F644C92E192DFED
0101010401010101 0000000000000000 1AFA9A66A6DF92AE
0101010201010101 0000000000000000 B3C1CC715CB879D8
0101010180010101 0000000000000000 19D032E64AB0BD8B
0101010140010101 0000000000000000 3CFAA7A7DC8720DC
0101010120010101 0000000000000000 B7265F7F447AC6F3
0101010110010101 0000000000000000 9DB73B3C0D163F54
0101010108010101 0000000000000000 8181B65BABF4A975
0101010104010101 0000000000000000 93C9B64042EAA240
0101010102010101 0000000000000000 5570530829705592
0101010101800101 0000000000000000 8638809E878787A0
0101010101400101 0000000000000000 41B9A79AF79AC208
0101010101200101 0000000000000000 7A9BE42F2009A892
0101010101100101 0000000000000000 29038D56BA6D2745
0101010101080101 0000000000000000 5495C6ABF1E5DF51
0101010101040101 0000000000000000 AE13DBD561488933
0101010101020101 0000000000000000 024D1FFA8904E389
0101010101018001 0000000000000000 D1399712F99BF02E
0101010101014001 0000000000000000 14C1D7C1CFFEC79E
0101010101012001 0000000000000000 1DE5279DAE3BED6F
0101010101011001 0000000000000000 E941A33F85501303
0101010101010801 0000000000000000 DA99DBBC9A03F379
0101010101010401 0000000000000000 B7FC92F91D8E92E9
0101010101010201 0000000000000000 AE8E5CAA3CA04E85
0101010101010180 0000000000000000 9CC62DF43B6EED74
0101010101010140 0000000000000000 D863DBB5C59A91A0
0101010101010120 0000000000000000 A1AB2190545B91D7
0101010101010110 0000000000000000 0875041E64C570F7
0101010101010108 0000000000000000 5A594528BEBEF1CC
0101010101010104 0000000000000000 FCDB3291DE21F0C0
0101010101010102 0000000000000000 869EFD7F9F265A09
1046913489980131 0000000000000000 88D55E54F54C97B4
1007103489988020 0000000000000000 0C0CC00C83EA48FD
10071034C8980120 0000000000000000 83BC8EF3A6570183
1046103489988020 0000000000000000 DF725DCAD94EA2E9
1086911519190101 0000000000000000 E652B53B550BE8B0
1086911519580101 0000000000000000 AF527120C485CBB0
5107B01519580101 0000000000000000 0F04CE393DB926D5
1007B01519190101 0000000000000000 C9F00FFC74079067
3107915498080101 0000000000000000 7CFD82A593252B4E
3107919498080101 0000000000000000 CB49A2F9E91363E3
10079115B9080140 0000000000000000 00B588BE70D23F56
3107911598090140 0000000000000000 406A9A6AB43399AE
1007D01589980101 0000000000000000 6CB773611DCA9ADA
9107911589980101 0000000000000000 67FD21C17DBB5D70
9107D01589190101 0000000000000000 9592CB4110430787
1007D01598980120 0000000000000000 A6B7FF68A318DDD3
1007940498190101 0000000000000000 4D102196C914CA16
0107910491190401 0000000000000000 2DFA9F4573594965
0107910491190101 0000000000000000 B46604816C0E0774
0107940491190401 0000000000000000 6E7E6221A4F34E87
19079210981A0101 0000000000000000 AA85E74643233199
1007911998190801 0000000000000000 2E5A19DB4D1962D6
10079119981A0801 0000000000000000 23A866A809D30894
1007921098190101 0000000000000000 D812D961F017D320
100791159819010B 0000000000000000 055605816E58608F
1004801598190101 0000000000000000 ABD88E8B1B7716F1
1004801598190102 0000000000000000 537AC95BE69DA1E1
1004801598190108 0000000000000000 AED0F6AE3C25CDD8
1002911598100104 0000000000000000 B3E35A5EE53E7B8D
1002911598190104 0000000000000000 61C79C71921A2EF8
1002911598100201 0000000000000000 E2F5728F0995013C
1002911698100101 0000000000000000 1AEAC39A61F0A464
7CA110454A1A6E57 01A1D6D039776742 690F5B0D9A26939B
0131D9619DC1376E 5CD54CA83DEF57DA 7A389D10354BD271
07A1133E4A0B2686 0248D43806F67172 868EBB51CAB4599A
3849674C2602319E 51454B582DDF440A 7178876E01F19B2A
04B915BA43FEB5B6 42FD443059577FA2 AF37FB421F8C4095
0113B970FD34F2CE 059B5E0851CF143A 86A560F10EC6D85B
0170F175468FB5E6 0756D8E0774761D2 0CD3DA020021DC09
43297FAD38E373FE 762514B829BF486A EA676B2CB7DB2B7A
07A7137045DA2A16 3BDD119049372802 DFD64A815CAF1A0F
04689104C2FD3B2F 26955F6835AF609A 5C513C9C4886C088
37D06BB516CB7546 164D5E404F275232 0A2AEEAE3FF4AB77
1F08260D1AC2465E 6B056E18759F5CCA EF1BF03E5DFA575A
584023641ABA6176 004BD6EF09176062 88BF0DB6D70DEE56
025816164629B007 480D39006EE762F2 A1F9915541020B56
49793EBC79B3258F 437540C8698F3CFA 6FBF1CAFCFFD0556
4FB05E1515AB73A7 072D43A077075292 2F22E49BAB7CA1AC
49E95D6D4CA229BF 02FE55778117F12A 5A6B612CC26CCE4A
018310DC409B26D6 1D9D5C5018F728C2 5F4C038ED12B2E41
1C587F1C13924FEF 305532286D6F295A 63FAC0D034D9F793

View File

@@ -1 +0,0 @@
30818702818100DA9A18547FF03B385CC16508C173A7EF4EB61CB40EF8FEF3B31F145051676166BCDC3FE6B799FC394D08C26385F9413F896E09117E46209D6923602683CEA100924A6EE695281775C619DAA94EA8CB3691B4275B0183F1D39639EBC92995FE645D6C1BC28D409E585549BBD2C5DCDD6C208B04EADD8B7A6D997F72CBAD88390F020102

View File

@@ -1 +0,0 @@
308201080282010100EB60DBD494AAFBCD2EAC6A36DB8E7DD4A2A64512A5BBB15B9BFB581C7C1CAFB647D4612973C3770C2166D75EEA695F67EA8261557591DB78BCF5A886AA5294F3AEE4D25B57C8EE8C7FE8DBF70C132CD7FFCB6F89426F807F552C5DAE2FB1F329E340094E4B30D8EF6265AB4D350E9837B151C86AC524DE4E1FC04746C668BE318275E420D51AEDDFBDF887D435CDEEF6AC81293DB45287132F8236A43AD8F4D6642D7CA6732DA06A1DE008259008C9D74403B68ADAC788CF8AB5BEFFC310DCCCD32901D1F290E5B7A993D2CF6A652AF81B6DA0FD2E70678D1AE086150E41444522F20621195AD2A1F0975652B4AF7DE5261A9FD46B9EA8B443641F3BBA695B9B020103

View File

@@ -1 +0,0 @@
308201370201003082011706072A8648CE3804013082010A02818100D4EC6B7A18416519C76766726B3D2D5F054D107B30E97691B15EB0DCDF452B77F10E12C14450AB107BE349C2DF3A2DBD9D844A24ABA21B328D568E8EC6B959E70BADE5C49879AE4447F643360523469B55AFDC459B45634F657AA79918772F2BA9508ACD43C95C16650A1251B8173EBA1B9B59FE8C57F6240EA49A4FE8855CEF0281806A7635BD0C20B28CE3B3B339359E96AF82A6883D9874BB48D8AF586E6FA295BBF8870960A22855883DF1A4E16F9D16DECEC2251255D10D9946AB4747635CACF385D6F2E24C3CD72223FB219B0291A34DAAD7EE22CDA2B1A7B2BD53CC8C3B9795D4A84566A1E4AE0B32850928DC0B9F5D0DCDACFF462BFB1207524D27F442AE77020102041702150C9C14EEFA749DCE9A2A4B7065768767BA48BBB62F

View File

@@ -1 +0,0 @@
308202410201003082021906072A8648CE3804013082020C0282010100A8E87254E7F56CB5857786364ACC39F2A0F79FFF8ED6C62C64EE45FC1C775CDDBFD9CBCEF8262DBD2CECE4E5AFECA239B9B4B7D3CBA228366500F5B2203CA6C0CB0AB6698F73921B4831BA598DFA8268A07368A64774C77808AB7CB7978F839304B10567F8C9C34F8DBDB66BB928EDE6327773AA6C20A8F4E9C2AE0C66A0516E057BBC87760CF39270726F1863260CD5ADDAF366318E7029851A6F85B2349DF29629319A3662354DBCAD0789D02AC6BD804C06523900166501041963BD7EFFE0069694A54F4542172A29B1F09D26E3F052AE5274A898058BE549650BC2066DDFDB84D582E6503AF42BCB2B674F2A2A77C54678FD622FFCA2D9718BF8B0525AEF028201005474392A73FAB65AC2BBC31B25661CF9507BCFFFC76B6316327722FE0E3BAE6EDFECE5E77C1316DE96767272D7F6511CDCDA5BE9E5D1141B32807AD9101E536065855B34C7B9C90DA418DD2CC6FD41345039B45323BA63BC0455BE5BCBC7C1C9825882B3FC64E1A7C6DEDB35DC9476F3193BB9D53610547A74E15706335028B702BDDE43BB0679C93839378C3193066AD6ED79B318C73814C28D37C2D91A4EF94B1498CD1B311AA6DE5683C4E815635EC02603291C800B3280820CB1DEBF7FF0034B4A52A7A2A10B9514D8F84E9371F82957293A544C02C5F2A4B285E10336EFEDC26AC173281D7A15E595B3A795153BE2A33C7EB117FE516CB8C5FC58292D77020102041F021D031D7EC405D3E11D031B7B66DF9EFFCC5173B9B1639E4EC920731484EE

View File

@@ -1 +0,0 @@
3082014A0201003082012B06072A8648CE3804013082011E02818100F468699A6F6EBCC0120D3B34C8E007F125EC7D81F763B8D0F33869AE3BD6B9F2ECCC7DF34DF84C0307449E9B85D30D57194BCCEB310F48141914DD13A077AAF9B624A6CBE666BBA1D7EBEA95B5BA6F54417FD5D4E4220C601E071D316A24EA814E8B0122DBF47EE8AEEFD319EBB01DD95683F10DBB4FEB023F8262A07EAEB7FD02150082AD4E034DA6EEACDFDAE68C36F2BAD614F9E53B02818071AAF73361A26081529F7D84078ADAFCA48E031DB54AD57FB1A833ADBD8672328AABAA0C756247998D7A5B10DACA359D231332CE8120B483A784FE07D46EEBFF0D7D374A10691F78653E6DC29E27CCB1B174923960DFE5B959B919B2C3816C19251832AFD8E35D810E598F82877ABF7D40A041565168BD7F0E21E3FE2A8D8C1C0416021426EBA66E846E755169F84A1DA981D86502405DDF

View File

@@ -1 +0,0 @@
308201B73082012B06072A8648CE3804013082011E02818100F468699A6F6EBCC0120D3B34C8E007F125EC7D81F763B8D0F33869AE3BD6B9F2ECCC7DF34DF84C0307449E9B85D30D57194BCCEB310F48141914DD13A077AAF9B624A6CBE666BBA1D7EBEA95B5BA6F54417FD5D4E4220C601E071D316A24EA814E8B0122DBF47EE8AEEFD319EBB01DD95683F10DBB4FEB023F8262A07EAEB7FD02150082AD4E034DA6EEACDFDAE68C36F2BAD614F9E53B02818071AAF73361A26081529F7D84078ADAFCA48E031DB54AD57FB1A833ADBD8672328AABAA0C756247998D7A5B10DACA359D231332CE8120B483A784FE07D46EEBFF0D7D374A10691F78653E6DC29E27CCB1B174923960DFE5B959B919B2C3816C19251832AFD8E35D810E598F82877ABF7D40A041565168BD7F0E21E3FE2A8D8C1C0381850002818100D30312B7179661DA4691EDE39A71CB961199CD792C50AED6EA7E1A24C53590B6BCD92F26509D3372B2849A17C99C0962FBE4A2606CA37E6DF10244805363450FFAA24A7C274DF0B5D24AE7F31A8319FD2AA6E98AC6E7E3364E7AEDE575A9993609B0DFA387084141EA0B5B2D59B6DE718C0DAB4F86BC59F0DBE8602AED933494

View File

@@ -1 +0,0 @@
3081C60201003081A806072A8648CE38040130819C0241008DF2A494492276AA3D25759BB06869CBEAC0D83AFB8D0CF7CBB8324F0D7882E5D0762FC5B7210EAFC2E9ADAC32AB7AAC49693DFBF83724C2EC0736EE31C80291021500C773218C737EC8EE993B4F2DED30F48EDACE915F0240626D027839EA0A13413163A55B4CB500299D5522956CEFCB3BFF10F399CE2C2E71CB9DE5FA24BABF58E5B79521925C9CC42E9F6F464B088CC572AF53E6D78802041602142070B3223DBA372FDE1C0FFC7B2E3B498B260614

View File

@@ -1 +0,0 @@
3081C80201003081A406072A8648CE3D0201308198020101302006072A8648CE3D0101021500FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF302C0414FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC04141C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA450429044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB3202150100000000000000000001F4C8F927AED3CA752257020101041C301A02010104150023A68821ABB99DBB8429ED2320D61A8EA4C6D81B

View File

@@ -1 +0,0 @@
3081D10201003081AD06072A8648CE3D02013081A1020101302506072A8648CE3D0102301A020200A306092A8648CE3D010203033009020103020106020107302E041507B6882CAAEFA84F9554FF8428BD88E246D2782AE204150713612DCDDCB40AAB946BDA29CA91F73AF958AFD9042B040369979697AB43897789566789567F787A7876A65400435EDB42EFAFB2989D51FEFCE3C80988F41FF883021503FFFFFFFFFFFFFFFFFFFF48AAB689C29CA710279B020102041C301A02010104150003693AB4D83EE8B544548BE7647AEA0EA64E8211

View File

@@ -1 +0,0 @@
302E020100300506032B65700422042098C59D3F097FB23D44BA90791281B453258D691A55AF5CE4F1EE712FDF91AE6D

View File

@@ -1 +0,0 @@
302E020100300506032B65700422042030BF776A497D7F1E0E26AC4FB03F5BE7E187DDFEFB914CD292A6FEDB7F70CE6B

View File

@@ -1 +0,0 @@
3053020101300506032B6570042204206861FD53C7643DABDCDF4C3969CE44A156BAC261242A5AAEC140EDE510071C6CA12303210029CF90E6C1CF1ADC7105720303B2EE303412D2B682C6FEEF3D8736A286B2E27F

View File

@@ -1 +0,0 @@
308201360201003082011606062B0E070201013082010A02818100D18892CC35AD9E532C53810019E525CDE08882E6344D6787C366B171D68948F53D74F7923B148E0A0B4C9B956D695384DE24AC3034000B3C4AD4C8226470BBD88B5B053BCCB01E608B1352D6ED16324745253BDB204308E065368CB9D75ACDB290E671BD4CA1608500BFACD758E6E9EFAC8CCBAD83BE7E397A62E4F55634FC3B02818068C449661AD6CF299629C0800CF292E6F04441731A26B3C3E1B358B8EB44A47A9EBA7BC91D8A470505A64DCAB6B4A9C26F1256181A00059E256A641132385DEC45AD829DE6580F304589A96B768B1923A2929DED90218470329B465CEBAD66D9487338DEA650B042805FD66BAC7374F7D64665D6C1DF3F1CBD31727AAB1A7E1D0201030417021504ED7AED68B1A5EFDE11262210D9F1121D4A119CE8

View File

@@ -1 +0,0 @@
3081E00281807040653BA4FCD5C66E3318B31E82654C5A62957F68D2EE6AE10BD6678D7A14EEF8EBF0C85F28FE22056C12B2A2DD4E9C897EB2FF06D57DB03B872C049ED2806DC3E4D86F2947D134065AC642F233F95FBCB55C533274FA91FFDC0CEB9E71B8795B71A977C7956001FC19E28DE18A80B20E4AE8F775B952CEEA0DEFEAE8E93D7F020120022B1EC74E9FC5EEA090E8DDF4BDB64861C7DC3F8EC7E64286EC2FE39DA55B4763C582DB48146521BDEF0146D5022B1E559EB15755298408E4E4C6F4791BF075C7A8C9B3C7F5B7FA3E8C322BA0A160C09A9DB6BBC4974BE0F877

View File

@@ -1 +0,0 @@
3082014D0281C100E2A6788AB3CC986AEC06C51690143D3677141645D0628165EE924B9AFB7E6EDD52D90145B2F6031522C7A6CEC05E358F42B7837DACEA589F868F8DCA1C0F5FD8E5EDB8BBBAFCFF6D64CFCFBE68F46FBA6EFF45BC9D0CBB4F7F6075F5FFC2049C2F304B51C417764E18D182926E02D4116CE5C5C010E3D0AA6872A49B0D1FF4B37D54689C31F5821D04E9D4DB34D7536EE7F88B8C481B0EC1F93193A0B70567E6FD76E9FAC4F67BB47DACD356D0C8015261E068DDF8C34C0CAFCF3FA775577FEB020120024100FAF0F292EE96D4F449024F86C0A104E0633C722586EC00AD33E0234629825D2081BA337597889CAC55DC6BEBDD8F13FE3AA2133D6371601A37D195DA7BC45EF3024100EBE16F88887A425AA08E271467CC2220DC44012AB24ED4FF3512A96E8CB600C8BBCB771459FF0EE63D4B6786952A83A7143A775073F0A1D69B6D0B5817755673

View File

@@ -1 +0,0 @@
308201B70282010028B1F9CDF87EF6D74F3AC2EA83C17CE376215FB2B3B4817145F1A137FB86B0F7BF0F9BA1BDCF7CC15DF1884DD1B150A983279B90F7A1E4392CB3C16390771DA5668E68621C3898DF66BD254F3787ECFB64B3435E707D5C237A6C09F407D8CD618CC3BBFBAB3DEBA38A0D1A88B2A4E09AE32FF2064EF1896348D5B83047EC2E079D85662EED4A66FBB9C159A617EE3C333BAED66989740F54C3CB336C0EF71130786E70648F2698F4F4192DA06C1578FDB065F8E320EFB63049E4BA664F215924B3E89F69131C5987F357C54593BE173A7AED2D37BE69F90CB574EF83AD49145EB15950FADE9E848DA83BC2CACBEDCAFC4A3B31BFFBBFC4DD03B8E47A218A51410201200256033F9C3F8BDDC021503A687BEC90438F38FF9C0E4C050DD95E46BACA370F478B843611A94BC37B5E838AABFD4ECCCE757BAC967DF8A7DD219B3A71A4DA64D54AB367622B7EB9B4282E898755F02036E91D2A12C81F41025603DB3DE2AE2B52889148C98D68F2B7606B0E5112E60E6A6FF5FD98E5D74143C000B43BEC77082F17C1EF4C82127010B12438D498AAFE8521E21EE6391627D464B54D1BE31F57FFF18C27EC38F08093EA65139A61A2C1

View File

@@ -1 +0,0 @@
3081E0020101302C06072A8648CE3D0101022100FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF30440420FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC04205AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B0441046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5022100FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551020101

View File

@@ -1 +0,0 @@
3081E0020101302C06072A8648CE3D0101022100FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF30440420FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC04205AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B0441046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5022100FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551020101

View File

@@ -1 +0,0 @@
30820140020101303C06072A8648CE3D0101023100FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF30640430FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC0430B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF046104AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB73617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F023100FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973020101

View File

@@ -1 +0,0 @@
308201AC020101304D06072A8648CE3D0101024201FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF308188044201FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC04420051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F000481850400C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650024201FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409020101

View File

@@ -1,23 +0,0 @@
BE5EC2006CFF9DCF52354959F1FF0CBFE95061B5A648C10387069C25997C0672
0DF82802B741A292 07F9027DF7F7DF89
B385272AC8D72A5A8B344BC80363AC4D09BF58F41F540624CBCB8FDCF55307D7
1354EE9C0A11CD4C 4FB50536F960A7B1
AEE02F609A35660E4097E546FD3026B032CD107C7D459977ADF489BEF2652262
6693D492C4B0CC39 670034AC0FA811B5
320E9D8422165D58911DFC7D8BBB1F81B0ECD924023BF94D9DF7DCF7801240E0
99E2D13080928D79 8118FF9D3B3CFE7D
C9F703BBBFC63691BFA3B7B87EA8FD5E8E8EF384EF733F1A61AEF68C8FFA265F
D1E787749C72814C A083826A790D3E0C
728FEE32F04B4C654AD7F607D71C660C2C2670D7C999713233149A1C0C17A1F0
D4C05323A4F7A7B5 4D1F2E6B0D9DE2CE
35FC96402209500FCFDEF5352D1ABB038FE33FC0D9D58512E56370B22BAA133B
8742D9A05F6A3AF6 2F3BB84879D11E52
D416F630BE65B7FE150656183370E07018234EE5DA3D89C4CE9152A03E5BFB77
F86506DA04E41CB8 96F0A5C77A04F5CE

View File

@@ -1 +0,0 @@
3081E0020101302C06072A8648CE3D0101022100FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF30440420FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC04205AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B0441046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5022100FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551020101

View File

@@ -1 +0,0 @@
3081E0020101302C06072A8648CE3D0101022100FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF30440420FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC04205AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B0441046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5022100FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551020101

View File

@@ -1 +0,0 @@
30820140020101303C06072A8648CE3D0101023100FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF30640430FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC0430B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF046104AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB73617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F023100FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973020101

View File

@@ -1 +0,0 @@
308201AC020101304D06072A8648CE3D0101024201FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF308188044201FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC04420051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F000481850400C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650024201FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409020101

Some files were not shown because too many files have changed in this diff Show More