Changed every memcpy to SCA equivalent mbedtls_platform_memcpy
This makes physical attacks more difficult.
diff --git a/library/poly1305.c b/library/poly1305.c
index 6fd9044..514bfee 100644
--- a/library/poly1305.c
+++ b/library/poly1305.c
@@ -346,7 +346,7 @@
/* Not enough data to complete the block.
* Store this data with the other leftovers.
*/
- memcpy( &ctx->queue[ctx->queue_len],
+ mbedtls_platform_memcpy( &ctx->queue[ctx->queue_len],
input,
ilen );
@@ -357,7 +357,7 @@
else
{
/* Enough data to produce a complete block */
- memcpy( &ctx->queue[ctx->queue_len],
+ mbedtls_platform_memcpy( &ctx->queue[ctx->queue_len],
input,
queue_free_len );
@@ -384,7 +384,7 @@
{
/* Store partial block */
ctx->queue_len = remaining;
- memcpy( ctx->queue, &input[offset], remaining );
+ mbedtls_platform_memcpy( ctx->queue, &input[offset], remaining );
}
return( 0 );