Lines 1101-1106
class Montgomery_Exponentiator : public Modular_Exponentiator
Link Here
|
1101 |
|
1101 |
|
1102 |
#if (BOTAN_MP_WORD_BITS != 32) |
1102 |
#if (BOTAN_MP_WORD_BITS != 32) |
1103 |
#error The mp_x86_32 module requires that BOTAN_MP_WORD_BITS == 32 |
1103 |
#error The mp_x86_32 module requires that BOTAN_MP_WORD_BITS == 32 |
|
|
1104 |
#elif !defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) |
1105 |
typedef Botan::u64bit dword; |
1104 |
#endif |
1106 |
#endif |
1105 |
|
1107 |
|
1106 |
#ifdef Q_OS_UNIX |
1108 |
#ifdef Q_OS_UNIX |
Lines 1118-1123
extern "C" {
Link Here
|
1118 |
*/ |
1120 |
*/ |
1119 |
inline word word_madd2(word a, word b, word* c) |
1121 |
inline word word_madd2(word a, word b, word* c) |
1120 |
{ |
1122 |
{ |
|
|
1123 |
#if defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) |
1121 |
asm( |
1124 |
asm( |
1122 |
ASM("mull %[b]") |
1125 |
ASM("mull %[b]") |
1123 |
ASM("addl %[c],%[a]") |
1126 |
ASM("addl %[c],%[a]") |
Lines 1127-1132
inline word word_madd2(word a, word b, word* c)
Link Here
|
1127 |
: "0"(a), "1"(b), [c]"g"(*c) : "cc"); |
1130 |
: "0"(a), "1"(b), [c]"g"(*c) : "cc"); |
1128 |
|
1131 |
|
1129 |
return a; |
1132 |
return a; |
|
|
1133 |
#else |
1134 |
dword z = (dword)a * b + *c; |
1135 |
*c = (word)(z >> BOTAN_MP_WORD_BITS); |
1136 |
return (word)z; |
1137 |
#endif |
1130 |
} |
1138 |
} |
1131 |
|
1139 |
|
1132 |
/* |
1140 |
/* |
Lines 1134-1139
inline word word_madd2(word a, word b, word* c)
Link Here
|
1134 |
*/ |
1142 |
*/ |
1135 |
inline word word_madd3(word a, word b, word c, word* d) |
1143 |
inline word word_madd3(word a, word b, word c, word* d) |
1136 |
{ |
1144 |
{ |
|
|
1145 |
#if defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) |
1137 |
asm( |
1146 |
asm( |
1138 |
ASM("mull %[b]") |
1147 |
ASM("mull %[b]") |
1139 |
|
1148 |
|
Lines 1147-1152
inline word word_madd3(word a, word b, word c, word* d)
Link Here
|
1147 |
: "0"(a), "1"(b), [c]"g"(c), [d]"g"(*d) : "cc"); |
1156 |
: "0"(a), "1"(b), [c]"g"(c), [d]"g"(*d) : "cc"); |
1148 |
|
1157 |
|
1149 |
return a; |
1158 |
return a; |
|
|
1159 |
#else |
1160 |
dword z = (dword)a * b + c + *d; |
1161 |
*d = (word)(z >> BOTAN_MP_WORD_BITS); |
1162 |
return (word)z; |
1163 |
#endif |
1150 |
} |
1164 |
} |
1151 |
|
1165 |
|
1152 |
} |
1166 |
} |
Lines 2315-2321
namespace Botan {
Link Here
|
2315 |
|
2329 |
|
2316 |
extern "C" { |
2330 |
extern "C" { |
2317 |
|
2331 |
|
2318 |
#ifdef Q_OS_UNIX |
2332 |
#if defined(Q_OS_UNIX) && defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) |
2319 |
/* |
2333 |
/* |
2320 |
* Helper Macros for x86 Assembly |
2334 |
* Helper Macros for x86 Assembly |
2321 |
*/ |
2335 |
*/ |