Compare commits
2 Commits
9ad949a760
...
6ee4389b57
Author | SHA1 | Date | |
---|---|---|---|
6ee4389b57 | |||
c97592e485 |
@ -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,
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
// Licensed under GPL v3
|
// Licensed under GPL v3
|
||||||
|
|
||||||
#include "rc4.h"
|
#include "rc4.h"
|
||||||
#include <algorithm>
|
#include <cstddef>
|
||||||
#include <cstring>
|
|
||||||
#include <numeric>
|
|
||||||
|
|
||||||
static constexpr std::array<uchar, 256> get_init_state() noexcept
|
static constexpr std::array<uchar, 256> get_init_state() noexcept
|
||||||
{
|
{
|
||||||
std::array<uchar, 256> state{};
|
std::array<uchar, 256> state{};
|
||||||
std::iota(state.begin(), state.end(), 0);
|
for (std::size_t i = 0; i < 256; ++i) {
|
||||||
|
state[i] = static_cast<uchar>(i);
|
||||||
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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{};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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()};
|
||||||
|
@ -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
|
|
Loading…
x
Reference in New Issue
Block a user