Introduce polarssl_zeroize() instead of memset() for zeroization
diff --git a/library/aes.c b/library/aes.c
index c03cbbe..38e5e95 100644
--- a/library/aes.c
+++ b/library/aes.c
@@ -53,6 +53,11 @@
 
 #if !defined(POLARSSL_AES_ALT)
 
+/* Implementation that should never be optimized out by the compiler */
+static void polarssl_zeroize( void *v, size_t n ) {
+    volatile unsigned char *p = v; while( n-- ) *p++ = 0;
+}
+
 /*
  * 32-bit integer manipulation macros (little endian)
  */
@@ -633,7 +638,7 @@
 #if defined(POLARSSL_AESNI_C) && defined(POLARSSL_HAVE_X86_64)
 done:
 #endif
-    memset( &cty, 0, sizeof( aes_context ) );
+    polarssl_zeroize( &cty, sizeof( aes_context ) );
 
     return( 0 );
 }