summaryrefslogtreecommitdiff
path: root/donna_32.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-12-12 09:48:41 -0500
committerJeffrey Walton <noloader@gmail.com>2018-12-12 09:48:41 -0500
commit0ad50c61ed80718edb2a1bd77129c27aa8d90508 (patch)
tree4eaf9267852e5158a826219f1b74d1f9b591f1ba /donna_32.cpp
parentd481922a507be2a6352f2b2f3c5c64ebf887d421 (diff)
downloadcryptopp-git-0ad50c61ed80718edb2a1bd77129c27aa8d90508.tar.gz
Switch to library integer types
The standard ints will cause trouble on older versions of Visual Studio. It looks like they were missed at the initial cut-in.
Diffstat (limited to 'donna_32.cpp')
-rw-r--r--donna_32.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/donna_32.cpp b/donna_32.cpp
index 04412e34..e290f41f 100644
--- a/donna_32.cpp
+++ b/donna_32.cpp
@@ -315,15 +315,15 @@ void freduce_degree(limb *output)
inline limb div_by_2_26(const limb v)
{
/* High word of v; no shift needed. */
- const uint32_t highword = (uint32_t) (((uint64_t) v) >> 32);
+ const word32 highword = (word32) (((word64) v) >> 32);
// Modified for SunCC. See comments for SignExtexnd function.
/* Set to all 1s if v was negative; else set to 0s. */
- /* const int32_t sign = ((int32_t) highword) >> 31; */
- const int32_t sign = SignExtend(highword);
+ /* const sword32 sign = ((sword32) highword) >> 31; */
+ const sword32 sign = SignExtend(highword);
/* Set to 0x3ffffff if v was negative; else set to 0. */
- const int32_t roundoff = ((uint32_t) sign) >> 6;
+ const sword32 roundoff = ((word32) sign) >> 6;
/* Should return v / (1<<26) */
return (v + roundoff) >> 26;
}
@@ -334,15 +334,15 @@ inline limb div_by_2_26(const limb v)
inline limb div_by_2_25(const limb v)
{
/* High word of v; no shift needed*/
- const uint32_t highword = (uint32_t) (((uint64_t) v) >> 32);
+ const word32 highword = (word32) (((word64) v) >> 32);
// Modified for SunCC. See comments for SignExtexnd function.
/* Set to all 1s if v was negative; else set to 0s. */
- /* const int32_t sign = ((int32_t) highword) >> 31; */
- const int32_t sign = SignExtend(highword);
+ /* const sword32 sign = ((sword32) highword) >> 31; */
+ const sword32 sign = SignExtend(highword);
/* Set to 0x1ffffff if v was negative; else set to 0. */
- const int32_t roundoff = ((uint32_t) sign) >> 7;
+ const sword32 roundoff = ((word32) sign) >> 7;
/* Should return v / (1<<25) */
return (v + roundoff) >> 25;
}