Botan
1.11.15
|
#include <curve_gfp.h>
Public Member Functions | |
CurveGFp () | |
CurveGFp (const BigInt &p, const BigInt &a, const BigInt &b) | |
CurveGFp (const CurveGFp &) | |
void | from_rep (BigInt &x, secure_vector< word > &ws) const |
BigInt | from_rep (const BigInt &x, secure_vector< word > &ws) const |
const BigInt & | get_a () const |
const BigInt & | get_a_rep () const |
const BigInt & | get_b () const |
const BigInt & | get_b_rep () const |
const BigInt & | get_p () const |
void | mul (BigInt &z, const BigInt &x, const BigInt &y, secure_vector< word > &ws) const |
BigInt | mul (const BigInt &x, const BigInt &y, secure_vector< word > &ws) const |
void | normalize (BigInt &x, secure_vector< word > &ws, size_t bound=0) const |
CurveGFp & | operator= (const CurveGFp &) |
void | sqr (BigInt &z, const BigInt &x, secure_vector< word > &ws) const |
BigInt | sqr (const BigInt &x, secure_vector< word > &ws) const |
void | swap (CurveGFp &other) |
void | to_rep (BigInt &x, secure_vector< word > &ws) const |
This class represents an elliptic curve over GF(p)
Definition at line 57 of file curve_gfp.h.
Botan::CurveGFp::CurveGFp | ( | ) | [inline] |
Botan::CurveGFp::CurveGFp | ( | const BigInt & | p, |
const BigInt & | a, | ||
const BigInt & | b | ||
) | [inline] |
Construct the elliptic curve E: y^2 = x^3 + ax + b over GF(p)
p | prime number of the field |
a | first coefficient |
b | second coefficient |
Definition at line 72 of file curve_gfp.h.
: m_repr(choose_repr(p, a, b)) { }
Botan::CurveGFp::CurveGFp | ( | const CurveGFp & | ) |
void Botan::CurveGFp::from_rep | ( | BigInt & | x, |
secure_vector< word > & | ws | ||
) | const [inline] |
Definition at line 106 of file curve_gfp.h.
Referenced by Botan::PointGFp::get_affine_x(), and Botan::PointGFp::on_the_curve().
{ m_repr->from_curve_rep(x, ws); }
BigInt Botan::CurveGFp::from_rep | ( | const BigInt & | x, |
secure_vector< word > & | ws | ||
) | const [inline] |
Definition at line 111 of file curve_gfp.h.
{ BigInt xt(x); m_repr->from_curve_rep(xt, ws); return xt; }
const BigInt& Botan::CurveGFp::get_a | ( | ) | const [inline] |
Definition at line 84 of file curve_gfp.h.
Referenced by Botan::EC_Group::DER_encode(), and Botan::operator==().
{ return m_repr->get_a(); }
const BigInt& Botan::CurveGFp::get_a_rep | ( | ) | const [inline] |
Definition at line 97 of file curve_gfp.h.
Referenced by Botan::PointGFp::on_the_curve().
{ return m_repr->get_a_rep(); }
const BigInt& Botan::CurveGFp::get_b | ( | ) | const [inline] |
Definition at line 89 of file curve_gfp.h.
Referenced by Botan::EC_Group::DER_encode(), and Botan::operator==().
{ return m_repr->get_b(); }
const BigInt& Botan::CurveGFp::get_b_rep | ( | ) | const [inline] |
Definition at line 99 of file curve_gfp.h.
Referenced by Botan::PointGFp::on_the_curve().
{ return m_repr->get_b_rep(); }
const BigInt& Botan::CurveGFp::get_p | ( | ) | const [inline] |
Get prime modulus of the field of the curve
Definition at line 95 of file curve_gfp.h.
Referenced by Botan::EC_Group::DER_encode(), Botan::EC2OSP(), Botan::PointGFp::get_affine_x(), Botan::PointGFp::get_affine_y(), and Botan::operator==().
{ return m_repr->get_p(); }
void Botan::CurveGFp::mul | ( | BigInt & | z, |
const BigInt & | x, | ||
const BigInt & | y, | ||
secure_vector< word > & | ws | ||
) | const [inline] |
Definition at line 120 of file curve_gfp.h.
BigInt Botan::CurveGFp::mul | ( | const BigInt & | x, |
const BigInt & | y, | ||
secure_vector< word > & | ws | ||
) | const [inline] |
Definition at line 125 of file curve_gfp.h.
void Botan::CurveGFp::normalize | ( | BigInt & | x, |
secure_vector< word > & | ws, | ||
size_t | bound = 0 |
||
) | const [inline] |
Adjust x to be in [0,p)
bound | if greater than zero, assume that no more than bound additions or subtractions are required to move x into range. |
Definition at line 149 of file curve_gfp.h.
{ m_repr->normalize(x, ws, bound); }
void Botan::CurveGFp::sqr | ( | BigInt & | z, |
const BigInt & | x, | ||
secure_vector< word > & | ws | ||
) | const [inline] |
Definition at line 132 of file curve_gfp.h.
{ m_repr->curve_sqr(z, x, ws); }
BigInt Botan::CurveGFp::sqr | ( | const BigInt & | x, |
secure_vector< word > & | ws | ||
) | const [inline] |
Definition at line 137 of file curve_gfp.h.
{ BigInt z; m_repr->curve_sqr(z, x, ws); return z; }
void Botan::CurveGFp::swap | ( | CurveGFp & | other | ) | [inline] |
Definition at line 154 of file curve_gfp.h.
Referenced by Botan::PointGFp::swap().
{ std::swap(m_repr, other.m_repr); }
void Botan::CurveGFp::to_rep | ( | BigInt & | x, |
secure_vector< word > & | ws | ||
) | const [inline] |
Definition at line 101 of file curve_gfp.h.
Referenced by Botan::PointGFp::get_affine_y(), and Botan::PointGFp::PointGFp().
{ m_repr->to_curve_rep(x, ws); }