Skip to content

Commit fa2a929

Browse files
korrancfrantz
authored andcommitted
Fix compiler warning (unused function otbn_write)
Signed-off-by: Kor Nielsen <[email protected]>
1 parent a6e77d2 commit fa2a929

File tree

1 file changed

+0
-25
lines changed
  • sw/device/lib/crypto/drivers

1 file changed

+0
-25
lines changed

sw/device/lib/crypto/drivers/otbn.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -114,31 +114,6 @@ static status_t otbn_assert_idle(void) {
114114
return OTCRYPTO_ASYNC_INCOMPLETE;
115115
}
116116

117-
/**
118-
* Helper function for writing to OTBN's DMEM or IMEM.
119-
*
120-
* @param dest_addr Destination address.
121-
* @param src Source buffer.
122-
* @param num_words Number of words to copy.
123-
*/
124-
static void otbn_write(uint32_t dest_addr, const uint32_t *src,
125-
size_t num_words) {
126-
// TODO: replace 0 with a random index like the silicon_creator driver
127-
// (requires an interface to Ibex's RND valid bit and data register).
128-
size_t i = ((uint64_t)0 * (uint64_t)num_words) >> 32;
129-
enum { kStep = 1 };
130-
size_t iter_cnt = 0;
131-
for (; launder32(iter_cnt) < num_words; ++iter_cnt) {
132-
abs_mmio_write32(dest_addr + i * sizeof(uint32_t), src[i]);
133-
i += kStep;
134-
if (launder32(i) >= num_words) {
135-
i -= num_words;
136-
}
137-
HARDENED_CHECK_LT(i, num_words);
138-
}
139-
HARDENED_CHECK_EQ(iter_cnt, num_words);
140-
}
141-
142117
status_t otbn_dmem_write(size_t num_words, const uint32_t *src,
143118
otbn_addr_t dest) {
144119
HARDENED_TRY(check_offset_len(dest, num_words, kOtbnDMemSizeBytes));

0 commit comments

Comments
 (0)