|
Botan 3.14.1
Crypto and TLS for C&
|
#include <pcurves_impl.h>
Public Types | |
| using | AffinePoint = AffineCurvePoint<FieldElement> |
| 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_iso (const FieldElement &a) const |
| constexpr Self | dbl_n (size_t n) const |
| constexpr Self | dbl_n_iso (const FieldElement &a, 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 (const FieldElement &r) |
| 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 std::pair< Self, FieldElement > | add_mixed_h (const Self &a, const AffinePoint &b) |
| static constexpr Self | add_mixed_iso (const Self &a, const AffinePoint &b, const FieldElement &curve_a) |
| static constexpr Self | add_or_sub (const Self &a, const AffinePoint &b, CT::Choice sub) |
| static constexpr Self | add_or_sub_iso (const Self &a, const AffinePoint &b, CT::Choice sub, const FieldElement &curve_a) |
| 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 1011 of file pcurves_impl.h.
| using Botan::ProjectiveCurvePoint< FieldElement, Params >::AffinePoint = AffineCurvePoint<FieldElement> |
Definition at line 1022 of file pcurves_impl.h.
| using Botan::ProjectiveCurvePoint< FieldElement, Params >::Self = ProjectiveCurvePoint<FieldElement, Params> |
Definition at line 1021 of file pcurves_impl.h.
|
inlineconstexpr |
Default constructor: the identity element
Definition at line 1054 of file pcurves_impl.h.
Referenced by from_affine(), operator=(), and operator=().
|
inlineconstexpr |
Affine constructor: take x/y coordinates
Definition at line 1060 of file pcurves_impl.h.
|
inlineconstexpr |
Projective constructor: take x/y/z coordinates
Definition at line 1066 of file pcurves_impl.h.
|
default |
|
default |
|
default |
|
inlineconstexpr |
Definition at line 1226 of file pcurves_impl.h.
References Botan::CT::poison_all().
|
inlineconstexpr |
Definition at line 1228 of file pcurves_impl.h.
References Botan::CT::unpoison_all().
|
inlinestaticconstexpr |
Projective point addition
Definition at line 1138 of file pcurves_impl.h.
References Botan::point_add().
Referenced by operator+.
|
inlinestaticconstexpr |
Mixed (projective + affine) point addition
Definition at line 1102 of file pcurves_impl.h.
References A, and Botan::point_add_mixed().
|
inlinestaticconstexpr |
Mixed point addition, additionally returning H (the sum has Z = a.z * H)
Definition at line 1116 of file pcurves_impl.h.
References A, and Botan::point_add_mixed_h().
|
inlinestaticconstexpr |
Mixed point addition on an isomorphic curve with the given a coefficient
Definition at line 1109 of file pcurves_impl.h.
References Botan::point_add_mixed().
|
inlinestaticconstexpr |
Definition at line 1121 of file pcurves_impl.h.
References A, and Botan::point_add_or_sub_mixed().
|
inlinestaticconstexpr |
Either add or subtract, on an isomorphic curve with the given a coefficient
Definition at line 1128 of file pcurves_impl.h.
References Botan::point_add_or_sub_mixed().
|
inlineconstexpr |
|
inlineconstexpr |
Point doubling
Definition at line 1181 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 |
Point doubling on an isomorphic curve with the given a coefficient
Definition at line 1170 of file pcurves_impl.h.
References A_is_zero, Botan::dbl_a_zero(), and Botan::dbl_generic().
|
inlineconstexpr |
Iterated point doubling
Definition at line 1143 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().
|
inlineconstexpr |
Iterated point doubling on an isomorphic curve with the given a coefficient
If a is zero on this curve it is zero on any isomorphic curve, so the argument is ignored in that case.
Definition at line 1159 of file pcurves_impl.h.
References A_is_zero, Botan::dbl_n_a_zero(), and Botan::dbl_n_generic().
|
inlinestaticconstexpr |
Convert a point from affine to projective form
Definition at line 1027 of file pcurves_impl.h.
References Botan::AffineCurvePoint< FieldElement >::is_identity(), ProjectiveCurvePoint(), Botan::AffineCurvePoint< FieldElement >::x(), x(), Botan::AffineCurvePoint< FieldElement >::y(), y(), and z().
|
inlinestaticconstexpr |
Return the identity element
Definition at line 1049 of file pcurves_impl.h.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Definition at line 1086 of file pcurves_impl.h.
|
inlineconstexpr |
Definition at line 1081 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 1202 of file pcurves_impl.h.
|
inlineconstexpr |
Return the projective x coordinate
Definition at line 1214 of file pcurves_impl.h.
Referenced by conditional_assign(), from_affine(), negate(), ProjectiveCurvePoint(), and ProjectiveCurvePoint().
|
inlineconstexpr |
Return the projective y coordinate
Definition at line 1219 of file pcurves_impl.h.
Referenced by conditional_assign(), from_affine(), negate(), ProjectiveCurvePoint(), and ProjectiveCurvePoint().
|
inlineconstexpr |
Return the projective z coordinate
Definition at line 1224 of file pcurves_impl.h.
Referenced by conditional_assign(), from_affine(), is_identity(), negate(), and ProjectiveCurvePoint().
|
friend |
Definition at line 1079 of file pcurves_impl.h.
References add_mixed().
|
friend |
|
friend |
Definition at line 1075 of file pcurves_impl.h.
References add().
|
staticconstexpr |
Definition at line 1016 of file pcurves_impl.h.
Referenced by add_mixed(), add_mixed_h(), add_or_sub(), dbl(), and dbl_n().
|
staticconstexpr |
Definition at line 1019 of file pcurves_impl.h.
|
staticconstexpr |
Definition at line 1018 of file pcurves_impl.h.
Referenced by dbl(), dbl_iso(), dbl_n(), and dbl_n_iso().