diff options
Diffstat (limited to 'src/lib/math')
-rw-r--r-- | src/lib/math/bigint/big_io.cpp | 2 | ||||
-rw-r--r-- | src/lib/math/bigint/bigint.h | 7 | ||||
-rw-r--r-- | src/lib/math/numbertheory/numthry.cpp | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/math/bigint/big_io.cpp b/src/lib/math/bigint/big_io.cpp index 803e1cc4a..90c2253e9 100644 --- a/src/lib/math/bigint/big_io.cpp +++ b/src/lib/math/bigint/big_io.cpp @@ -20,7 +20,7 @@ std::ostream& operator<<(std::ostream& stream, const BigInt& n) if(stream.flags() & std::ios::hex) base = BigInt::Hexadecimal; else if(stream.flags() & std::ios::oct) - throw Exception("Octal output of BigInt not supported"); + throw Invalid_Argument("Octal output of BigInt not supported"); if(n == 0) stream.write("0", 1); diff --git a/src/lib/math/bigint/bigint.h b/src/lib/math/bigint/bigint.h index bd63425fd..64e408798 100644 --- a/src/lib/math/bigint/bigint.h +++ b/src/lib/math/bigint/bigint.h @@ -37,11 +37,14 @@ class BOTAN_PUBLIC_API(2,0) BigInt final /** * DivideByZero Exception + * + * In a future release this exception will be removed and its usage + * replaced by Invalid_Argument */ - class BOTAN_PUBLIC_API(2,0) DivideByZero final : public Exception + class BOTAN_PUBLIC_API(2,0) DivideByZero final : public Invalid_Argument { public: - DivideByZero() : Exception("BigInt divide by zero") {} + DivideByZero() : Invalid_Argument("BigInt divide by zero") {} }; /** diff --git a/src/lib/math/numbertheory/numthry.cpp b/src/lib/math/numbertheory/numthry.cpp index bb86f5ce0..a8dfe8eaf 100644 --- a/src/lib/math/numbertheory/numthry.cpp +++ b/src/lib/math/numbertheory/numthry.cpp @@ -351,7 +351,7 @@ BigInt inverse_euclid(const BigInt& n, const BigInt& mod) word monty_inverse(word input) { if(input == 0) - throw Exception("monty_inverse: divide by zero"); + throw Invalid_Argument("monty_inverse: divide by zero"); word b = input; word x2 = 1, x1 = 0, y2 = 0, y1 = 1; |