diff options
author | lloyd <[email protected]> | 2010-10-18 23:30:32 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-18 23:30:32 +0000 |
commit | c715624c6b71327fbeb336654666899300a484cb (patch) | |
tree | c300fc3d241014faf8f449a0d5467ff5a1faf9f1 /src/math/bigint | |
parent | de943fee887bf594583753fe0c42e44527278bb1 (diff) |
BigInt::get_substring really shouldn't return size_t. Revert to
u32bit. Maybe should be word? But that would restrict window sizes
more than might be desirable (we couldn't use more than 8 bit window
on the assumption that the lib might be using byte limbs). Messy.
Diffstat (limited to 'src/math/bigint')
-rw-r--r-- | src/math/bigint/bigint.cpp | 4 | ||||
-rw-r--r-- | src/math/bigint/bigint.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/math/bigint/bigint.cpp b/src/math/bigint/bigint.cpp index 6fa929b6d..6ee5a75e3 100644 --- a/src/math/bigint/bigint.cpp +++ b/src/math/bigint/bigint.cpp @@ -165,7 +165,7 @@ bool BigInt::get_bit(size_t n) const /* * Return bits {offset...offset+length} */ -size_t BigInt::get_substring(size_t offset, size_t length) const +u32bit BigInt::get_substring(size_t offset, size_t length) const { if(length > 32) throw Invalid_Argument("BigInt::get_substring: Substring size too big"); @@ -177,7 +177,7 @@ size_t BigInt::get_substring(size_t offset, size_t length) const u64bit mask = (1 << length) - 1; size_t shift = (offset % 8); - return static_cast<size_t>((piece >> shift) & mask); + return static_cast<u32bit>((piece >> shift) & mask); } /* diff --git a/src/math/bigint/bigint.h b/src/math/bigint/bigint.h index 0fd9b05cb..9a2513d1b 100644 --- a/src/math/bigint/bigint.h +++ b/src/math/bigint/bigint.h @@ -215,7 +215,7 @@ class BOTAN_DLL BigInt * @result the integer extracted from the register starting at * offset with specified length */ - size_t get_substring(size_t offset, size_t length) const; + u32bit get_substring(size_t offset, size_t length) const; /** * @param n the offset to get a byte from |