aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/ec_gfp/point_gfp.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-05-25 22:52:00 +0000
committerlloyd <[email protected]>2012-05-25 22:52:00 +0000
commit12090a7148d9ee73572cc1a7268fc489504a8173 (patch)
tree51e50ce0852c56231e9e6dc13f168b10edd45d01 /src/math/ec_gfp/point_gfp.cpp
parent9594979caf775dc4062850044715b804d1fda60c (diff)
parent65cc04445f8d40497f02a14bd8cb97081790e54b (diff)
propagate from branch 'net.randombit.botan.x509-path-validation' (head 63b5a20eab129ca13287fda33d2d02eec329708f)
to branch 'net.randombit.botan' (head 8b8150f09c55184f028f2929c4e7f7cd0d46d96e)
Diffstat (limited to 'src/math/ec_gfp/point_gfp.cpp')
-rw-r--r--src/math/ec_gfp/point_gfp.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/math/ec_gfp/point_gfp.cpp b/src/math/ec_gfp/point_gfp.cpp
index 7ac6b4141..599b6e842 100644
--- a/src/math/ec_gfp/point_gfp.cpp
+++ b/src/math/ec_gfp/point_gfp.cpp
@@ -45,7 +45,7 @@ void PointGFp::monty_mult(BigInt& z, const BigInt& x, const BigInt& y) const
const size_t p_size = curve.get_p_words();
const word p_dash = curve.get_p_dash();
- SecureVector<word>& z_reg = z.get_reg();
+ secure_vector<word>& z_reg = z.get_reg();
z_reg.resize(2*p_size+1);
zeroise(z_reg);
@@ -71,7 +71,7 @@ void PointGFp::monty_sqr(BigInt& z, const BigInt& x) const
const size_t p_size = curve.get_p_words();
const word p_dash = curve.get_p_dash();
- SecureVector<word>& z_reg = z.get_reg();
+ secure_vector<word>& z_reg = z.get_reg();
z_reg.resize(2*p_size+1);
zeroise(z_reg);
@@ -479,22 +479,22 @@ bool PointGFp::operator==(const PointGFp& other) const
}
// encoding and decoding
-SecureVector<byte> EC2OSP(const PointGFp& point, byte format)
+secure_vector<byte> EC2OSP(const PointGFp& point, byte format)
{
if(point.is_zero())
- return SecureVector<byte>(1); // single 0 byte
+ return secure_vector<byte>(1); // single 0 byte
const size_t p_bytes = point.get_curve().get_p().bytes();
BigInt x = point.get_affine_x();
BigInt y = point.get_affine_y();
- SecureVector<byte> bX = BigInt::encode_1363(x, p_bytes);
- SecureVector<byte> bY = BigInt::encode_1363(y, p_bytes);
+ secure_vector<byte> bX = BigInt::encode_1363(x, p_bytes);
+ secure_vector<byte> bY = BigInt::encode_1363(y, p_bytes);
if(format == PointGFp::UNCOMPRESSED)
{
- SecureVector<byte> result;
+ secure_vector<byte> result;
result.push_back(0x04);
result += bX;
@@ -504,7 +504,7 @@ SecureVector<byte> EC2OSP(const PointGFp& point, byte format)
}
else if(format == PointGFp::COMPRESSED)
{
- SecureVector<byte> result;
+ secure_vector<byte> result;
result.push_back(0x02 | static_cast<byte>(y.get_bit(0)));
result += bX;
@@ -513,7 +513,7 @@ SecureVector<byte> EC2OSP(const PointGFp& point, byte format)
}
else if(format == PointGFp::HYBRID)
{
- SecureVector<byte> result;
+ secure_vector<byte> result;
result.push_back(0x06 | static_cast<byte>(y.get_bit(0)));
result += bX;
@@ -591,7 +591,7 @@ PointGFp OS2ECP(const byte data[], size_t data_len,
throw Illegal_Point("OS2ECP: Decoding error in hybrid format");
}
else
- throw Invalid_Argument("OS2ECP: Unknown format type");
+ throw Invalid_Argument("OS2ECP: Unknown format type " + std::to_string(pc));
PointGFp result(curve, x, y);