diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-03-12 15:33:15 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-03-12 17:36:12 +0100 |
| commit | f24a5cdcf0eec552f2d2edc73a7df156784ed7c0 (patch) | |
| tree | 4a4959fd2824f3f02a3debe90c804d2a7e76028a /src/add_threshold/cipher.c | |
| parent | f1bf4826bb5307a2677d44af6f8079b6cf0b3224 (diff) | |
| download | lilliput-ae-implem-f24a5cdcf0eec552f2d2edc73a7df156784ed7c0.tar.xz | |
Utilisation d'un générateur d'aléa pour l'implémentation à seuil
Un peu de machinerie à mettre en place pour permettre l'ajout de
fichiers arbitraires dans une implémentation.
Diffstat (limited to 'src/add_threshold/cipher.c')
| -rw-r--r-- | src/add_threshold/cipher.c | 12 |
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); |
