aboutsummaryrefslogtreecommitdiff
path: root/aes_keywrap.c
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-05-23 09:56:13 -0400
committerRob Austein <sra@hactrn.net>2015-05-23 09:56:13 -0400
commitb932b1976b8c288686accf14e13cd499877408f9 (patch)
tree58a8971dfc4979cbb1ef7bab7e46b0bd1e2cf5f2 /aes_keywrap.c
parentc5f1ddb1b10e69e815a561132a38b4ff23a1310c (diff)
Guess it might help to write the config value to the AES core after
constructing it, doh.
Diffstat (limited to 'aes_keywrap.c')
-rw-r--r--aes_keywrap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/aes_keywrap.c b/aes_keywrap.c
index cc62676..9ded0e1 100644
--- a/aes_keywrap.c
+++ b/aes_keywrap.c
@@ -18,7 +18,6 @@
#include "cryptech.h"
-
/*
* How long the ciphertext will be for a given plaintext length.
*/
@@ -74,8 +73,9 @@ static hal_error_t load_kek(const uint8_t *K, const size_t K_len, const kek_acti
* Load the KEK and tell the core to expand it.
*/
- if ((err = hal_io_write(AES_ADDR_KEY0, K, K_len)) != HAL_OK ||
- (err = hal_io_init(AES_ADDR_CTRL)) != HAL_OK)
+ if ((err = hal_io_write(AES_ADDR_KEY0, K, K_len)) != HAL_OK ||
+ (err = hal_io_write(AES_ADDR_CONFIG, config, sizeof(config))) != HAL_OK ||
+ (err = hal_io_init(AES_ADDR_CTRL)) != HAL_OK)
return err;
return HAL_OK;