|
@ -54,7 +54,9 @@ static int transop_deinit_speck(n2n_trans_op_t *arg) { |
|
|
static void set_speck_iv(transop_speck_t *priv, n2n_speck_ivec_t ivec) { |
|
|
static void set_speck_iv(transop_speck_t *priv, n2n_speck_ivec_t ivec) { |
|
|
// keep in mind the following condition: N2N_SPECK_IVEC_SIZE % sizeof(rand_value) == 0 !
|
|
|
// keep in mind the following condition: N2N_SPECK_IVEC_SIZE % sizeof(rand_value) == 0 !
|
|
|
uint32_t rand_value; |
|
|
uint32_t rand_value; |
|
|
for (uint8_t i = 0; i < N2N_SPECK_IVEC_SIZE; i += sizeof(rand_value)) { |
|
|
uint8_t i; |
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < N2N_SPECK_IVEC_SIZE; i += sizeof(rand_value)) { |
|
|
rand_value = rand(); // CONCERN: rand() is not considered cryptographicly secure, REPLACE later
|
|
|
rand_value = rand(); // CONCERN: rand() is not considered cryptographicly secure, REPLACE later
|
|
|
memcpy(ivec + i, &rand_value, sizeof(rand_value)); |
|
|
memcpy(ivec + i, &rand_value, sizeof(rand_value)); |
|
|
} |
|
|
} |
|
|