Skip to content

Commit e9be37d

Browse files
ccli8cmonr
authored andcommitted
Refine crypto_zeroize/crypto_zeroize32
1 parent 4b33c93 commit e9be37d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

targets/TARGET_NUVOTON/TARGET_M480/crypto/crypto-misc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void crypto_uninit(void)
104104
/* Implementation that should never be optimized out by the compiler */
105105
void crypto_zeroize(void *v, size_t n)
106106
{
107-
volatile unsigned char *p = (unsigned char*) v;
107+
volatile unsigned char *p = (volatile unsigned char*) v;
108108
while (n--) {
109109
*p++ = 0;
110110
}
@@ -113,7 +113,7 @@ void crypto_zeroize(void *v, size_t n)
113113
/* Implementation that should never be optimized out by the compiler */
114114
void crypto_zeroize32(uint32_t *v, size_t n)
115115
{
116-
volatile uint32_t *p = (uint32_t*) v;
116+
volatile uint32_t *p = (volatile uint32_t*) v;
117117
while (n--) {
118118
*p++ = 0;
119119
}

targets/TARGET_NUVOTON/TARGET_NUC472/crypto/crypto-misc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void crypto_uninit(void)
100100
/* Implementation that should never be optimized out by the compiler */
101101
void crypto_zeroize(void *v, size_t n)
102102
{
103-
volatile unsigned char *p = (unsigned char*) v;
103+
volatile unsigned char *p = (volatile unsigned char*) v;
104104
while (n--) {
105105
*p++ = 0;
106106
}

0 commit comments

Comments
 (0)