AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::Impl::CryptoGenericsImpl Struct Reference

#include "CryptoGenerics.h"

Static Public Member Functions

template<typename Cipher >
static Cipher::IV GenerateRandomIV ()
 
template<typename Container >
static void AppendToBack (std::vector< uint8 > &data, Container const &tail)
 
template<typename Container >
static void SplitFromBack (std::vector< uint8 > &data, Container &tail)
 

Detailed Description

Member Function Documentation

◆ AppendToBack()

template<typename Container >
static void Acore::Impl::CryptoGenericsImpl::AppendToBack ( std::vector< uint8 > &  data,
Container const &  tail 
)
inlinestatic
42 {
43 data.insert(data.end(), std::begin(tail), std::end(tail));
44 }

Referenced by Acore::Crypto::AEEncryptWithRandomIV().

◆ GenerateRandomIV()

template<typename Cipher >
static Cipher::IV Acore::Impl::CryptoGenericsImpl::GenerateRandomIV ( )
inlinestatic
34 {
35 typename Cipher::IV iv;
37 return iv;
38 }
std::array< uint8, S > GetRandomBytes()
Definition: CryptoRandom.h:35

References Acore::Crypto::GetRandomBytes().

◆ SplitFromBack()

template<typename Container >
static void Acore::Impl::CryptoGenericsImpl::SplitFromBack ( std::vector< uint8 > &  data,
Container tail 
)
inlinestatic
48 {
49 ASSERT(data.size() >= std::size(tail));
50 for (std::size_t i = 1, N = std::size(tail); i <= N; ++i)
51 {
52 tail[N - i] = data.back();
53 data.pop_back();
54 }
55 }
#define ASSERT
Definition: Errors.h:68

References ASSERT.

Referenced by Acore::Crypto::AEDecrypt().