aboutsummaryrefslogtreecommitdiffstats
path: root/src/math
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-10-13 20:05:51 +0000
committerlloyd <[email protected]>2008-10-13 20:05:51 +0000
commit0fe7514e9f8890f01405651e42b037602082f488 (patch)
tree970a35efc995d03b6009526a5fea641b2fe71b35 /src/math
parent99dfd438b2b244f0a8e5035608ea7a6cf6496132 (diff)
Add trailing H__ to some header guards. Line wrap long comment.
Diffstat (limited to 'src/math')
-rw-r--r--src/math/bigint/divide.h4
-rw-r--r--src/math/gfpmath/curve_gfp.h28
-rw-r--r--src/math/gfpmath/gfp_element.h18
-rw-r--r--src/math/gfpmath/point_gfp.h2
4 files changed, 27 insertions, 25 deletions
diff --git a/src/math/bigint/divide.h b/src/math/bigint/divide.h
index d0de3da75..a50cbfb47 100644
--- a/src/math/bigint/divide.h
+++ b/src/math/bigint/divide.h
@@ -3,8 +3,8 @@
* (C) 1999-2007 Jack Lloyd *
*************************************************/
-#ifndef BOTAN_DIVISON_ALGORITHM__
-#define BOTAN_DIVISON_ALGORITHM__
+#ifndef BOTAN_DIVISON_ALGORITHM_H__
+#define BOTAN_DIVISON_ALGORITHM_H__
#include <botan/bigint.h>
diff --git a/src/math/gfpmath/curve_gfp.h b/src/math/gfpmath/curve_gfp.h
index dd785c749..4d8f9e1b8 100644
--- a/src/math/gfpmath/curve_gfp.h
+++ b/src/math/gfpmath/curve_gfp.h
@@ -139,9 +139,11 @@ class BOTAN_DLL CurveGFp
// relational operators
bool operator==(const CurveGFp& lhs, const CurveGFp& rhs);
-inline bool operator!=(const CurveGFp& lhs, const CurveGFp& rhs) {
-return !operator==(lhs, rhs);
-}
+
+inline bool operator!=(const CurveGFp& lhs, const CurveGFp& rhs)
+ {
+ return !(lhs == rhs);
+ }
// io operators
std::ostream& operator<<(std::ostream& output, const CurveGFp& elem);
@@ -149,9 +151,10 @@ std::ostream& operator<<(std::ostream& output, const CurveGFp& elem);
// swaps the states of curve1 and curve2, does not throw!
// cf. Meyers, Item 25
inline
-void swap(CurveGFp& curve1, CurveGFp& curve2) {
-curve1.swap(curve2);
-}
+void swap(CurveGFp& curve1, CurveGFp& curve2)
+ {
+ curve1.swap(curve2);
+ }
} // namespace Botan
@@ -160,13 +163,12 @@ namespace std {
// swaps the states of curve1 and curve2, does not throw!
// cf. Meyers, Item 25
-template<>
-inline
-void swap<Botan::CurveGFp>(
- Botan::CurveGFp& curve1,
- Botan::CurveGFp& curve2) {
-curve1.swap(curve2);
-}
+template<> inline
+void swap<Botan::CurveGFp>(Botan::CurveGFp& curve1,
+ Botan::CurveGFp& curve2)
+ {
+ curve1.swap(curve2);
+ }
} // namespace std
diff --git a/src/math/gfpmath/gfp_element.h b/src/math/gfpmath/gfp_element.h
index ab0e0e5ab..6535d7e3e 100644
--- a/src/math/gfpmath/gfp_element.h
+++ b/src/math/gfpmath/gfp_element.h
@@ -68,19 +68,19 @@ class BOTAN_DLL GFpElement
explicit GFpElement (const BigInt& p, const BigInt& value, bool use_montgm = false);
- /** construct an element of GF(p) with the given value (defaults to 0).
- * use_montg defaults to false and determines wether montgomery multiplications
- * will be use when applying operators '*' , '*='.
- * Use this constructor for efficient use of Montgomery multiplication in a context with a
- * fixed a modulus.
- * Warning: do not use this function unless you know in detail about
- * the implications of using
- * the shared GFpModulus objects!
+ /** construct an element of GF(p) with the given value (defaults
+ * to 0). use_montg defaults to false and determines wether
+ * montgomery multiplications will be use when applying operators
+ * '*' , '*='. Use this constructor for efficient use of
+ * Montgomery multiplication in a context with a fixed a modulus.
+ * Warning: do not use this function unless you know in detail
+ * about the implications of using the shared GFpModulus objects!
* @param mod shared pointer to the GFpModulus to be shared
* @param value the element value
* @param use_montgm whether this object will use Montgomery multiplication
*/
- explicit GFpElement(std::tr1::shared_ptr<GFpModulus> const mod, const BigInt& value, bool use_mongm = false);
+ explicit GFpElement(std::tr1::shared_ptr<GFpModulus> const mod,
+ const BigInt& value, bool use_mongm = false);
/**
* Copy constructor
diff --git a/src/math/gfpmath/point_gfp.h b/src/math/gfpmath/point_gfp.h
index 4ecc3e936..8b00987aa 100644
--- a/src/math/gfpmath/point_gfp.h
+++ b/src/math/gfpmath/point_gfp.h
@@ -275,7 +275,7 @@ PointGFp operator*(const BigInt& scalar, const PointGFp& point);
PointGFp operator*(const PointGFp& point, const BigInt& scalar);
PointGFp mult_point_secure(const PointGFp& point, const BigInt& scalar, const BigInt& point_order, const BigInt& max_secret);
-PointGFp const mult2 (const PointGFp& point);
+PointGFp const mult2(const PointGFp& point);
PointGFp const create_random_point(RandomNumberGenerator& rng,
const CurveGFp& curve);