diff --git a/src/include/clRNG/philox432.clh b/src/include/clRNG/philox432.clh index 321e252..146512c 100644 --- a/src/include/clRNG/philox432.clh +++ b/src/include/clRNG/philox432.clh @@ -58,6 +58,7 @@ typedef struct clrngPhilox432Counter_ { typedef struct { + cl_uint key[2]; // 64-bit key clrngPhilox432Counter ctr; // 128 bits counter cl_uint deck[4]; // this table hold the 4x32 generated uint from philox4x32(ctr,kry) function cl_uint deckIndex; //the index of actual pregenerated integer to give to the user diff --git a/src/include/clRNG/philox432.h b/src/include/clRNG/philox432.h index fe18130..88f30f9 100644 --- a/src/include/clRNG/philox432.h +++ b/src/include/clRNG/philox432.h @@ -60,6 +60,7 @@ typedef struct clrngPhilox432Counter_ { typedef struct { + cl_uint key[2]; // 64-bit key clrngPhilox432Counter ctr; // 128 bits counter cl_uint deck[4]; // this table hold the 4x32 generated uint from philox4x32(ctr,kry) function cl_uint deckIndex; //the index of actual pregenerated integer to give to the user diff --git a/src/include/clRNG/private/philox432.c.h b/src/include/clRNG/private/philox432.c.h index 57cbcb7..174aa36 100644 --- a/src/include/clRNG/private/philox432.c.h +++ b/src/include/clRNG/private/philox432.c.h @@ -86,7 +86,7 @@ clrngStatus clrngPhilox432CopyOverStreams(size_t count, clrngPhilox432Stream* de void clrngPhilox432GenerateDeck(clrngPhilox432StreamState *currentState) { //Default key - philox4x32_key_t k = { { 0, 0 } }; + philox4x32_key_t k = { { currentState->key[0], currentState->key[1] } }; //get the currect state philox4x32_ctr_t c = { { 0 } }; diff --git a/src/library/philox432.c b/src/library/philox432.c index 2881a13..d475114 100644 --- a/src/library/philox432.c +++ b/src/library/philox432.c @@ -55,6 +55,7 @@ struct clrngPhilox432StreamCreator_ { */ #define BASE_CREATOR_STATE { \ + {0, 0}, \ {{ 0, 0},{ 0, 1}}, \ { 0, 0, 0, 0 }, \ 0 } @@ -147,7 +148,7 @@ clrngStatus clrngPhilox432ChangeStreamsSpacing(clrngPhilox432StreamCreator* crea //Create Base Creator clrngPhilox432StreamCreator* baseCreator = clrngPhilox432CopyStreamCreator(NULL, NULL); - clrngPhilox432StreamState baseState = { { { 0, 0 }, { 0, 0 } }, { 0, 0, 0, 0 }, 0 }; + clrngPhilox432StreamState baseState = { { 0, 0 }, { { 0, 0 }, { 0, 0 } }, { 0, 0, 0, 0 }, 0 }; clrngPhilox432SetBaseCreatorState(baseCreator, &baseState); //Create stream