diff options
| author | erdgeist <de@gsmk.de> | 2014-10-07 00:01:30 +0200 |
|---|---|---|
| committer | erdgeist <de@gsmk.de> | 2014-10-07 00:01:30 +0200 |
| commit | 9816750420eb6ab2527cd8abd31c2b1a13f74437 (patch) | |
| tree | 73bf0b2a633c566ad3df634f8474640605234134 | |
| parent | 954f5029dfa17734dc408336ef710c192268e8a4 (diff) | |
Initialise all values of aes key
| -rw-r--r-- | ot_udp.c | 9 |
1 files changed, 6 insertions, 3 deletions
| @@ -26,9 +26,12 @@ static uint32_t g_key_of_the_hour[2] = {0}; | |||
| 26 | static ot_time g_hour_of_the_key; | 26 | static ot_time g_hour_of_the_key; |
| 27 | 27 | ||
| 28 | static void udp_generate_rijndael_round_key() { | 28 | static void udp_generate_rijndael_round_key() { |
| 29 | uint8_t key[16]; | 29 | uint32_t key[16]; |
| 30 | key[0] = random(); key[1] = random(); key[2] = random(); key[3] = random(); | 30 | key[0] = random(); |
| 31 | rijndaelKeySetupEnc128( g_rijndael_round_key, key ); | 31 | key[1] = random(); |
| 32 | key[2] = random(); | ||
| 33 | key[3] = random(); | ||
| 34 | rijndaelKeySetupEnc128( g_rijndael_round_key, (uint8_t*)key ); | ||
| 32 | 35 | ||
| 33 | g_key_of_the_hour[0] = random(); | 36 | g_key_of_the_hour[0] = random(); |
| 34 | g_hour_of_the_key = g_now_minutes; | 37 | g_hour_of_the_key = g_now_minutes; |
