Skip to content

Commit 7f56631

Browse files
committed
[crypto] Fix condition
The conditon was wrong in two different ways: - Use the address of the data - Check if % returns 0 Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
1 parent 1fefe08 commit 7f56631

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • sw/device/lib/crypto/impl

sw/device/lib/crypto/impl/drbg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ static status_t seed_material_construct(
3838
seed_material->len = nwords;
3939

4040
// Copy seed data.
41-
if (misalignment32_of((uintptr_t)&value->data) == 0 &&
42-
value->len % sizeof(uint32_t)) {
41+
if (misalignment32_of((uintptr_t)value->data) == 0 &&
42+
value->len % sizeof(uint32_t) == 0) {
4343
// The data buffer is word-aligned and the data length is a multiple of the
4444
// word size. We can use the SCA hardened memcpy.
4545
HARDENED_TRY(hardened_memcpy(seed_material->data,

0 commit comments

Comments
 (0)