diff options
author | Jack Lloyd <[email protected]> | 2016-12-11 15:28:38 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-12-18 16:48:24 -0500 |
commit | f3cb3edb512bdcab498d825886c3366c341b3f78 (patch) | |
tree | 645c73ec295a5a34f25d99903b6d9fa9751e86d3 /src/lib/math/mp | |
parent | c1dd21253c1f3188ff45d3ad47698efd08235ae8 (diff) |
Convert to using standard uintN_t integer types
Renames a couple of functions for somewhat better name consistency,
eg make_u32bit becomes make_uint32. The old typedefs remain for now
since probably lots of application code uses them.
Diffstat (limited to 'src/lib/math/mp')
-rw-r--r-- | src/lib/math/mp/mp_core.cpp | 2 | ||||
-rw-r--r-- | src/lib/math/mp/mp_core.h | 2 | ||||
-rw-r--r-- | src/lib/math/mp/mp_karat.cpp | 6 | ||||
-rw-r--r-- | src/lib/math/mp/mp_madd.h | 6 | ||||
-rw-r--r-- | src/lib/math/mp/mp_types.h | 8 |
5 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/math/mp/mp_core.cpp b/src/lib/math/mp/mp_core.cpp index 2a0b08f67..ff4efd945 100644 --- a/src/lib/math/mp/mp_core.cpp +++ b/src/lib/math/mp/mp_core.cpp @@ -375,7 +375,7 @@ void bigint_shr2(word y[], const word x[], size_t x_size, /* * Compare two MP integers */ -s32bit bigint_cmp(const word x[], size_t x_size, +int32_t bigint_cmp(const word x[], size_t x_size, const word y[], size_t y_size) { if(x_size < y_size) { return (-bigint_cmp(y, y_size, x, x_size)); } diff --git a/src/lib/math/mp/mp_core.h b/src/lib/math/mp/mp_core.h index c4ce005ba..a22d3b6ad 100644 --- a/src/lib/math/mp/mp_core.h +++ b/src/lib/math/mp/mp_core.h @@ -150,7 +150,7 @@ void bigint_monty_sqr(BigInt& z, const BigInt& x, /** * Compare x and y */ -s32bit bigint_cmp(const word x[], size_t x_size, +int32_t bigint_cmp(const word x[], size_t x_size, const word y[], size_t y_size); /** diff --git a/src/lib/math/mp/mp_karat.cpp b/src/lib/math/mp/mp_karat.cpp index 62a52b88c..994100c9b 100644 --- a/src/lib/math/mp/mp_karat.cpp +++ b/src/lib/math/mp/mp_karat.cpp @@ -75,8 +75,8 @@ void karatsuba_mul(word z[], const word x[], const word y[], size_t N, word* z0 = z; word* z1 = z + N; - const s32bit cmp0 = bigint_cmp(x0, N2, x1, N2); - const s32bit cmp1 = bigint_cmp(y1, N2, y0, N2); + const int32_t cmp0 = bigint_cmp(x0, N2, x1, N2); + const int32_t cmp1 = bigint_cmp(y1, N2, y0, N2); clear_mem(workspace, 2*N); @@ -143,7 +143,7 @@ void karatsuba_sqr(word z[], const word x[], size_t N, word workspace[]) word* z0 = z; word* z1 = z + N; - const s32bit cmp = bigint_cmp(x0, N2, x1, N2); + const int32_t cmp = bigint_cmp(x0, N2, x1, N2); clear_mem(workspace, 2*N); diff --git a/src/lib/math/mp/mp_madd.h b/src/lib/math/mp/mp_madd.h index 0567622d9..2fa1d88ce 100644 --- a/src/lib/math/mp/mp_madd.h +++ b/src/lib/math/mp/mp_madd.h @@ -15,13 +15,13 @@ namespace Botan { #if (BOTAN_MP_WORD_BITS == 8) - typedef u16bit dword; + typedef uint16_t dword; #define BOTAN_HAS_MP_DWORD #elif (BOTAN_MP_WORD_BITS == 16) - typedef u32bit dword; + typedef uint32_t dword; #define BOTAN_HAS_MP_DWORD #elif (BOTAN_MP_WORD_BITS == 32) - typedef u64bit dword; + typedef uint64_t dword; #define BOTAN_HAS_MP_DWORD #elif (BOTAN_MP_WORD_BITS == 64) #if defined(BOTAN_TARGET_HAS_NATIVE_UINT128) diff --git a/src/lib/math/mp/mp_types.h b/src/lib/math/mp/mp_types.h index 69dc911fd..0b5c5055e 100644 --- a/src/lib/math/mp/mp_types.h +++ b/src/lib/math/mp/mp_types.h @@ -13,13 +13,13 @@ namespace Botan { #if (BOTAN_MP_WORD_BITS == 8) - typedef byte word; + typedef uint8_t word; #elif (BOTAN_MP_WORD_BITS == 16) - typedef u16bit word; + typedef uint16_t word; #elif (BOTAN_MP_WORD_BITS == 32) - typedef u32bit word; + typedef uint32_t word; #elif (BOTAN_MP_WORD_BITS == 64) - typedef u64bit word; + typedef uint64_t word; #else #error BOTAN_MP_WORD_BITS must be 8, 16, 32, or 64 #endif |