summaryrefslogtreecommitdiff
path: root/src/add_threshold/cipher.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/add_threshold/cipher.c')
-rw-r--r--src/add_threshold/cipher.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/add_threshold/cipher.c b/src/add_threshold/cipher.c
index 87267fc..230582d 100644
--- a/src/add_threshold/cipher.c
+++ b/src/add_threshold/cipher.c
@@ -25,6 +25,7 @@ where the input block is split into three shares.
#include "cipher.h"
#include "constants.h"
+#include "random.h"
#include "tweakey.h"
@@ -90,13 +91,10 @@ static void _state_init(
const uint8_t message[BLOCK_BYTES]
)
{
- // To be replaced by real random numbers!!!
- uint8_t SHARES_0[BLOCK_BYTES] = {
- 0x0f, 0x1e, 0x2d, 0x3c, 0x4b, 0x5a, 0x69, 0x78, 0x87, 0x96, 0xa5, 0xb4, 0xc3, 0xd2, 0xe1, 0xf0
- };
- uint8_t SHARES_1[BLOCK_BYTES] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
- };
+ uint8_t SHARES_0[BLOCK_BYTES];
+ uint8_t SHARES_1[BLOCK_BYTES];
+ randombytes(sizeof(SHARES_0), SHARES_0);
+ randombytes(sizeof(SHARES_1), SHARES_1);
memcpy(X, SHARES_0, BLOCK_BYTES);
memcpy(Y, SHARES_1, BLOCK_BYTES);