Random123
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
philox.h File Reference

Go to the source code of this file.

Classes

class  r123::Philox2x32_R< ROUNDS >
 
class  r123::Philox4x32_R< ROUNDS >
 
class  r123::Philox2x64_R< ROUNDS >
 
class  r123::Philox4x64_R< ROUNDS >
 

Namespaces

 r123
 

Macros

#define PHILOX2x32_DEFAULT_ROUNDS   10
 
#define PHILOX2x64_DEFAULT_ROUNDS   10
 
#define PHILOX4x32_DEFAULT_ROUNDS   10
 
#define PHILOX4x64_DEFAULT_ROUNDS   10
 
#define _philoxNxW_tpl(N, Nhalf, W, T)
 
#define philox2x32(c, k)   philox2x32_R(philox2x32_rounds, c, k)
 
#define philox4x32(c, k)   philox4x32_R(philox4x32_rounds, c, k)
 
#define philox2x64(c, k)   philox2x64_R(philox2x64_rounds, c, k)
 
#define philox4x64(c, k)   philox4x64_R(philox4x64_rounds, c, k)
 
#define _PhiloxNxW_base_tpl(CType, KType, N, W)
 

Typedefs

typedef struct r123array2x32 philox2x32_ctr_t
 
typedef struct r123array1x32 philox2x32_key_t
 
typedef struct r123array1x32 philox2x32_ukey_t
 
typedef struct r123array4x32 philox4x32_ctr_t
 
typedef struct r123array2x32 philox4x32_key_t
 
typedef struct r123array2x32 philox4x32_ukey_t
 
typedef struct r123array2x64 philox2x64_ctr_t
 
typedef struct r123array1x64 philox2x64_key_t
 
typedef struct r123array1x64 philox2x64_ukey_t
 
typedef struct r123array4x64 philox4x64_ctr_t
 
typedef struct r123array2x64 philox4x64_key_t
 
typedef struct r123array2x64 philox4x64_ukey_t
 
typedef Philox2x32_R< philox2x32_rounds > r123::Philox2x32
 
typedef Philox4x32_R< philox4x32_roundsr123::Philox4x32
 
typedef Philox2x64_R< philox2x64_roundsr123::Philox2x64
 
typedef Philox4x64_R< philox4x64_roundsr123::Philox4x64
 

Enumerations

enum  r123_enum_philox4x32 { philox4x32_rounds = 10 }
 
enum  r123_enum_philox2x64 { philox2x64_rounds = 10 }
 
enum  r123_enum_philox4x64 { philox4x64_rounds = 10 }
 

Functions

 _philox2xWbumpkey_tpl (32) _philox4xWbumpkey_tpl(32) _philox2xWround_tpl(32
 
uint32_t _philox4xWround_tpl (32, uint32_t) enum r123_enum_philox2x32
 
static philox2x32_key_t philox2x32keyinit (philox2x32_ukey_t uk)
 
R123_CUDA_DEVICE R123_STATIC_INLINE philox2x32_ctr_t philox2x32_R (unsigned int R, philox2x32_ctr_t ctr, philox2x32_key_t key)
 
static philox4x32_key_t philox4x32keyinit (philox4x32_ukey_t uk)
 
R123_CUDA_DEVICE R123_STATIC_INLINE philox4x32_ctr_t philox4x32_R (unsigned int R, philox4x32_ctr_t ctr, philox4x32_key_t key)
 
static philox2x64_key_t philox2x64keyinit (philox2x64_ukey_t uk)
 
R123_CUDA_DEVICE R123_STATIC_INLINE philox2x64_ctr_t philox2x64_R (unsigned int R, philox2x64_ctr_t ctr, philox2x64_key_t key)
 
static philox4x64_key_t philox4x64keyinit (philox4x64_ukey_t uk)
 
R123_CUDA_DEVICE R123_STATIC_INLINE philox4x64_ctr_t philox4x64_R (unsigned int R, philox4x64_ctr_t ctr, philox4x64_key_t key)
 

Macro Definition Documentation

◆ _PhiloxNxW_base_tpl

#define _PhiloxNxW_base_tpl (   CType,
  KType,
  N,
 
)
Value:
namespace r123{ \
template<unsigned int ROUNDS> \
struct Philox##N##x##W##_R{ \
typedef CType ctr_type; \
typedef KType key_type; \
typedef KType ukey_type; \
static const R123_METAL_CONSTANT_ADDRESS_SPACE unsigned int rounds=ROUNDS; \
inline R123_CUDA_DEVICE R123_FORCE_INLINE(ctr_type operator()(ctr_type ctr, key_type key) const){ \
R123_STATIC_ASSERT(ROUNDS<=16, "philox is only unrolled up to 16 rounds\n"); \
return philox##N##x##W##_R(ROUNDS, ctr, key); \
} \
}; \
typedef Philox##N##x##W##_R<philox##N##x##W##_rounds> Philox##N##x##W; \
}

◆ _philoxNxW_tpl

#define _philoxNxW_tpl (   N,
  Nhalf,
  W,
 
)
Value:
\
enum r123_enum_philox##N##x##W { philox##N##x##W##_rounds = PHILOX##N##x##W##_DEFAULT_ROUNDS }; \
typedef struct r123array##N##x##W philox##N##x##W##_ctr_t; \
typedef struct r123array##Nhalf##x##W philox##N##x##W##_key_t; \
typedef struct r123array##Nhalf##x##W philox##N##x##W##_ukey_t; \
R123_CUDA_DEVICE R123_STATIC_INLINE philox##N##x##W##_key_t philox##N##x##W##keyinit(philox##N##x##W##_ukey_t uk) { return uk; } \
R123_CUDA_DEVICE R123_STATIC_INLINE R123_FORCE_INLINE(philox##N##x##W##_ctr_t philox##N##x##W##_R(unsigned int R, philox##N##x##W##_ctr_t ctr, philox##N##x##W##_key_t key)); \
R123_CUDA_DEVICE R123_STATIC_INLINE philox##N##x##W##_ctr_t philox##N##x##W##_R(unsigned int R, philox##N##x##W##_ctr_t ctr, philox##N##x##W##_key_t key) { \
R123_ASSERT(R<=16); \
if(R>0){ ctr = _philox##N##x##W##round(ctr, key); } \
if(R>1){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>2){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>3){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>4){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>5){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>6){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>7){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>8){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>9){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>10){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>11){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>12){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>13){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>14){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
if(R>15){ key = _philox##N##x##W##bumpkey(key); ctr = _philox##N##x##W##round(ctr, key); } \
return ctr; \
}

◆ philox2x32

#define philox2x32 (   c,
 
)    philox2x32_R(philox2x32_rounds, c, k)

◆ PHILOX2x32_DEFAULT_ROUNDS

#define PHILOX2x32_DEFAULT_ROUNDS   10

◆ philox2x64

#define philox2x64 (   c,
 
)    philox2x64_R(philox2x64_rounds, c, k)

◆ PHILOX2x64_DEFAULT_ROUNDS

#define PHILOX2x64_DEFAULT_ROUNDS   10

◆ philox4x32

#define philox4x32 (   c,
 
)    philox4x32_R(philox4x32_rounds, c, k)

◆ PHILOX4x32_DEFAULT_ROUNDS

#define PHILOX4x32_DEFAULT_ROUNDS   10

◆ philox4x64

#define philox4x64 (   c,
 
)    philox4x64_R(philox4x64_rounds, c, k)

◆ PHILOX4x64_DEFAULT_ROUNDS

#define PHILOX4x64_DEFAULT_ROUNDS   10

Typedef Documentation

◆ philox2x32_ctr_t

◆ philox2x32_key_t

◆ philox2x32_ukey_t

◆ philox2x64_ctr_t

◆ philox2x64_key_t

◆ philox2x64_ukey_t

◆ philox4x32_ctr_t

◆ philox4x32_key_t

◆ philox4x32_ukey_t

◆ philox4x64_ctr_t

◆ philox4x64_key_t

◆ philox4x64_ukey_t

Function Documentation

◆ _philox2xWbumpkey_tpl()

_philox2xWbumpkey_tpl ( 32  )

◆ philox2x32_R()

R123_CUDA_DEVICE R123_STATIC_INLINE philox2x32_ctr_t philox2x32_R ( unsigned int  R,
philox2x32_ctr_t  ctr,
philox2x32_key_t  key 
)

◆ philox2x32keyinit()

static philox2x32_key_t philox2x32keyinit ( philox2x32_ukey_t  uk)
inlinestatic

◆ philox2x64_R()

R123_CUDA_DEVICE R123_STATIC_INLINE philox2x64_ctr_t philox2x64_R ( unsigned int  R,
philox2x64_ctr_t  ctr,
philox2x64_key_t  key 
)

◆ philox2x64keyinit()

static philox2x64_key_t philox2x64keyinit ( philox2x64_ukey_t  uk)
inlinestatic

◆ philox4x32_R()

R123_CUDA_DEVICE R123_STATIC_INLINE philox4x32_ctr_t philox4x32_R ( unsigned int  R,
philox4x32_ctr_t  ctr,
philox4x32_key_t  key 
)

◆ philox4x32keyinit()

static philox4x32_key_t philox4x32keyinit ( philox4x32_ukey_t  uk)
inlinestatic

◆ philox4x64_R()

R123_CUDA_DEVICE R123_STATIC_INLINE philox4x64_ctr_t philox4x64_R ( unsigned int  R,
philox4x64_ctr_t  ctr,
philox4x64_key_t  key 
)

◆ philox4x64keyinit()

static philox4x64_key_t philox4x64keyinit ( philox4x64_ukey_t  uk)
inlinestatic
r123
Definition: aes.h:242