aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-02-24 22:02:27 +0000
committerlloyd <[email protected]>2010-02-24 22:02:27 +0000
commitfd46772a8d1f666f4b0833b9510cc2faf4c7960a (patch)
treefe707fb6fe239621049287da79f33fe025192b20 /src
parent694e221bab3dd325425318ca01c929907883ec56 (diff)
De-mutable PointGFp
Diffstat (limited to 'src')
-rw-r--r--src/math/gfpmath/gfp_element.cpp2
-rw-r--r--src/math/gfpmath/gfp_element.h2
-rw-r--r--src/math/gfpmath/point_gfp.cpp4
-rw-r--r--src/math/gfpmath/point_gfp.h10
4 files changed, 9 insertions, 9 deletions
diff --git a/src/math/gfpmath/gfp_element.cpp b/src/math/gfpmath/gfp_element.cpp
index d49ca4989..fbc2021e9 100644
--- a/src/math/gfpmath/gfp_element.cpp
+++ b/src/math/gfpmath/gfp_element.cpp
@@ -77,7 +77,7 @@ GFpElement& GFpElement::operator/=(const GFpElement& rhs)
return *this;
}
-bool GFpElement::is_zero()
+bool GFpElement::is_zero() const
{
return (m_value.is_zero());
// this is correct because x_bar = x * r = x = 0 for x = 0
diff --git a/src/math/gfpmath/gfp_element.h b/src/math/gfpmath/gfp_element.h
index a13de0568..ee436d671 100644
--- a/src/math/gfpmath/gfp_element.h
+++ b/src/math/gfpmath/gfp_element.h
@@ -93,7 +93,7 @@ class BOTAN_DLL GFpElement
* a backtransformation to the ordinary-residue)
* @result true, if the value is zero, false otherwise.
*/
- bool is_zero();
+ bool is_zero() const;
/**
* return prime number of GF(p)
diff --git a/src/math/gfpmath/point_gfp.cpp b/src/math/gfpmath/point_gfp.cpp
index f3fd3e588..f4626cd4e 100644
--- a/src/math/gfpmath/point_gfp.cpp
+++ b/src/math/gfpmath/point_gfp.cpp
@@ -223,7 +223,7 @@ PointGFp& PointGFp::mult2_in_place()
* Z has value one, i.e. x and y correspond to
* their values in affine coordinates
*/
-PointGFp PointGFp::get_z_to_one() const
+PointGFp PointGFp::get_z_to_one()
{
return PointGFp(*this).set_z_to_one();
}
@@ -234,7 +234,7 @@ PointGFp PointGFp::get_z_to_one() const
* their values in affine coordinates.
* returns *this.
*/
-const PointGFp& PointGFp::set_z_to_one() const
+const PointGFp& PointGFp::set_z_to_one()
{
if(!(mZ.get_value() == BigInt(1)) && !(mZ.get_value() == BigInt(0)))
{
diff --git a/src/math/gfpmath/point_gfp.h b/src/math/gfpmath/point_gfp.h
index ea73b9e0d..04a6cc3af 100644
--- a/src/math/gfpmath/point_gfp.h
+++ b/src/math/gfpmath/point_gfp.h
@@ -111,7 +111,7 @@ class BOTAN_DLL PointGFp
* Set z coordinate to one.
* @return *this
*/
- const PointGFp& set_z_to_one() const;
+ const PointGFp& set_z_to_one();
/**
* Return a point
@@ -120,7 +120,7 @@ class BOTAN_DLL PointGFp
* thus x and y have just the affine values.
* @result *this
*/
- PointGFp get_z_to_one() const;
+ PointGFp get_z_to_one();
/**
* Return base curve of this point
@@ -186,9 +186,9 @@ class BOTAN_DLL PointGFp
bool operator==(const PointGFp& other) const;
private:
CurveGFp mC;
- mutable GFpElement mX; // NOTE: these values must be mutable (affine<->proj)
- mutable GFpElement mY;
- mutable GFpElement mZ;
+ GFpElement mX;
+ GFpElement mY;
+ GFpElement mZ;
};
// relational operators