TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ARC4 Class Reference

#include <ARC4.h>

Public Member Functions

 ARC4 (uint32 len)
 
 ARC4 (uint8 *seed, uint32 len)
 
 ~ARC4 ()
 
void Init (uint8 *seed)
 
void UpdateData (int len, uint8 *data)
 

Private Attributes

EVP_CIPHER_CTX m_ctx
 

Constructor & Destructor Documentation

ARC4::ARC4 ( uint32  len)
22  : m_ctx()
23 {
24  EVP_CIPHER_CTX_init(&m_ctx);
25  EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL);
26  EVP_CIPHER_CTX_set_key_length(&m_ctx, len);
27 }
arena_t NULL
Definition: jemalloc_internal.h:624
EVP_CIPHER_CTX m_ctx
Definition: ARC4.h:34
ARC4::ARC4 ( uint8 seed,
uint32  len 
)
29  : m_ctx()
30 {
31  EVP_CIPHER_CTX_init(&m_ctx);
32  EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL);
33  EVP_CIPHER_CTX_set_key_length(&m_ctx, len);
34  EVP_EncryptInit_ex(&m_ctx, NULL, NULL, seed, NULL);
35 }
arena_t NULL
Definition: jemalloc_internal.h:624
EVP_CIPHER_CTX m_ctx
Definition: ARC4.h:34
ARC4::~ARC4 ( )
38 {
39  EVP_CIPHER_CTX_cleanup(&m_ctx);
40 }
EVP_CIPHER_CTX m_ctx
Definition: ARC4.h:34

Member Function Documentation

void ARC4::Init ( uint8 seed)
43 {
44  EVP_EncryptInit_ex(&m_ctx, NULL, NULL, seed, NULL);
45 }
arena_t NULL
Definition: jemalloc_internal.h:624
EVP_CIPHER_CTX m_ctx
Definition: ARC4.h:34

+ Here is the caller graph for this function:

void ARC4::UpdateData ( int  len,
uint8 data 
)
48 {
49  int outlen = 0;
50  EVP_EncryptUpdate(&m_ctx, data, &outlen, data, len);
51  EVP_EncryptFinal_ex(&m_ctx, data, &outlen);
52 }
EVP_CIPHER_CTX m_ctx
Definition: ARC4.h:34

+ Here is the caller graph for this function:

Member Data Documentation

EVP_CIPHER_CTX ARC4::m_ctx
private

The documentation for this class was generated from the following files: