aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2020-03-25 13:28:59 -0400
committerPaul Selkirk <paul@psgd.org>2020-03-25 13:28:59 -0400
commit6f8ac4f72ef2fb003038293a62e47edf6c962b36 (patch)
tree23e2641f483f7e99957bf57ee8b5f43b4576dc28
parentf012c32f742d95aae3fd4065234e1ddfbb1495c4 (diff)
Reduce keywrap to 16 core blocks, to match how it's actually built now.
-rw-r--r--aes_keywrap.c2
-rw-r--r--core.c2
-rw-r--r--verilog_constants.h4
3 files changed, 4 insertions, 4 deletions
diff --git a/aes_keywrap.c b/aes_keywrap.c
index d43a96f..3a5ce2e 100644
--- a/aes_keywrap.c
+++ b/aes_keywrap.c
@@ -198,7 +198,7 @@ static hal_error_t do_keywrap_core(const hal_core_t *core, uint8_t * const C, co
if ((err = hal_io_read(core, KEYWRAP_ADDR_A0, C, 8)) != HAL_OK)
return err;
- /* read the data to R_DATA */
+ /* read the data from R_DATA */
if ((err = hal_io_read(core, KEYWRAP_ADDR_R_DATA, C + 8, 8 * n)) != HAL_OK)
return err;
diff --git a/core.c b/core.c
index 7e49d25..5d3b017 100644
--- a/core.c
+++ b/core.c
@@ -104,7 +104,7 @@ static inline hal_core_t *probe_cores(void)
{ "modexps6", 3 * CORE_SIZE }, /* ModexpS6 uses four slots */
{ "modexpa7", 7 * CORE_SIZE }, /* ModexpA7 uses eight slots */
{ "modexpng", 15 * CORE_SIZE }, /* ModexpNG uses 16 slots */
- { "key wrap", 31 * CORE_SIZE }, /* keywrap uses 32 slots */
+ { "key wrap", 15 * CORE_SIZE }, /* keywrap uses 16 slots */
};
if (offsetof(hal_core_t, info) != 0)
diff --git a/verilog_constants.h b/verilog_constants.h
index db75294..9ed84d4 100644
--- a/verilog_constants.h
+++ b/verilog_constants.h
@@ -364,8 +364,8 @@
#define KEYWRAP_ADDR_KEY6 (0x16)
#define KEYWRAP_ADDR_KEY7 (0x17)
-#define KEYWRAP_ADDR_R_DATA (0x1000)
-#define KEYWRAP_LEN_R_DATA (0x1000)
+#define KEYWRAP_ADDR_R_DATA (0x800)
+#define KEYWRAP_LEN_R_DATA (0x800)
#endif /* _VERILOG_CONSTANTS_H_ */