Botcraft 1.21.4
Loading...
Searching...
No Matches
Botcraft::AESEncrypter Class Reference

#include <AESEncrypter.hpp>

Public Member Functions

 AESEncrypter ()
 
 ~AESEncrypter ()
 
void Init (const std::vector< unsigned char > &pub_key, const std::vector< unsigned char > &input_nonce, std::vector< unsigned char > &raw_shared_secret, std::vector< unsigned char > &encrypted_shared_secret, std::vector< unsigned char > &encrypted_challenge)
 Initialize the encryption context for this connection.
 
std::vector< unsigned char > Encrypt (const std::vector< unsigned char > &in)
 
std::vector< unsigned char > Decrypt (const std::vector< unsigned char > &in)
 

Private Attributes

EVP_CIPHER_CTXencryption_context
 
EVP_CIPHER_CTXdecryption_context
 
unsigned int blocksize
 

Detailed Description

Definition at line 14 of file AESEncrypter.hpp.

Constructor & Destructor Documentation

◆ AESEncrypter()

Botcraft::AESEncrypter::AESEncrypter ( )

Definition at line 20 of file AESEncrypter.cpp.

References blocksize, decryption_context, and encryption_context.

◆ ~AESEncrypter()

Botcraft::AESEncrypter::~AESEncrypter ( )

Definition at line 27 of file AESEncrypter.cpp.

References decryption_context, and encryption_context.

Member Function Documentation

◆ Decrypt()

std::vector< unsigned char > Botcraft::AESEncrypter::Decrypt ( const std::vector< unsigned char > &  in)

Definition at line 143 of file AESEncrypter.cpp.

References blocksize, decryption_context, and LOG_WARNING.

◆ Encrypt()

std::vector< unsigned char > Botcraft::AESEncrypter::Encrypt ( const std::vector< unsigned char > &  in)

Definition at line 125 of file AESEncrypter.cpp.

References blocksize, encryption_context, and LOG_WARNING.

◆ Init()

void Botcraft::AESEncrypter::Init ( const std::vector< unsigned char > &  pub_key,
const std::vector< unsigned char > &  input_nonce,
std::vector< unsigned char > &  raw_shared_secret,
std::vector< unsigned char > &  encrypted_shared_secret,
std::vector< unsigned char > &  encrypted_challenge 
)

Initialize the encryption context for this connection.

Parameters
pub_keyServer public key
input_nonceServer input nonce
raw_shared_secretOutput shared secret
encrypted_shared_secretShared secret encrypted using server public key
encrypted_challengeOutput encrypted challenge

Definition at line 51 of file AESEncrypter.cpp.

Member Data Documentation

◆ blocksize

unsigned int Botcraft::AESEncrypter::blocksize
private

Definition at line 57 of file AESEncrypter.hpp.

Referenced by AESEncrypter(), Decrypt(), and Encrypt().

◆ decryption_context

EVP_CIPHER_CTX* Botcraft::AESEncrypter::decryption_context
private

Definition at line 56 of file AESEncrypter.hpp.

Referenced by AESEncrypter(), Decrypt(), and ~AESEncrypter().

◆ encryption_context

EVP_CIPHER_CTX* Botcraft::AESEncrypter::encryption_context
private

Definition at line 55 of file AESEncrypter.hpp.

Referenced by AESEncrypter(), Encrypt(), and ~AESEncrypter().


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