30#define TEA_STATE_SIZE (MAX(DT_CACHELINE_BYTES, 2*sizeof(unsigned int)))
40static inline unsigned int*
get_tea_state(
unsigned int*
const states,
int threadnum)
57 const unsigned int key[] = { 0xa341316c, 0xc8013ea4, 0xad90777d, 0x7e95761e };
58 unsigned int v0 = arg[0], v1 = arg[1];
60 unsigned int delta = 0x9e3779b9;
64 v0 += ((v1 << 4) +
key[0]) ^ (v1 + sum) ^ ((v1 >> 5) +
key[1]);
65 v1 += ((v0 << 4) +
key[2]) ^ (v0 + sum) ^ ((v0 >> 5) +
key[3]);
71static inline float tpdf(
unsigned int urandom)
73 float frandom = (float)urandom / (
float)0xFFFFFFFFu;
75 return (frandom < 0.5f ? (sqrtf(2.0f * frandom) - 1.0f) : (1.0f - sqrtf(2.0f * (1.0f - frandom))));
const float i
Definition colorspaces_inline_conversions.h:669
const float delta
Definition colorspaces_inline_conversions.h:722
#define dt_pixelpipe_cache_alloc_align_cache(size, id)
Definition darktable.h:357
#define dt_pixelpipe_cache_free_align(mem)
Definition darktable.h:377
static float tpdf(unsigned int urandom)
Definition tea.h:71
#define TEA_ROUNDS
Definition tea.h:51
static unsigned int * get_tea_state(unsigned int *const states, int threadnum)
Definition tea.h:40
static void free_tea_states(unsigned int *states)
Definition tea.h:45
#define TEA_STATE_SIZE
Definition tea.h:30
static unsigned int * alloc_tea_states(size_t numthreads)
Definition tea.h:31
static void encrypt_tea(unsigned int *arg)
Definition tea.h:55