aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/bigint
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/bigint')
-rw-r--r--src/math/bigint/bigint.cpp4
-rw-r--r--src/math/bigint/bigint.h2
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