Browse Source

use zeromem in stream-cipher done() functions

Steffen Jaeckel 6 years ago
parent
commit
a68b703e22

+ 1 - 1
src/stream/chacha/chacha_done.c

@@ -19,7 +19,7 @@
 int chacha_done(chacha_state *st)
 int chacha_done(chacha_state *st)
 {
 {
    LTC_ARGCHK(st != NULL);
    LTC_ARGCHK(st != NULL);
-   XMEMSET(st, 0, sizeof(chacha_state));
+   zeromem(st, sizeof(chacha_state));
    return CRYPT_OK;
    return CRYPT_OK;
 }
 }
 
 

+ 1 - 1
src/stream/rc4/rc4_stream.c

@@ -100,7 +100,7 @@ int rc4_stream_keystream(rc4_state *st, unsigned char *out, unsigned long outlen
 int rc4_stream_done(rc4_state *st)
 int rc4_stream_done(rc4_state *st)
 {
 {
    LTC_ARGCHK(st != NULL);
    LTC_ARGCHK(st != NULL);
-   XMEMSET(st, 0, sizeof(rc4_state));
+   zeromem(st, sizeof(rc4_state));
    return CRYPT_OK;
    return CRYPT_OK;
 }
 }
 
 

+ 1 - 1
src/stream/salsa20/salsa20_done.c

@@ -19,7 +19,7 @@
 int salsa20_done(salsa20_state *st)
 int salsa20_done(salsa20_state *st)
 {
 {
    LTC_ARGCHK(st != NULL);
    LTC_ARGCHK(st != NULL);
-   XMEMSET(st, 0, sizeof(salsa20_state));
+   zeromem(st, sizeof(salsa20_state));
    return CRYPT_OK;
    return CRYPT_OK;
 }
 }
 
 

+ 1 - 1
src/stream/sober128/sober128_stream.c

@@ -332,7 +332,7 @@ int sober128_stream_keystream(sober128_state *st, unsigned char *out, unsigned l
 int sober128_stream_done(sober128_state *st)
 int sober128_stream_done(sober128_state *st)
 {
 {
    LTC_ARGCHK(st != NULL);
    LTC_ARGCHK(st != NULL);
-   XMEMSET(st, 0, sizeof(sober128_state));
+   zeromem(st, sizeof(sober128_state));
    return CRYPT_OK;
    return CRYPT_OK;
 }
 }
 
 

+ 1 - 1
src/stream/sosemanuk/sosemanuk.c

@@ -805,7 +805,7 @@ int sosemanuk_keystream(sosemanuk_state *st, unsigned char *out, unsigned long o
 int sosemanuk_done(sosemanuk_state *st)
 int sosemanuk_done(sosemanuk_state *st)
 {
 {
    LTC_ARGCHK(st != NULL);
    LTC_ARGCHK(st != NULL);
-   XMEMSET(st, 0, sizeof(sosemanuk_state));
+   zeromem(st, sizeof(sosemanuk_state));
    return CRYPT_OK;
    return CRYPT_OK;
 }
 }