aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/curve25519
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-01-23 17:47:31 +0000
committerlloyd <[email protected]>2015-01-23 17:47:31 +0000
commit848314e16daed06e6e519dbf8c40edf9c85a51bf (patch)
treea7d246972486ae5f49090689090af7d351110ec6 /src/lib/pubkey/curve25519
parentb6cc9a4084caf6d9d4b955fadc321f6521f2b36e (diff)
Centralize where string.h/cstring is included to mem_ops.h
See github 42 for background
Diffstat (limited to 'src/lib/pubkey/curve25519')
-rw-r--r--src/lib/pubkey/curve25519/donna.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/pubkey/curve25519/donna.cpp b/src/lib/pubkey/curve25519/donna.cpp
index 8a29e0db9..83d68ff6b 100644
--- a/src/lib/pubkey/curve25519/donna.cpp
+++ b/src/lib/pubkey/curve25519/donna.cpp
@@ -31,7 +31,6 @@
#include <botan/mul128.h>
#include <botan/internal/donna128.h>
#include <botan/loadstor.h>
-#include <string.h>
namespace Botan {
@@ -288,16 +287,16 @@ fmonty(limb *x2, limb *z2, /* output 2Q */
limb origx[5], origxprime[5], zzz[5], xx[5], zz[5], xxprime[5],
zzprime[5], zzzprime[5];
- memcpy(origx, x, 5 * sizeof(limb));
+ copy_mem(origx, x, 5);
fsum(x, z);
fdifference_backwards(z, origx); // does x - z
- memcpy(origxprime, xprime, sizeof(limb) * 5);
+ copy_mem(origxprime, xprime, 5);
fsum(xprime, zprime);
fdifference_backwards(zprime, origxprime);
fmul(xxprime, xprime, z);
fmul(zzprime, x, zprime);
- memcpy(origxprime, xxprime, sizeof(limb) * 5);
+ copy_mem(origxprime, xxprime, 5);
fsum(xxprime, zzprime);
fdifference_backwards(zzprime, origxprime);
fsquare_times(x3, xxprime, 1);
@@ -347,7 +346,7 @@ cmult(limb *resultx, limb *resultz, const u8 *n, const limb *q) {
unsigned i, j;
- memcpy(nqpqx, q, sizeof(limb) * 5);
+ copy_mem(nqpqx, q, 5);
for (i = 0; i < 32; ++i) {
u8 byte = n[31 - i];
@@ -381,8 +380,8 @@ cmult(limb *resultx, limb *resultz, const u8 *n, const limb *q) {
}
}
- memcpy(resultx, nqx, sizeof(limb) * 5);
- memcpy(resultz, nqz, sizeof(limb) * 5);
+ copy_mem(resultx, nqx, 5);
+ copy_mem(resultz, nqz, 5);
}