aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/numbertheory/reducer.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/numbertheory/reducer.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/numbertheory/reducer.cpp')
-rw-r--r--src/math/numbertheory/reducer.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/math/numbertheory/reducer.cpp b/src/math/numbertheory/reducer.cpp
index 47c5c20fc..fbd675ea6 100644
--- a/src/math/numbertheory/reducer.cpp
+++ b/src/math/numbertheory/reducer.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* Modular Reducer Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* Modular Reducer
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/reducer.h>
#include <botan/numthry.h>
@@ -9,9 +11,9 @@
namespace Botan {
-/*************************************************
-* Modular_Reducer Constructor *
-*************************************************/
+/*
+* Modular_Reducer Constructor
+*/
Modular_Reducer::Modular_Reducer(const BigInt& mod)
{
if(mod <= 0)
@@ -27,9 +29,9 @@ Modular_Reducer::Modular_Reducer(const BigInt& mod)
mu_words = mu.sig_words();
}
-/*************************************************
-* Barrett Reduction *
-*************************************************/
+/*
+* Barrett Reduction
+*/
BigInt Modular_Reducer::reduce(const BigInt& x) const
{
if(mod_words == 0)
@@ -76,17 +78,17 @@ BigInt Modular_Reducer::reduce(const BigInt& x) const
return t1;
}
-/*************************************************
-* Multiply, followed by a reduction *
-*************************************************/
+/*
+* Multiply, followed by a reduction
+*/
BigInt Modular_Reducer::multiply(const BigInt& x, const BigInt& y) const
{
return reduce(x * y);
}
-/*************************************************
-* Square, followed by a reduction *
-*************************************************/
+/*
+* Square, followed by a reduction
+*/
BigInt Modular_Reducer::square(const BigInt& x) const
{
return reduce(Botan::square(x));