Changed every memcpy to SCA equivalent mbedtls_platform_memcpy
This makes physical attacks more difficult.
diff --git a/library/md2.c b/library/md2.c
index fbec008..8c07da9 100644
--- a/library/md2.c
+++ b/library/md2.c
@@ -180,7 +180,7 @@
else
fill = ilen;
- memcpy( ctx->buffer + ctx->left, input, fill );
+ mbedtls_platform_memcpy( ctx->buffer + ctx->left, input, fill );
ctx->left += fill;
input += fill;
@@ -224,11 +224,11 @@
if( ( ret = mbedtls_internal_md2_process( ctx ) ) != 0 )
return( ret );
- memcpy( ctx->buffer, ctx->cksum, 16 );
+ mbedtls_platform_memcpy( ctx->buffer, ctx->cksum, 16 );
if( ( ret = mbedtls_internal_md2_process( ctx ) ) != 0 )
return( ret );
- memcpy( output, ctx->state, 16 );
+ mbedtls_platform_memcpy( output, ctx->state, 16 );
return( 0 );
}