monotone

monotone Mtn Source Tree

Root/botan/mp_mulop.cpp

1/*************************************************
2* Multiply/Add Algorithm Source File *
3* (C) 1999-2006 The Botan Project *
4*************************************************/
5
6#include <botan/mp_asm.h>
7#include <botan/mp_asmi.h>
8#include <botan/mp_core.h>
9
10namespace Botan {
11
12extern "C" {
13
14/*************************************************
15* Multiply/Add Words *
16*************************************************/
17word bigint_mul_add_words(word z[], const word x[], u32bit x_size, word y)
18 {
19 const u32bit blocks = x_size - (x_size % 8);
20
21 word carry = 0;
22
23 for(u32bit j = 0; j != blocks; j += 8)
24 carry = word8_madd3(z + j, x + j, y, carry);
25
26 for(u32bit j = blocks; j != x_size; ++j)
27 z[j] = word_madd3(x[j], y, z[j], carry, &carry);
28
29 return carry;
30 }
31
32}
33
34}

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status