diff --git a/deps/mbedtls/blowfish.c b/deps/mbedtls/blowfish.c index 9003f0dfeb..5f97f77122 100644 --- a/deps/mbedtls/blowfish.c +++ b/deps/mbedtls/blowfish.c @@ -39,10 +39,7 @@ #if !defined(MBEDTLS_BLOWFISH_ALT) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * 32-bit integer manipulation macros (big endian) diff --git a/deps/mbedtls/camellia.c b/deps/mbedtls/camellia.c index ac6f96a83a..b66c61ae9c 100644 --- a/deps/mbedtls/camellia.c +++ b/deps/mbedtls/camellia.c @@ -48,10 +48,7 @@ #if !defined(MBEDTLS_CAMELLIA_ALT) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * 32-bit integer manipulation macros (big endian) diff --git a/deps/mbedtls/ccm.c b/deps/mbedtls/ccm.c index 13a8fd1a24..0174097dad 100644 --- a/deps/mbedtls/ccm.c +++ b/deps/mbedtls/ccm.c @@ -49,10 +49,7 @@ #endif /* MBEDTLS_PLATFORM_C */ #endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */ -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" #define CCM_ENCRYPT 0 #define CCM_DECRYPT 1 diff --git a/deps/mbedtls/cipher.c b/deps/mbedtls/cipher.c index e9e0b223e5..b5503a0279 100644 --- a/deps/mbedtls/cipher.c +++ b/deps/mbedtls/cipher.c @@ -60,10 +60,7 @@ #define MBEDTLS_CIPHER_MODE_STREAM #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" static int supported_init = 0; diff --git a/deps/mbedtls/cmac.c b/deps/mbedtls/cmac.c index 035ad071d4..0f0c772636 100644 --- a/deps/mbedtls/cmac.c +++ b/deps/mbedtls/cmac.c @@ -65,10 +65,7 @@ #endif /* MBEDTLS_SELF_TEST */ #endif /* MBEDTLS_PLATFORM_C */ -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * Multiplication by u in the Galois field of GF(2^n) diff --git a/deps/mbedtls/ctr_drbg.c b/deps/mbedtls/ctr_drbg.c index 55612c7fc9..44ddeb313a 100644 --- a/deps/mbedtls/ctr_drbg.c +++ b/deps/mbedtls/ctr_drbg.c @@ -49,10 +49,7 @@ #endif /* MBEDTLS_PLATFORM_C */ #endif /* MBEDTLS_SELF_TEST */ -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * CTR_DRBG context initialization diff --git a/deps/mbedtls/des.c b/deps/mbedtls/des.c index 09f95cfc3b..1c50f24cd9 100644 --- a/deps/mbedtls/des.c +++ b/deps/mbedtls/des.c @@ -48,10 +48,7 @@ #if !defined(MBEDTLS_DES_ALT) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * 32-bit integer manipulation macros (big endian) diff --git a/deps/mbedtls/dhm.c b/deps/mbedtls/dhm.c index bec52a11df..c82926c713 100644 --- a/deps/mbedtls/dhm.c +++ b/deps/mbedtls/dhm.c @@ -57,10 +57,7 @@ #define mbedtls_free free #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * helper to validate the mbedtls_mpi size and import it diff --git a/deps/mbedtls/ecp.c b/deps/mbedtls/ecp.c index 5ad6863987..92df13da57 100644 --- a/deps/mbedtls/ecp.c +++ b/deps/mbedtls/ecp.c @@ -72,10 +72,7 @@ #define inline __inline #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" #if defined(MBEDTLS_SELF_TEST) /* diff --git a/deps/mbedtls/entropy.c b/deps/mbedtls/entropy.c index d4d1b27b7f..75e2ea7389 100644 --- a/deps/mbedtls/entropy.c +++ b/deps/mbedtls/entropy.c @@ -59,10 +59,7 @@ #include "mbedtls/havege.h" #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" #define ENTROPY_MAX_LOOP 256 /**< Maximum amount to loop before error */ diff --git a/deps/mbedtls/gcm.c b/deps/mbedtls/gcm.c index fccb092bdd..2f9a628ec2 100644 --- a/deps/mbedtls/gcm.c +++ b/deps/mbedtls/gcm.c @@ -77,10 +77,7 @@ } #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * Initialize a context diff --git a/deps/mbedtls/havege.c b/deps/mbedtls/havege.c index 2b75ef7bd8..8109ae8ad8 100644 --- a/deps/mbedtls/havege.c +++ b/deps/mbedtls/havege.c @@ -39,10 +39,7 @@ #include -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* ------------------------------------------------------------------------ * On average, one iteration accesses two 8-word blocks in the havege WALK diff --git a/deps/mbedtls/hmac_drbg.c b/deps/mbedtls/hmac_drbg.c index bf5f9b5bd3..c3ed532697 100644 --- a/deps/mbedtls/hmac_drbg.c +++ b/deps/mbedtls/hmac_drbg.c @@ -50,10 +50,7 @@ #endif /* MBEDTLS_SELF_TEST */ #endif /* MBEDTLS_PLATFORM_C */ -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * HMAC_DRBG context initialization diff --git a/deps/mbedtls/md.c b/deps/mbedtls/md.c index eda98f6361..4584310d81 100644 --- a/deps/mbedtls/md.c +++ b/deps/mbedtls/md.c @@ -48,10 +48,7 @@ #include #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * Reminder: update profiles in x509_crt.c when adding a new hash! diff --git a/deps/mbedtls/md2.c b/deps/mbedtls/md2.c index 95cbcce658..647fce97b3 100644 --- a/deps/mbedtls/md2.c +++ b/deps/mbedtls/md2.c @@ -48,10 +48,7 @@ #if !defined(MBEDTLS_MD2_ALT) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" static const unsigned char PI_SUBST[256] = { diff --git a/deps/mbedtls/md4.c b/deps/mbedtls/md4.c index 11a77e3ae4..f436191cb1 100644 --- a/deps/mbedtls/md4.c +++ b/deps/mbedtls/md4.c @@ -48,10 +48,7 @@ #if !defined(MBEDTLS_MD4_ALT) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * 32-bit integer manipulation macros (little endian) diff --git a/deps/mbedtls/md5.c b/deps/mbedtls/md5.c index 5d972dc9dd..40b70a95d2 100644 --- a/deps/mbedtls/md5.c +++ b/deps/mbedtls/md5.c @@ -47,10 +47,7 @@ #if !defined(MBEDTLS_MD5_ALT) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * 32-bit integer manipulation macros (little endian) diff --git a/deps/mbedtls/memory_buffer_alloc.c b/deps/mbedtls/memory_buffer_alloc.c index 545d5a2c32..6fb45375eb 100644 --- a/deps/mbedtls/memory_buffer_alloc.c +++ b/deps/mbedtls/memory_buffer_alloc.c @@ -42,10 +42,7 @@ #include "mbedtls/threading.h" #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" #define MAGIC1 0xFF00AA55 #define MAGIC2 0xEE119966 diff --git a/deps/mbedtls/pem.c b/deps/mbedtls/pem.c index 8dd86a4ac9..37e857e92c 100644 --- a/deps/mbedtls/pem.c +++ b/deps/mbedtls/pem.c @@ -45,10 +45,7 @@ #endif #if defined(MBEDTLS_PEM_PARSE_C) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" void mbedtls_pem_init( mbedtls_pem_context *ctx ) { diff --git a/deps/mbedtls/pk.c b/deps/mbedtls/pk.c index 8d13bc5ce3..a6e71bfb12 100644 --- a/deps/mbedtls/pk.c +++ b/deps/mbedtls/pk.c @@ -43,10 +43,7 @@ #include -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * Initialise a mbedtls_pk_context diff --git a/deps/mbedtls/pk_wrap.c b/deps/mbedtls/pk_wrap.c index db6274cbf9..382bbb46d8 100644 --- a/deps/mbedtls/pk_wrap.c +++ b/deps/mbedtls/pk_wrap.c @@ -53,10 +53,7 @@ #include #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" #endif #if defined(MBEDTLS_RSA_C) diff --git a/deps/mbedtls/pkcs12.c b/deps/mbedtls/pkcs12.c index c603a13577..048ff2e3af 100644 --- a/deps/mbedtls/pkcs12.c +++ b/deps/mbedtls/pkcs12.c @@ -47,10 +47,7 @@ #include "mbedtls/des.h" #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" static int pkcs12_parse_pbe_params( mbedtls_asn1_buf *params, mbedtls_asn1_buf *salt, int *iterations ) diff --git a/deps/mbedtls/pkparse.c b/deps/mbedtls/pkparse.c index efdf437466..3dee28999d 100644 --- a/deps/mbedtls/pkparse.c +++ b/deps/mbedtls/pkparse.c @@ -61,10 +61,7 @@ #endif #if defined(MBEDTLS_FS_IO) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * Load all data from a file into a given buffer. diff --git a/deps/mbedtls/ripemd160.c b/deps/mbedtls/ripemd160.c index cdb0a63c0f..975c8ac7a5 100644 --- a/deps/mbedtls/ripemd160.c +++ b/deps/mbedtls/ripemd160.c @@ -69,10 +69,7 @@ } #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" void mbedtls_ripemd160_init( mbedtls_ripemd160_context *ctx ) { diff --git a/deps/mbedtls/rsa.c b/deps/mbedtls/rsa.c index bdd2538c3a..eb5e6b8341 100644 --- a/deps/mbedtls/rsa.c +++ b/deps/mbedtls/rsa.c @@ -66,10 +66,7 @@ #define mbedtls_free free #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * Initialize an RSA context diff --git a/deps/mbedtls/sha1.c b/deps/mbedtls/sha1.c index 2ccf2a2f52..b02192984f 100644 --- a/deps/mbedtls/sha1.c +++ b/deps/mbedtls/sha1.c @@ -47,10 +47,7 @@ #if !defined(MBEDTLS_SHA1_ALT) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * 32-bit integer manipulation macros (big endian) diff --git a/deps/mbedtls/sha256.c b/deps/mbedtls/sha256.c index ad25d38333..c3782b371e 100644 --- a/deps/mbedtls/sha256.c +++ b/deps/mbedtls/sha256.c @@ -50,10 +50,7 @@ #if !defined(MBEDTLS_SHA256_ALT) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * 32-bit integer manipulation macros (big endian) diff --git a/deps/mbedtls/sha512.c b/deps/mbedtls/sha512.c index 724522ac68..d4abca369e 100644 --- a/deps/mbedtls/sha512.c +++ b/deps/mbedtls/sha512.c @@ -56,10 +56,7 @@ #if !defined(MBEDTLS_SHA512_ALT) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * 64-bit integer manipulation macros (big endian) diff --git a/deps/mbedtls/ssl_cli.c b/deps/mbedtls/ssl_cli.c index b73e416458..08de5b7365 100644 --- a/deps/mbedtls/ssl_cli.c +++ b/deps/mbedtls/ssl_cli.c @@ -48,10 +48,7 @@ #endif #if defined(MBEDTLS_SSL_SESSION_TICKETS) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" #endif #if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) diff --git a/deps/mbedtls/ssl_cookie.c b/deps/mbedtls/ssl_cookie.c index caf119990d..f2c112e74d 100644 --- a/deps/mbedtls/ssl_cookie.c +++ b/deps/mbedtls/ssl_cookie.c @@ -43,10 +43,7 @@ #include -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * If DTLS is in use, then at least one of SHA-1, SHA-256, SHA-512 is diff --git a/deps/mbedtls/ssl_srv.c b/deps/mbedtls/ssl_srv.c index be961af710..c18b19a6fe 100644 --- a/deps/mbedtls/ssl_srv.c +++ b/deps/mbedtls/ssl_srv.c @@ -50,10 +50,7 @@ #endif #if defined(MBEDTLS_SSL_SESSION_TICKETS) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" #endif #if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) diff --git a/deps/mbedtls/ssl_ticket.c b/deps/mbedtls/ssl_ticket.c index 4d9116d214..5c77c1c359 100644 --- a/deps/mbedtls/ssl_ticket.c +++ b/deps/mbedtls/ssl_ticket.c @@ -39,10 +39,7 @@ #include -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * Initialze context diff --git a/deps/mbedtls/ssl_tls.c b/deps/mbedtls/ssl_tls.c index 661ae7065b..e417d1915a 100644 --- a/deps/mbedtls/ssl_tls.c +++ b/deps/mbedtls/ssl_tls.c @@ -53,10 +53,7 @@ #include "mbedtls/oid.h" #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* Length of the "epoch" field in the record header */ static inline size_t ssl_ep_len( const mbedtls_ssl_context *ssl ) diff --git a/deps/mbedtls/x509_crl.c b/deps/mbedtls/x509_crl.c index 76c49f1353..c6e57974ab 100644 --- a/deps/mbedtls/x509_crl.c +++ b/deps/mbedtls/x509_crl.c @@ -66,10 +66,7 @@ #include #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * Version ::= INTEGER { v1(0), v2(1) } diff --git a/deps/mbedtls/x509_crt.c b/deps/mbedtls/x509_crt.c index a2305beb2e..3961c8489c 100644 --- a/deps/mbedtls/x509_crt.c +++ b/deps/mbedtls/x509_crt.c @@ -75,10 +75,7 @@ #endif /* !_WIN32 || EFIX64 || EFI32 */ #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * Default profile diff --git a/deps/mbedtls/x509_csr.c b/deps/mbedtls/x509_csr.c index f92b66c58f..b9b8b7a518 100644 --- a/deps/mbedtls/x509_csr.c +++ b/deps/mbedtls/x509_csr.c @@ -60,10 +60,7 @@ #include #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * Version ::= INTEGER { v1(0) } diff --git a/deps/mbedtls/x509write_crt.c b/deps/mbedtls/x509write_crt.c index d1d9a22a7e..a1b7b62d9e 100644 --- a/deps/mbedtls/x509write_crt.c +++ b/deps/mbedtls/x509write_crt.c @@ -44,10 +44,7 @@ #include "mbedtls/pem.h" #endif /* MBEDTLS_PEM_WRITE_C */ -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" void mbedtls_x509write_crt_init( mbedtls_x509write_cert *ctx ) { diff --git a/deps/mbedtls/x509write_csr.c b/deps/mbedtls/x509write_csr.c index 8fd856b2a2..33b3ea78a7 100644 --- a/deps/mbedtls/x509write_csr.c +++ b/deps/mbedtls/x509write_csr.c @@ -43,10 +43,7 @@ #include "mbedtls/pem.h" #endif -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" void mbedtls_x509write_csr_init( mbedtls_x509write_csr *ctx ) { diff --git a/deps/mbedtls/xtea.c b/deps/mbedtls/xtea.c index fe0a3509f6..fb2d6dce23 100644 --- a/deps/mbedtls/xtea.c +++ b/deps/mbedtls/xtea.c @@ -42,10 +42,7 @@ #if !defined(MBEDTLS_XTEA_ALT) -/* Implementation that should never be optimized out by the compiler */ -static void mbedtls_zeroize( void *v, size_t n ) { - volatile unsigned char *p = v; while( n-- ) *p++ = 0; -} +#include "arc4_alt.h" /* * 32-bit integer manipulation macros (big endian)