Project Alice
Loading...
Searching...
No Matches
r123::ReinterpretCtr< ToType, CBRNG > Struct Template Reference

#include <ReinterpretCtr.hpp>

Public Types

typedef ToType ctr_type
 
typedef CBRNG::key_type key_type
 
typedef CBRNG::ctr_type bctype
 
typedef CBRNG::ukey_type ukey_type
 

Public Member Functions

 R123_STATIC_ASSERT (sizeof(ToType)==sizeof(bctype) &&sizeof(typename bctype::value_type) !=16, "ReinterpretCtr: sizeof(ToType) is not the same as sizeof(CBRNG::ctr_type) or CBRNG::ctr_type::value_type looks " "like it might be __m128i")
 
ctr_type operator() (ctr_type c, key_type k)
 

Detailed Description

template<typename ToType, typename CBRNG>
struct r123::ReinterpretCtr< ToType, CBRNG >

ReinterpretCtr uses memcpy to map back and forth between a CBRNG's ctr_type and the specified ToType. For example, after:

typedef ReinterpretCtr<r123array4x32, Philox2x64> G;

G is a bona fide CBRNG with ctr_type r123array4x32.

WARNING: ReinterpretCtr is endian dependent. The values returned by G, declared as above, will depend on the endianness of the machine on which it runs.

Definition at line 54 of file ReinterpretCtr.hpp.

Member Typedef Documentation

◆ bctype

template<typename ToType , typename CBRNG >
typedef CBRNG::ctr_type r123::ReinterpretCtr< ToType, CBRNG >::bctype

Definition at line 57 of file ReinterpretCtr.hpp.

◆ ctr_type

template<typename ToType , typename CBRNG >
typedef ToType r123::ReinterpretCtr< ToType, CBRNG >::ctr_type

Definition at line 55 of file ReinterpretCtr.hpp.

◆ key_type

template<typename ToType , typename CBRNG >
typedef CBRNG::key_type r123::ReinterpretCtr< ToType, CBRNG >::key_type

Definition at line 56 of file ReinterpretCtr.hpp.

◆ ukey_type

template<typename ToType , typename CBRNG >
typedef CBRNG::ukey_type r123::ReinterpretCtr< ToType, CBRNG >::ukey_type

Definition at line 58 of file ReinterpretCtr.hpp.

Member Function Documentation

◆ operator()()

template<typename ToType , typename CBRNG >
ctr_type r123::ReinterpretCtr< ToType, CBRNG >::operator() ( ctr_type  c,
key_type  k 
)
inline

Definition at line 79 of file ReinterpretCtr.hpp.

◆ R123_STATIC_ASSERT()

template<typename ToType , typename CBRNG >
r123::ReinterpretCtr< ToType, CBRNG >::R123_STATIC_ASSERT ( sizeof(ToType)  = =sizeof(bctype) &&sizeof(typename bctype::value_type) !=16,
"ReinterpretCtr< ToType, CBRNG >: sizeof(ToType) is not the same as sizeof(CBRNG::ctr_type) or CBRNG::ctr_type::value_type looks " "like it might be __m128i"   
)

The documentation for this struct was generated from the following file: