Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Botan::CurveGFp Class Reference

`#include <curve_gfp.h>`

## Public Member Functions
| CurveGFp ()=default
| CurveGFp (const BigInt &p, const BigInt &a, const BigInt &b)
| CurveGFp (const CurveGFp &)=default
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
CurveGFp & | operator= (const CurveGFp &)=default
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

## Detailed Description

This class represents an elliptic curve over GF(p)

Definition at line 53 of file curve_gfp.h.

## Constructor & Destructor Documentation

Botan::CurveGFp::CurveGFp | ( |  | ) |
| default

Create an uninitialized CurveGFp

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)

Parameters

  p | prime number of the field
  a | first coefficient
  b | second coefficient

Definition at line 68 of file curve_gfp.h.

68 :
69 m_repr(choose_repr(p, a, b))
70 {
71 }

Botan::CurveGFp::CurveGFp | ( | const CurveGFp & |  | ) |
| default

## Member Function Documentation

void Botan::CurveGFp::from_rep | ( | BigInt & | x,
|  | secure_vector< word > & | ws
| ) |  | const
| inline

Definition at line 102 of file curve_gfp.h.

Referenced by Botan::PointGFp::get_affine_x(), and Botan::PointGFp::on_the_curve().

103 {
104 m_repr->from_curve_rep(x, ws);
105 }

BigInt Botan::CurveGFp::from_rep | ( | const BigInt & | x,
|  | secure_vector< word > & | ws
| ) |  | const
| inline

Definition at line 107 of file curve_gfp.h.

108 {
109 BigInt xt(x);
110 m_repr->from_curve_rep(xt, ws);
111 return xt;
112 }

const BigInt& Botan::CurveGFp::get_a | ( |  | ) | const
| inline

Returns
  curve coefficient a

Definition at line 80 of file curve_gfp.h.

Referenced by Botan::EC_Group::DER_encode(), Botan::operator==(), and Botan::EC_Group::verify_group().

80 { return m_repr->get_a(); }

const BigInt& Botan::CurveGFp::get_a_rep | ( |  | ) | const
| inline

Definition at line 93 of file curve_gfp.h.

Referenced by Botan::PointGFp::on_the_curve().

93 { return m_repr->get_a_rep(); }

const BigInt& Botan::CurveGFp::get_b | ( |  | ) | const
| inline

Returns
  curve coefficient b

Definition at line 85 of file curve_gfp.h.

Referenced by Botan::EC_Group::DER_encode(), Botan::operator==(), and Botan::EC_Group::verify_group().

85 { return m_repr->get_b(); }

const BigInt& Botan::CurveGFp::get_b_rep | ( |  | ) | const
| inline

Definition at line 95 of file curve_gfp.h.

Referenced by Botan::PointGFp::on_the_curve().

95 { return m_repr->get_b_rep(); }

const BigInt& Botan::CurveGFp::get_p | ( |  | ) | const
| inline

Get prime modulus of the field of the curve

Returns
  prime modulus of the field of the curve

Definition at line 91 of file curve_gfp.h.

Referenced by Botan::EC_Group::DER_encode(), Botan::EC2OSP(), Botan::PointGFp::get_affine_x(), Botan::PointGFp::get_affine_y(), Botan::EC_PublicKey::key_length(), Botan::operator==(), Botan::PointGFp::PointGFp(), and Botan::EC_Group::verify_group().

91 { 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 116 of file curve_gfp.h.

117 {
118 m_repr->curve_mul(z, x, y, ws);
119 }

BigInt Botan::CurveGFp::mul | ( | const BigInt & | x,
|  | const BigInt & | y,
|  | secure_vector< word > & | ws
| ) |  | const
| inline

Definition at line 121 of file curve_gfp.h.

122 {
123 BigInt z;
124 m_repr->curve_mul(z, x, y, ws);
125 return z;
126 }

CurveGFp& Botan::CurveGFp::operator= | ( | const CurveGFp & |  | ) |
| default

void Botan::CurveGFp::sqr | ( | BigInt & | z,
|  | const BigInt & | x,
|  | secure_vector< word > & | ws
| ) |  | const
| inline

Definition at line 128 of file curve_gfp.h.

129 {
130 m_repr->curve_sqr(z, x, ws);
131 }

BigInt Botan::CurveGFp::sqr | ( | const BigInt & | x,
|  | secure_vector< word > & | ws
| ) |  | const
| inline

Definition at line 133 of file curve_gfp.h.

134 {
135 BigInt z;
136 m_repr->curve_sqr(z, x, ws);
137 return z;
138 }

void Botan::CurveGFp::swap | ( | CurveGFp & | other | ) |
| inline

Definition at line 140 of file curve_gfp.h.

Referenced by Botan::PointGFp::swap().

141 {
142 std::swap(m_repr, other.m_repr);
143 }

void Botan::CurveGFp::to_rep | ( | BigInt & | x,
|  | secure_vector< word > & | ws
| ) |  | const
| inline

Definition at line 97 of file curve_gfp.h.

Referenced by Botan::PointGFp::get_affine_y(), Botan::PointGFp::PointGFp(), and Botan::PointGFp::randomize_repr().

98 {
99 m_repr->to_curve_rep(x, ws);
100 }

The documentation for this class was generated from the following files:

- src/lib/math/ec_gfp/curve_gfp.h
- src/lib/math/ec_gfp/curve_gfp.cpp