diff options
author | lloyd <[email protected]> | 2010-10-13 16:06:11 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-13 16:06:11 +0000 |
commit | 18d3acffbe2324a90c505cf23ff17c1392c3be4d (patch) | |
tree | 5a7f99e16dbf7cc59015bc94220174075755289a /src/engine/gnump | |
parent | 12617c8a0942a5af35ffe72891f3cd63c8b7fe18 (diff) |
More size_t
Diffstat (limited to 'src/engine/gnump')
-rw-r--r-- | src/engine/gnump/gmp_mem.cpp | 2 | ||||
-rw-r--r-- | src/engine/gnump/gmp_wrap.cpp | 6 | ||||
-rw-r--r-- | src/engine/gnump/gmp_wrap.h | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/engine/gnump/gmp_mem.cpp b/src/engine/gnump/gmp_mem.cpp index f3650e716..7cf11654d 100644 --- a/src/engine/gnump/gmp_mem.cpp +++ b/src/engine/gnump/gmp_mem.cpp @@ -17,7 +17,7 @@ namespace { * Allocator used by GNU MP */ Allocator* gmp_alloc = 0; -u32bit gmp_alloc_refcnt = 0; +size_t gmp_alloc_refcnt = 0; /* * Allocation Function for GNU MP diff --git a/src/engine/gnump/gmp_wrap.cpp b/src/engine/gnump/gmp_wrap.cpp index 39d107a78..107823ab3 100644 --- a/src/engine/gnump/gmp_wrap.cpp +++ b/src/engine/gnump/gmp_wrap.cpp @@ -32,7 +32,7 @@ GMP_MPZ::GMP_MPZ(const BigInt& in) /* * GMP_MPZ Constructor */ -GMP_MPZ::GMP_MPZ(const byte in[], u32bit length) +GMP_MPZ::GMP_MPZ(const byte in[], size_t length) { mpz_init(value); mpz_import(value, length, 1, 1, 0, 0, in); @@ -66,7 +66,7 @@ GMP_MPZ& GMP_MPZ::operator=(const GMP_MPZ& other) /* * Export the mpz_t as a bytestring */ -void GMP_MPZ::encode(byte out[], u32bit length) const +void GMP_MPZ::encode(byte out[], size_t length) const { size_t dummy = 0; mpz_export(out + (length - bytes()), &dummy, 1, 1, 0, 0, value); @@ -75,7 +75,7 @@ void GMP_MPZ::encode(byte out[], u32bit length) const /* * Return the number of significant bytes */ -u32bit GMP_MPZ::bytes() const +size_t GMP_MPZ::bytes() const { return ((mpz_sizeinbase(value, 2) + 7) / 8); } diff --git a/src/engine/gnump/gmp_wrap.h b/src/engine/gnump/gmp_wrap.h index 52d130d6b..fc7aa856e 100644 --- a/src/engine/gnump/gmp_wrap.h +++ b/src/engine/gnump/gmp_wrap.h @@ -22,8 +22,8 @@ class GMP_MPZ mpz_t value; BigInt to_bigint() const; - void encode(byte[], u32bit) const; - u32bit bytes() const; + void encode(byte[], size_t) const; + size_t bytes() const; SecureVector<byte> to_bytes() const { return BigInt::encode(to_bigint()); } @@ -32,7 +32,7 @@ class GMP_MPZ GMP_MPZ(const GMP_MPZ&); GMP_MPZ(const BigInt& = 0); - GMP_MPZ(const byte[], u32bit); + GMP_MPZ(const byte[], size_t); ~GMP_MPZ(); }; |