Dynalib Utils
Macros | Functions
ISAAC64Random.cpp File Reference
#include <cstring>
#include "../TypeDefs.h"
#include "standard.h"
#include "ISAAC64Random.h"
Include dependency graph for ISAAC64Random.cpp:

Macros

#define ind(mm, x)   (*(uint64_t *)((ub1 *)(mm) + ((x) & ((RANDSIZ-1)<<3))))
 
#define rngstep(mix, a, b, mm, m, m2, r, x)
 
#define mix(a, b, c, d, e, f, g, h)
 
#define shuffle(a, b, mm, m, m2, r, x)
 

Functions

void isaac64Seed (char *seed, Rand64Context *ctx)
 
void isaac64Init (bool hasSeed, Rand64Context *ctx)
 
void isaac64Random (Rand64Context *ctx)
 
uint64_t rand64Int (Rand64Context *ctx)
 
void rand64Bytes (Rand64Context *ctx, uint8_t *buf, int count)
 

Macro Definition Documentation

◆ ind

#define ind (   mm,
 
)    (*(uint64_t *)((ub1 *)(mm) + ((x) & ((RANDSIZ-1)<<3))))

◆ mix

#define mix (   a,
  b,
  c,
  d,
  e,
  f,
  g,
 
)
Value:
{ \
a-=e; f^=h>>9; h+=a; \
b-=f; g^=a<<9; a+=b; \
c-=g; h^=b>>23; b+=c; \
d-=h; a^=c<<15; c+=d; \
e-=a; b^=d>>14; d+=e; \
f-=b; c^=e<<20; e+=f; \
g-=c; d^=f>>17; f+=g; \
h-=d; e^=g<<14; g+=h; \
}

◆ rngstep

#define rngstep (   mix,
  a,
  b,
  mm,
  m,
  m2,
  r,
 
)
Value:
{ \
(x) = *(m); \
(a) = (mix) + *((m2)++); \
*((m)++) = y = ind(mm,x) + (a) + (b); \
*((r)++) = b = ind(mm,y>>RANDSIZL) + (x); \
}
#define mix(a, b, c, d, e, f, g, h)
Definition: ISAAC64Random.cpp:25
#define ind(mm, x)
Definition: ISAAC64Random.cpp:16
#define RANDSIZL
Definition: ISAAC64Random.h:24

◆ shuffle

#define shuffle (   a,
  b,
  mm,
  m,
  m2,
  r,
 
)
Value:
{ \
rngstep(~((a) ^ ((a) << 21)), a, b, mm, m, m2, r, x); \
rngstep( (a) ^ ((a) >> 5), a, b, mm, m, m2, r, x); \
rngstep( (a) ^ ((a) << 12), a, b, mm, m, m2, r, x); \
rngstep( (a) ^ ((a) >> 33), a, b, mm, m, m2, r, x); \
}

Function Documentation

◆ isaac64Init()

void isaac64Init ( bool  hasSeed,
Rand64Context ctx 
)

◆ isaac64Random()

void isaac64Random ( Rand64Context ctx)

◆ isaac64Seed()

void isaac64Seed ( char *  seed,
Rand64Context ctx 
)

◆ rand64Bytes()

void rand64Bytes ( Rand64Context ctx,
uint8_t *  buf,
int  count 
)

◆ rand64Int()

uint64_t rand64Int ( Rand64Context ctx)