1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-24 23:38:09 +00:00

fixup! storage: Change secequal32() to use length in bytes instead of length in words.

This commit is contained in:
Andrew Kozlik 2019-12-02 14:29:04 +01:00
parent 89a3ec1696
commit d0d3ad2912

View File

@ -188,6 +188,9 @@ static secbool secequal(const void *ptr1, const void *ptr2, size_t n) {
static secbool secequal32(const void *ptr1, const void *ptr2, size_t n) { static secbool secequal32(const void *ptr1, const void *ptr2, size_t n) {
assert(n % sizeof(uint32_t) == 0); assert(n % sizeof(uint32_t) == 0);
assert((uintptr_t)ptr1 % sizeof(uint32_t) == 0);
assert((uintptr_t)ptr2 % sizeof(uint32_t) == 0);
size_t wn = n / sizeof(uint32_t); size_t wn = n / sizeof(uint32_t);
const uint32_t *p1 = (const uint32_t *)ptr1; const uint32_t *p1 = (const uint32_t *)ptr1;
const uint32_t *p2 = (const uint32_t *)ptr2; const uint32_t *p2 = (const uint32_t *)ptr2;