Changed every memcpy to SCA equivalent mbedtls_platform_memcpy
This makes physical attacks more difficult.
diff --git a/library/md5.c b/library/md5.c
index 762923d..8af78a1 100644
--- a/library/md5.c
+++ b/library/md5.c
@@ -277,7 +277,7 @@
if( left && ilen >= fill )
{
- memcpy( (void *) (ctx->buffer + left), input, fill );
+ mbedtls_platform_memcpy( (void *) (ctx->buffer + left), input, fill );
if( ( ret = mbedtls_internal_md5_process( ctx, ctx->buffer ) ) != 0 )
return( ret );
@@ -297,7 +297,7 @@
if( ilen > 0 )
{
- memcpy( (void *) (ctx->buffer + left), input, ilen );
+ mbedtls_platform_memcpy( (void *) (ctx->buffer + left), input, ilen );
}
return( 0 );