Changed every memcpy to SCA equivalent mbedtls_platform_memcpy
This makes physical attacks more difficult.
diff --git a/library/sha512.c b/library/sha512.c
index 44c087d..648735b 100644
--- a/library/sha512.c
+++ b/library/sha512.c
@@ -326,7 +326,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_sha512_process( ctx, ctx->buffer ) ) != 0 )
return( ret );
@@ -346,7 +346,7 @@
}
if( ilen > 0 )
- memcpy( (void *) (ctx->buffer + left), input, ilen );
+ mbedtls_platform_memcpy( (void *) (ctx->buffer + left), input, ilen );
return( 0 );
}