aboutsummaryrefslogtreecommitdiffstats
path: root/src/math
diff options
context:
space:
mode:
Diffstat (limited to 'src/math')
-rw-r--r--src/math/numbertheory/def_powm.h4
-rw-r--r--src/math/numbertheory/point_gfp.h7
-rw-r--r--src/math/numbertheory/pow_mod.h8
-rw-r--r--src/math/numbertheory/reducer.h9
4 files changed, 21 insertions, 7 deletions
diff --git a/src/math/numbertheory/def_powm.h b/src/math/numbertheory/def_powm.h
index 5b8a5a591..ce128b965 100644
--- a/src/math/numbertheory/def_powm.h
+++ b/src/math/numbertheory/def_powm.h
@@ -14,7 +14,7 @@
namespace Botan {
-/*
+/**
* Fixed Window Exponentiator
*/
class Fixed_Window_Exponentiator : public Modular_Exponentiator
@@ -36,7 +36,7 @@ class Fixed_Window_Exponentiator : public Modular_Exponentiator
Power_Mod::Usage_Hints hints;
};
-/*
+/**
* Montgomery Exponentiator
*/
class Montgomery_Exponentiator : public Modular_Exponentiator
diff --git a/src/math/numbertheory/point_gfp.h b/src/math/numbertheory/point_gfp.h
index 0708493fe..5b3e32c7d 100644
--- a/src/math/numbertheory/point_gfp.h
+++ b/src/math/numbertheory/point_gfp.h
@@ -15,6 +15,10 @@
namespace Botan {
+/**
+* Exception thrown if you try to convert a zero point to an affine
+* coordinate
+*/
struct BOTAN_DLL Illegal_Transformation : public Exception
{
Illegal_Transformation(const std::string& err =
@@ -22,6 +26,9 @@ struct BOTAN_DLL Illegal_Transformation : public Exception
Exception(err) {}
};
+/**
+* Exception thrown if some form of illegal point is decoded
+*/
struct BOTAN_DLL Illegal_Point : public Exception
{
Illegal_Point(const std::string& err = "Malformed ECP point detected") :
diff --git a/src/math/numbertheory/pow_mod.h b/src/math/numbertheory/pow_mod.h
index 7b92f0ec4..1a60ca05f 100644
--- a/src/math/numbertheory/pow_mod.h
+++ b/src/math/numbertheory/pow_mod.h
@@ -12,7 +12,7 @@
namespace Botan {
-/*
+/**
* Modular Exponentiator Interface
*/
class BOTAN_DLL Modular_Exponentiator
@@ -25,7 +25,7 @@ class BOTAN_DLL Modular_Exponentiator
virtual ~Modular_Exponentiator() {}
};
-/*
+/**
* Modular Exponentiator Proxy
*/
class BOTAN_DLL Power_Mod
@@ -67,7 +67,7 @@ class BOTAN_DLL Power_Mod
Usage_Hints hints;
};
-/*
+/**
* Fixed Exponent Modular Exponentiator Proxy
*/
class BOTAN_DLL Fixed_Exponent_Power_Mod : public Power_Mod
@@ -81,7 +81,7 @@ class BOTAN_DLL Fixed_Exponent_Power_Mod : public Power_Mod
Usage_Hints = NO_HINTS);
};
-/*
+/**
* Fixed Base Modular Exponentiator Proxy
*/
class BOTAN_DLL Fixed_Base_Power_Mod : public Power_Mod
diff --git a/src/math/numbertheory/reducer.h b/src/math/numbertheory/reducer.h
index c121f1499..861983ef0 100644
--- a/src/math/numbertheory/reducer.h
+++ b/src/math/numbertheory/reducer.h
@@ -12,7 +12,7 @@
namespace Botan {
-/*
+/**
* Modular Reducer
*/
class BOTAN_DLL Modular_Reducer
@@ -24,18 +24,25 @@ class BOTAN_DLL Modular_Reducer
/**
* Multiply mod p
+ * @param x
+ * @param y
+ * @return (x * y) % p
*/
BigInt multiply(const BigInt& x, const BigInt& y) const
{ return reduce(x * y); }
/**
* Square mod p
+ * @param x
+ * @return (x * x) % p
*/
BigInt square(const BigInt& x) const
{ return reduce(Botan::square(x)); }
/**
* Cube mod p
+ * @param x
+ * @return (x * x * x) % p
*/
BigInt cube(const BigInt& x) const
{ return multiply(x, this->square(x)); }