clean up crypto packages

This commit is contained in:
Sky Johnson 2025-09-06 21:11:34 -05:00
parent c97592e485
commit 6ee4389b57
5 changed files with 55 additions and 59 deletions

View File

@ -1,8 +1,6 @@
// Copyright (C) 2007-2025 EQ2EMulator // Copyright (C) 2007-2025 EQ2EMulator
// Licensed under GPL v3 // Licensed under GPL v3
#include <stdio.h>
unsigned long IntArray[] = { unsigned long IntArray[] = {
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,

View File

@ -2,12 +2,11 @@
// Licensed under GPL v3 // Licensed under GPL v3
#include "crypto.h" #include "crypto.h"
#include <algorithm>
#include <array> #include <array>
#include <cstring> #include <cstring>
#include <mutex> #include <mutex>
int64 Crypto::RSADecrypt(uchar* text, int16 size) noexcept int64 Crypto::RSADecrypt(uchar* text, [[maybe_unused]] int16 size) noexcept
{ {
int64 ret = 0; int64 ret = 0;
std::array<uchar, 8> buffer{}; std::array<uchar, 8> buffer{};
@ -50,4 +49,3 @@ void Crypto::setRC4Key(int64 key) noexcept
server.reset(); server.reset();
} }
} }

View File

@ -1,5 +1,6 @@
// Copyright (C) 2007-2025 EQ2EMulator // Copyright (C) 2007-2025 EQ2EMulator
// Licensed under GPL v3 // Licensed under GPL v3
#pragma once #pragma once
#include "../types.h" #include "../types.h"
@ -19,4 +20,3 @@ private:
uchar m_x{}; uchar m_x{};
uchar m_y{}; uchar m_y{};
}; };

View File

@ -2,7 +2,6 @@
// Licensed under GPL v3 // Licensed under GPL v3
#include "sha512.h" #include "sha512.h"
#include <algorithm>
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
@ -158,7 +157,7 @@ std::string sha512(std::string_view input) noexcept
ctx.final(digest.data()); ctx.final(digest.data());
std::array<char, 2 * SHA512::DIGEST_SIZE + 1> buf{}; std::array<char, 2 * SHA512::DIGEST_SIZE + 1> buf{};
for (int i = 0; i < SHA512::DIGEST_SIZE; ++i) { for (unsigned int i = 0; i < SHA512::DIGEST_SIZE; ++i) {
std::sprintf(buf.data() + i * 2, "%02x", digest[i]); std::sprintf(buf.data() + i * 2, "%02x", digest[i]);
} }
return std::string{buf.data()}; return std::string{buf.data()};

View File

@ -1,3 +1,6 @@
// Copyright (C) 2007-2025 EQ2EMulator
// Licensed under GPL v3
#pragma once #pragma once
#include <array> #include <array>
@ -70,5 +73,3 @@ protected:
| ((uint64) *((str) + 1) << 48) \ | ((uint64) *((str) + 1) << 48) \
| ((uint64) *((str) + 0) << 56); \ | ((uint64) *((str) + 0) << 56); \
} }
#endif