Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
cCtrDrbgContext Class Reference

#include <CtrDrbgContext.h>

Public Member Functions

 cCtrDrbgContext (const std::shared_ptr< cEntropyContext > &a_EntropyContext)
 Constructs the context with the specified entropy context. More...
 
 cCtrDrbgContext (void)
 Constructs the context with a new entropy context. More...
 
int Initialize (const void *a_Custom, size_t a_CustomSize)
 Initializes the context. More...
 
bool IsValid (void) const
 Returns true if the object is valid (has been initialized properly) More...
 

Protected Member Functions

mbedtls_ctr_drbg_context * GetInternal (void)
 Returns the internal context ptr. More...
 

Protected Attributes

mbedtls_ctr_drbg_context m_CtrDrbg
 The random generator context. More...
 
std::shared_ptr< cEntropyContextm_EntropyContext
 The entropy source used for generating the random. More...
 
bool m_IsValid
 Set to true if the object is valid (has been initialized properly) More...
 

Friends

class cCryptoKey
 
class cRsaPrivateKey
 
class cSslConfig
 

Detailed Description

Definition at line 25 of file CtrDrbgContext.h.

Constructor & Destructor Documentation

◆ cCtrDrbgContext() [1/2]

cCtrDrbgContext::cCtrDrbgContext ( void  )

Constructs the context with a new entropy context.

Definition at line 14 of file CtrDrbgContext.cpp.

◆ cCtrDrbgContext() [2/2]

cCtrDrbgContext::cCtrDrbgContext ( const std::shared_ptr< cEntropyContext > &  a_EntropyContext)

Constructs the context with the specified entropy context.

Definition at line 25 of file CtrDrbgContext.cpp.

Member Function Documentation

◆ GetInternal()

mbedtls_ctr_drbg_context* cCtrDrbgContext::GetInternal ( void  )
inlineprotected

Returns the internal context ptr.

Only use in mbedTLS API calls.

Definition at line 58 of file CtrDrbgContext.h.

◆ Initialize()

int cCtrDrbgContext::Initialize ( const void *  a_Custom,
size_t  a_CustomSize 
)

Initializes the context.

a_Custom is optional additional data to use for entropy, nullptr is accepted. Returns 0 if successful, mbedTLS error code on failure.

Definition at line 36 of file CtrDrbgContext.cpp.

◆ IsValid()

bool cCtrDrbgContext::IsValid ( void  ) const
inline

Returns true if the object is valid (has been initialized properly)

Definition at line 44 of file CtrDrbgContext.h.

Friends And Related Function Documentation

◆ cCryptoKey

friend class cCryptoKey
friend

Definition at line 29 of file CtrDrbgContext.h.

◆ cRsaPrivateKey

friend class cRsaPrivateKey
friend

Definition at line 28 of file CtrDrbgContext.h.

◆ cSslConfig

friend class cSslConfig
friend

Definition at line 27 of file CtrDrbgContext.h.

Member Data Documentation

◆ m_CtrDrbg

mbedtls_ctr_drbg_context cCtrDrbgContext::m_CtrDrbg
protected

The random generator context.

Definition at line 51 of file CtrDrbgContext.h.

◆ m_EntropyContext

std::shared_ptr<cEntropyContext> cCtrDrbgContext::m_EntropyContext
protected

The entropy source used for generating the random.

Definition at line 48 of file CtrDrbgContext.h.

◆ m_IsValid

bool cCtrDrbgContext::m_IsValid
protected

Set to true if the object is valid (has been initialized properly)

Definition at line 54 of file CtrDrbgContext.h.


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