aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/gfpmath
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/gfpmath')
-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
3 files changed, 25 insertions, 23 deletions
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);