Botan 3.9.0
Crypto and TLS for C&
|
#include <pcurves_impl.h>
Public Types | |
using | AffinePoint = AffineCurvePoint<FieldElement, Params> |
using | Self = ProjectiveCurvePoint<FieldElement, Params> |
Public Member Functions | |
constexpr void | _const_time_poison () const |
constexpr void | _const_time_unpoison () const |
constexpr void | conditional_assign (CT::Choice cond, const Self &pt) |
constexpr Self | dbl () const |
constexpr Self | dbl_n (size_t n) const |
constexpr CT::Choice | is_identity () const |
constexpr Self | negate () const |
constexpr Self & | operator+= (const AffinePoint &other) |
constexpr Self & | operator+= (const Self &other) |
ProjectiveCurvePoint & | operator= (const Self &other)=default |
ProjectiveCurvePoint & | operator= (Self &&other)=default |
constexpr | ProjectiveCurvePoint () |
constexpr | ProjectiveCurvePoint (const FieldElement &x, const FieldElement &y) |
constexpr | ProjectiveCurvePoint (const FieldElement &x, const FieldElement &y, const FieldElement &z) |
ProjectiveCurvePoint (const Self &other)=default | |
ProjectiveCurvePoint (Self &&other)=default | |
void | randomize_rep (RandomNumberGenerator &rng) |
constexpr const FieldElement & | x () const |
constexpr const FieldElement & | y () const |
constexpr const FieldElement & | z () const |
~ProjectiveCurvePoint ()=default |
Static Public Member Functions | |
static constexpr Self | add (const Self &a, const Self &b) |
static constexpr Self | add_mixed (const Self &a, const AffinePoint &b) |
static constexpr Self | add_or_sub (const Self &a, const AffinePoint &b, CT::Choice sub) |
static constexpr Self | from_affine (const AffinePoint &pt) |
static constexpr Self | identity () |
Static Public Attributes | |
static constexpr FieldElement | A = FieldElement::from_words(Params::AW) |
static constexpr bool | A_is_minus_3 = (A == FieldElement::constant(-3)).as_bool() |
static constexpr bool | A_is_zero = A.is_zero().as_bool() |
Friends | |
constexpr Self | operator+ (const AffinePoint &a, const Self &b) |
constexpr Self | operator+ (const Self &a, const AffinePoint &b) |
constexpr Self | operator+ (const Self &a, const Self &b) |
constexpr Self | operator- (const Self &a, const Self &b) |
Projective curve point
This uses Jacobian coordinates
Definition at line 966 of file pcurves_impl.h.
using Botan::ProjectiveCurvePoint< FieldElement, Params >::AffinePoint = AffineCurvePoint<FieldElement, Params> |
Definition at line 977 of file pcurves_impl.h.
using Botan::ProjectiveCurvePoint< FieldElement, Params >::Self = ProjectiveCurvePoint<FieldElement, Params> |
Definition at line 976 of file pcurves_impl.h.
|
inlineconstexpr |
Default constructor: the identity element
Definition at line 1009 of file pcurves_impl.h.
Referenced by from_affine(), operator=(), and operator=().
|
inlineconstexpr |
Affine constructor: take x/y coordinates
Definition at line 1015 of file pcurves_impl.h.
|
inlineconstexpr |
Projective constructor: take x/y/z coordinates
Definition at line 1021 of file pcurves_impl.h.
|
default |
|
default |
|
default |
|
inlineconstexpr |
Definition at line 1140 of file pcurves_impl.h.
References Botan::CT::poison_all().
|
inlineconstexpr |
Definition at line 1142 of file pcurves_impl.h.
References Botan::CT::unpoison_all().
|
inlinestaticconstexpr |
Projective point addition
Definition at line 1069 of file pcurves_impl.h.
References Botan::point_add().
Referenced by operator+.
|
inlinestaticconstexpr |
Mixed (projective + affine) point addition
Definition at line 1057 of file pcurves_impl.h.
References Botan::point_add_mixed().
|
inlinestaticconstexpr |
Definition at line 1062 of file pcurves_impl.h.
References Botan::point_add_or_sub_mixed().
|
inlineconstexpr |
|
inlineconstexpr |
Point doubling
Definition at line 1087 of file pcurves_impl.h.
References A, A_is_minus_3, A_is_zero, Botan::dbl_a_minus_3(), Botan::dbl_a_zero(), and Botan::dbl_generic().
|
inlineconstexpr |
Iterated point doubling
Definition at line 1074 of file pcurves_impl.h.
References A, A_is_minus_3, A_is_zero, Botan::dbl_n_a_minus_3(), Botan::dbl_n_a_zero(), and Botan::dbl_n_generic().
|
inlinestaticconstexpr |
Convert a point from affine to projective form
Definition at line 982 of file pcurves_impl.h.
References Botan::AffineCurvePoint< FieldElement, Params >::is_identity(), ProjectiveCurvePoint(), Botan::AffineCurvePoint< FieldElement, Params >::x(), x(), Botan::AffineCurvePoint< FieldElement, Params >::y(), y(), and z().
|
inlinestaticconstexpr |
Return the identity element
Definition at line 1004 of file pcurves_impl.h.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Definition at line 1041 of file pcurves_impl.h.
|
inlineconstexpr |
Definition at line 1036 of file pcurves_impl.h.
|
default |
References ProjectiveCurvePoint().
|
default |
References ProjectiveCurvePoint().
|
inline |
Randomize the point representation
Projective coordinates are redundant; if (x,y,z) is a projective point then so is (x*r^2,y*r^3,z*r) for any non-zero r.
Definition at line 1108 of file pcurves_impl.h.
References Botan::RandomNumberGenerator::is_seeded().
|
inlineconstexpr |
Return the projective x coordinate
Definition at line 1128 of file pcurves_impl.h.
Referenced by conditional_assign(), from_affine(), negate(), ProjectiveCurvePoint(), and ProjectiveCurvePoint().
|
inlineconstexpr |
Return the projective y coordinate
Definition at line 1133 of file pcurves_impl.h.
Referenced by conditional_assign(), from_affine(), negate(), ProjectiveCurvePoint(), and ProjectiveCurvePoint().
|
inlineconstexpr |
Return the projective z coordinate
Definition at line 1138 of file pcurves_impl.h.
Referenced by conditional_assign(), from_affine(), is_identity(), negate(), and ProjectiveCurvePoint().
|
friend |
Definition at line 1034 of file pcurves_impl.h.
References add_mixed().
|
friend |
|
friend |
Definition at line 1030 of file pcurves_impl.h.
References add().
|
staticconstexpr |
Definition at line 971 of file pcurves_impl.h.
|
staticconstexpr |
Definition at line 974 of file pcurves_impl.h.
|
staticconstexpr |
Definition at line 973 of file pcurves_impl.h.