@@ -918,6 +918,18 @@ int mbedtls_internal_aes_encrypt( mbedtls_aes_context *ctx,
918
918
PUT_UINT32_LE ( X2 , output , 8 );
919
919
PUT_UINT32_LE ( X3 , output , 12 );
920
920
921
+ mbedtls_platform_zeroize ( & X0 , sizeof ( X0 ) );
922
+ mbedtls_platform_zeroize ( & X1 , sizeof ( X1 ) );
923
+ mbedtls_platform_zeroize ( & X2 , sizeof ( X2 ) );
924
+ mbedtls_platform_zeroize ( & X3 , sizeof ( X3 ) );
925
+
926
+ mbedtls_platform_zeroize ( & Y0 , sizeof ( Y0 ) );
927
+ mbedtls_platform_zeroize ( & Y1 , sizeof ( Y1 ) );
928
+ mbedtls_platform_zeroize ( & Y2 , sizeof ( Y2 ) );
929
+ mbedtls_platform_zeroize ( & Y3 , sizeof ( Y3 ) );
930
+
931
+ mbedtls_platform_zeroize ( & RK , sizeof ( RK ) );
932
+
921
933
return ( 0 );
922
934
}
923
935
#endif /* !MBEDTLS_AES_ENCRYPT_ALT */
@@ -986,6 +998,18 @@ int mbedtls_internal_aes_decrypt( mbedtls_aes_context *ctx,
986
998
PUT_UINT32_LE ( X2 , output , 8 );
987
999
PUT_UINT32_LE ( X3 , output , 12 );
988
1000
1001
+ mbedtls_platform_zeroize ( & X0 , sizeof ( X0 ) );
1002
+ mbedtls_platform_zeroize ( & X1 , sizeof ( X1 ) );
1003
+ mbedtls_platform_zeroize ( & X2 , sizeof ( X2 ) );
1004
+ mbedtls_platform_zeroize ( & X3 , sizeof ( X3 ) );
1005
+
1006
+ mbedtls_platform_zeroize ( & Y0 , sizeof ( Y0 ) );
1007
+ mbedtls_platform_zeroize ( & Y1 , sizeof ( Y1 ) );
1008
+ mbedtls_platform_zeroize ( & Y2 , sizeof ( Y2 ) );
1009
+ mbedtls_platform_zeroize ( & Y3 , sizeof ( Y3 ) );
1010
+
1011
+ mbedtls_platform_zeroize ( & RK , sizeof ( RK ) );
1012
+
989
1013
return ( 0 );
990
1014
}
991
1015
#endif /* !MBEDTLS_AES_DECRYPT_ALT */
0 commit comments