diff options
Diffstat (limited to 'src/math/bigint/mp_generic/mp_asmi.h')
-rw-r--r-- | src/math/bigint/mp_generic/mp_asmi.h | 78 |
1 files changed, 40 insertions, 38 deletions
diff --git a/src/math/bigint/mp_generic/mp_asmi.h b/src/math/bigint/mp_generic/mp_asmi.h index d15295154..21c4db248 100644 --- a/src/math/bigint/mp_generic/mp_asmi.h +++ b/src/math/bigint/mp_generic/mp_asmi.h @@ -1,8 +1,10 @@ -/************************************************* -* Lowest Level MPI Algorithms Header File * -* (C) 1999-2008 Jack Lloyd * -* 2006 Luca Piccarreta * -*************************************************/ +/* +* Lowest Level MPI Algorithms +* (C) 1999-2008 Jack Lloyd +* 2006 Luca Piccarreta +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_MP_ASM_INTERNAL_H__ #define BOTAN_MP_ASM_INTERNAL_H__ @@ -13,9 +15,9 @@ namespace Botan { extern "C" { -/************************************************* -* Word Addition * -*************************************************/ +/* +* Word Addition +*/ inline word word_add(word x, word y, word* carry) { word z = x + y; @@ -25,9 +27,9 @@ inline word word_add(word x, word y, word* carry) return z; } -/************************************************* -* Eight Word Block Addition, Two Argument * -*************************************************/ +/* +* Eight Word Block Addition, Two Argument +*/ inline word word8_add2(word x[8], const word y[8], word carry) { x[0] = word_add(x[0], y[0], &carry); @@ -41,9 +43,9 @@ inline word word8_add2(word x[8], const word y[8], word carry) return carry; } -/************************************************* -* Eight Word Block Addition, Three Argument * -*************************************************/ +/* +* Eight Word Block Addition, Three Argument +*/ inline word word8_add3(word z[8], const word x[8], const word y[8], word carry) { @@ -58,9 +60,9 @@ inline word word8_add3(word z[8], const word x[8], return carry; } -/************************************************* -* Word Subtraction * -*************************************************/ +/* +* Word Subtraction +*/ inline word word_sub(word x, word y, word* carry) { word t0 = x - y; @@ -70,9 +72,9 @@ inline word word_sub(word x, word y, word* carry) return z; } -/************************************************* -* Eight Word Block Subtraction, Two Argument * -*************************************************/ +/* +* Eight Word Block Subtraction, Two Argument +*/ inline word word8_sub2(word x[4], const word y[4], word carry) { x[0] = word_sub(x[0], y[0], &carry); @@ -86,9 +88,9 @@ inline word word8_sub2(word x[4], const word y[4], word carry) return carry; } -/************************************************* -* Eight Word Block Subtraction, Three Argument * -*************************************************/ +/* +* Eight Word Block Subtraction, Three Argument +*/ inline word word8_sub3(word z[8], const word x[8], const word y[8], word carry) { @@ -103,9 +105,9 @@ inline word word8_sub3(word z[8], const word x[8], return carry; } -/************************************************* -* Eight Word Block Linear Multiplication * -*************************************************/ +/* +* Eight Word Block Linear Multiplication +*/ inline word word8_linmul2(word x[4], word y, word carry) { x[0] = word_madd2(x[0], y, &carry); @@ -119,9 +121,9 @@ inline word word8_linmul2(word x[4], word y, word carry) return carry; } -/************************************************* -* Eight Word Block Linear Multiplication * -*************************************************/ +/* +* Eight Word Block Linear Multiplication +*/ inline word word8_linmul3(word z[8], const word x[8], word y, word carry) { z[0] = word_madd2(x[0], y, &carry); @@ -135,9 +137,9 @@ inline word word8_linmul3(word z[8], const word x[8], word y, word carry) return carry; } -/************************************************* -* Eight Word Block Multiply/Add * -*************************************************/ +/* +* Eight Word Block Multiply/Add +*/ inline word word8_madd3(word z[8], const word x[8], word y, word carry) { z[0] = word_madd3(x[0], y, z[0], &carry); @@ -151,9 +153,9 @@ inline word word8_madd3(word z[8], const word x[8], word y, word carry) return carry; } -/************************************************* -* Multiply-Add Accumulator * -*************************************************/ +/* +* Multiply-Add Accumulator +*/ inline void word3_muladd(word* w2, word* w1, word* w0, word a, word b) { word carry = *w0; @@ -162,9 +164,9 @@ inline void word3_muladd(word* w2, word* w1, word* w0, word a, word b) *w2 += (*w1 < carry) ? 1 : 0; } -/************************************************* -* Multiply-Add Accumulator * -*************************************************/ +/* +* Multiply-Add Accumulator +*/ inline void word3_muladd_2(word* w2, word* w1, word* w0, word a, word b) { word carry = 0; |