Changed every memcpy to SCA equivalent mbedtls_platform_memcpy
This makes physical attacks more difficult.
diff --git a/library/sha1.c b/library/sha1.c
index 842c11e..4032d11 100644
--- a/library/sha1.c
+++ b/library/sha1.c
@@ -328,7 +328,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_sha1_process( ctx, ctx->buffer ) ) != 0 )
return( ret );
@@ -348,7 +348,7 @@
}
if( ilen > 0 )
- memcpy( (void *) (ctx->buffer + left), input, ilen );
+ mbedtls_platform_memcpy( (void *) (ctx->buffer + left), input, ilen );
return( 0 );
}