aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2013-07-30 19:20:29 +0000
committerlloyd <[email protected]>2013-07-30 19:20:29 +0000
commit7818291494c0dbc159c9dc8bd301ba9c6139156a (patch)
tree5ee1b9f0ce3e09b7d9cd6da5a27678e43ba2aafa /src
parent0abddf092a646168b0cb5648b940e7baf6188bf4 (diff)
Revert accidental delete
Diffstat (limited to 'src')
-rw-r--r--src/math/mp/mp_asm.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/math/mp/mp_asm.cpp b/src/math/mp/mp_asm.cpp
index 7f98b47cb..a3caba620 100644
--- a/src/math/mp/mp_asm.cpp
+++ b/src/math/mp/mp_asm.cpp
@@ -7,6 +7,10 @@
*/
#include <botan/internal/mp_core.h>
+#include <botan/internal/mp_asmi.h>
+#include <botan/internal/mp_core.h>
+#include <botan/exceptn.h>
+#include <botan/mem_ops.h>
namespace Botan {
@@ -17,6 +21,20 @@ extern "C" {
*/
word bigint_add2_nc(word x[], size_t x_size, const word y[], size_t y_size)
{
+ word carry = 0;
+
+ const size_t blocks = y_size - (y_size % 8);
+
+ for(size_t i = 0; i != blocks; i += 8)
+ carry = word8_add2(x + i, y + i, carry);
+
+ for(size_t i = blocks; i != y_size; ++i)
+ x[i] = word_add(x[i], y[i], &carry);
+
+ for(size_t i = y_size; i != x_size; ++i)
+ x[i] = word_add(x[i], 0, &carry);
+
+ return carry;
}
/*