aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/bigint/big_ops2.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-03-30 18:27:18 +0000
committerlloyd <[email protected]>2009-03-30 18:27:18 +0000
commit96d6eb6f29c55e16a37cf11899547886f735b065 (patch)
tree9f13901e9b44c98d58b2589c9b09c6a7443eb7cd /src/math/bigint/big_ops2.cpp
parent3cc3dd72c5f87b76852a55c1f2d1821dba967d8c (diff)
Thomas Moschny passed along a request from the Fedora packagers which came
up during the Fedora submission review, that each source file include some text about the license. One handy Perl script later and each file now has the line Distributed under the terms of the Botan license after the copyright notices. While I was in there modifying every file anyway, I also stripped out the remainder of the block comments (lots of astericks before and after the text); this is stylistic thing I picked up when I was first learning C++ but in retrospect it is not a good style as the structure makes it harder to modify comments (with the result that comments become fewer, shorter and are less likely to be updated, which are not good things).
Diffstat (limited to 'src/math/bigint/big_ops2.cpp')
-rw-r--r--src/math/bigint/big_ops2.cpp58
1 files changed, 30 insertions, 28 deletions
diff --git a/src/math/bigint/big_ops2.cpp b/src/math/bigint/big_ops2.cpp
index ef083f394..488eca909 100644
--- a/src/math/bigint/big_ops2.cpp
+++ b/src/math/bigint/big_ops2.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* BigInt Assignment Operators Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* BigInt Assignment Operators
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/bigint.h>
#include <botan/mp_core.h>
@@ -10,9 +12,9 @@
namespace Botan {
-/*************************************************
-* Addition Operator *
-*************************************************/
+/*
+* Addition Operator
+*/
BigInt& BigInt::operator+=(const BigInt& y)
{
const u32bit x_sw = sig_words(), y_sw = y.sig_words();
@@ -45,9 +47,9 @@ BigInt& BigInt::operator+=(const BigInt& y)
return (*this);
}
-/*************************************************
-* Subtraction Operator *
-*************************************************/
+/*
+* Subtraction Operator
+*/
BigInt& BigInt::operator-=(const BigInt& y)
{
const u32bit x_sw = sig_words(), y_sw = y.sig_words();
@@ -91,9 +93,9 @@ BigInt& BigInt::operator-=(const BigInt& y)
return (*this);
}
-/*************************************************
-* Multiplication Operator *
-*************************************************/
+/*
+* Multiplication Operator
+*/
BigInt& BigInt::operator*=(const BigInt& y)
{
const u32bit x_sw = sig_words(), y_sw = y.sig_words();
@@ -129,9 +131,9 @@ BigInt& BigInt::operator*=(const BigInt& y)
return (*this);
}
-/*************************************************
-* Division Operator *
-*************************************************/
+/*
+* Division Operator
+*/
BigInt& BigInt::operator/=(const BigInt& y)
{
if(y.sig_words() == 1 && power_of_2(y.word_at(0)))
@@ -141,17 +143,17 @@ BigInt& BigInt::operator/=(const BigInt& y)
return (*this);
}
-/*************************************************
-* Modulo Operator *
-*************************************************/
+/*
+* Modulo Operator
+*/
BigInt& BigInt::operator%=(const BigInt& mod)
{
return (*this = (*this) % mod);
}
-/*************************************************
-* Modulo Operator *
-*************************************************/
+/*
+* Modulo Operator
+*/
word BigInt::operator%=(word mod)
{
if(mod == 0)
@@ -182,9 +184,9 @@ word BigInt::operator%=(word mod)
return word_at(0);
}
-/*************************************************
-* Left Shift Operator *
-*************************************************/
+/*
+* Left Shift Operator
+*/
BigInt& BigInt::operator<<=(u32bit shift)
{
if(shift)
@@ -200,9 +202,9 @@ BigInt& BigInt::operator<<=(u32bit shift)
return (*this);
}
-/*************************************************
-* Right Shift Operator *
-*************************************************/
+/*
+* Right Shift Operator
+*/
BigInt& BigInt::operator>>=(u32bit shift)
{
if(shift)