Botan  1.11.15
Public Member Functions
Botan::CurveGFp Class Reference

#include <curve_gfp.h>

List of all members.

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 BigIntget_a () const
const BigIntget_a_rep () const
const BigIntget_b () const
const BigIntget_b_rep () const
const BigIntget_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
CurveGFpoperator= (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

Detailed Description

This class represents an elliptic curve over GF(p)

Definition at line 57 of file curve_gfp.h.


Constructor & Destructor Documentation

Create an uninitialized CurveGFp

Definition at line 64 of file curve_gfp.h.

{}
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:
pprime number of the field
afirst coefficient
bsecond coefficient

Definition at line 72 of file curve_gfp.h.

                                                                  :
         m_repr(choose_repr(p, a, b))
         {
         }

Member Function Documentation

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]
Returns:
curve coefficient a

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]
Returns:
curve coefficient b

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

Returns:
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.

         {
         m_repr->curve_mul(z, x, y, ws);
         }
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.

         {
         BigInt z;
         m_repr->curve_mul(z, x, y, ws);
         return z;
         }
void Botan::CurveGFp::normalize ( BigInt x,
secure_vector< word > &  ws,
size_t  bound = 0 
) const [inline]

Adjust x to be in [0,p)

Parameters:
boundif 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);
         }
CurveGFp& Botan::CurveGFp::operator= ( const CurveGFp )
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);
         }

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