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

Macros

#define ind(mm, x)   (*(uint32_t *)((ub1 *)(mm) + ((x) & ((RANDSIZ-1)<<2))))
 
#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 isaacSeed (char *seed, RandContext *ctx)
 
void isaacInit (bool hasSeed, RandContext *ctx)
 
void isaacRandom (RandContext *ctx)
 
uint32_t randInt (RandContext *ctx)
 
void randBytes (RandContext *ctx, uchar *buf, int count)
 

Macro Definition Documentation

◆ ind

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

◆ mix

#define mix (   a,
  b,
  c,
  d,
  e,
  f,
  g,
 
)
Value:
{ \
a^=b<<11; d+=a; b+=c; \
b^=c>>2; e+=b; c+=d; \
c^=d<<8; f+=c; d+=e; \
d^=e>>16; g+=d; e+=f; \
e^=f<<10; h+=e; f+=g; \
f^=g>>4; a+=f; g+=h; \
g^=h<<8; b+=g; h+=a; \
h^=a>>9; c+=h; a+=b; \
}

◆ rngstep

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

◆ shuffle

#define shuffle (   a,
  b,
  mm,
  m,
  m2,
  r,
 
)
Value:
{ \
rngstep((a << 13), a, b, mm, m, m2, r, x); \
rngstep((a >> 6), a, b, mm, m, m2, r, x); \
rngstep((a << 2), a, b, mm, m, m2, r, x); \
rngstep((a >> 16), a, b, mm, m, m2, r, x); \
}

Function Documentation

◆ isaacInit()

void isaacInit ( bool  hasSeed,
RandContext ctx 
)

◆ isaacRandom()

void isaacRandom ( RandContext ctx)

◆ isaacSeed()

void isaacSeed ( char *  seed,
RandContext ctx 
)

◆ randBytes()

void randBytes ( RandContext ctx,
uchar buf,
int  count 
)

◆ randInt()

uint32_t randInt ( RandContext ctx)