23 lines
352 B
C++
23 lines
352 B
C++
// Copyright (C) 2007-2025 EQ2EMulator
|
|
// Licensed under GPL v3
|
|
#pragma once
|
|
|
|
#include "../types.h"
|
|
#include <array>
|
|
|
|
class RC4
|
|
{
|
|
public:
|
|
explicit RC4(int64 key) noexcept;
|
|
~RC4() = default;
|
|
|
|
void Init(int64 key) noexcept;
|
|
void Cypher(uchar* data, int32 length) noexcept;
|
|
|
|
private:
|
|
std::array<uchar, 256> m_state{};
|
|
uchar m_x{};
|
|
uchar m_y{};
|
|
};
|
|
|