|
Botan 3.14.1
Crypto and TLS for C&
|
#include <bls12_381.h>
Public Member Functions | |
| G1Projective | add (const G1Projective &other) const |
| G1Projective | add_mixed (const G1Affine &other) const |
| G1Projective () | |
| bool | is_identity () const |
| G1Projective | mul (const Scalar &scalar) const |
| G1Projective | negate () const |
| G1Affine | to_affine () const |
Static Public Member Functions | |
| static G1Projective | _unchecked_from_affine_coords (const FieldElement &x, const FieldElement &y) |
| static G1Projective | from_affine (const G1Affine &affine) |
| static G1Projective | generator () |
| static G1Projective | hash_to_curve_nu (std::span< const uint8_t > input, std::span< const uint8_t > dst) |
| static G1Projective | hash_to_curve_ro (std::span< const uint8_t > input, std::span< const uint8_t > dst) |
| static G1Projective | identity () |
| static G1Projective | msm_vartime (std::span< const G1Affine > points, std::span< const Scalar > scalars) |
| static G1Projective | mul2 (const G1Projective &p, const Scalar &a, const G1Projective &q, const Scalar &b) |
| static G1Projective | mul2_vartime (const G1Projective &p, const Scalar &a, const G1Projective &q, const Scalar &b) |
| static std::vector< G1Affine > | to_affine_batch (std::span< const G1Projective > points) |
Friends | |
| class | G1Affine |
| template<typename Group> | |
| class | GroupOps |
| template<typename Pt> | |
| class | PointMul |
An element of the group G1, in projective form
Definition at line 258 of file bls12_381.h.
| Botan::BLS12_381::G1Projective::G1Projective | ( | ) |
Default constructed as the identity element
Definition at line 113 of file bls12_381_g1.cpp.
Referenced by _unchecked_from_affine_coords(), add(), add_mixed(), from_affine(), generator(), hash_to_curve_nu(), hash_to_curve_ro(), identity(), msm_vartime(), mul(), mul2(), mul2_vartime(), and negate().
|
static |
The input is assumed to be a point on the curve, though possibly outside the prime order subgroup.
Reserved for internal use, not covered by SemVer.
Definition at line 121 of file bls12_381_g1.cpp.
References G1Projective(), and Botan::BLS12_381::FieldElement::one().
| G1Projective Botan::BLS12_381::G1Projective::add | ( | const G1Projective & | other | ) | const |
Return the sum of this point and other
Definition at line 155 of file bls12_381_g1.cpp.
References G1Projective().
| G1Projective Botan::BLS12_381::G1Projective::add_mixed | ( | const G1Affine & | other | ) | const |
Return the sum of this point and an affine point
Definition at line 159 of file bls12_381_g1.cpp.
References G1Affine, and G1Projective().
|
static |
Convert an affine point to projective form
Definition at line 116 of file bls12_381_g1.cpp.
References G1Affine, and G1Projective().
Referenced by Botan::BLS12_381::G1Affine::deserialize().
|
static |
Return the G1 standard group generator
Definition at line 126 of file bls12_381_g1.cpp.
References G1Projective(), and Botan::BLS12_381::FieldElement::one().
|
static |
Nonuniform encoding to curve (RFC 9380 encode_to_curve), suite BLS12381G1_XMD:SHA-256_SSWU_NU_
Throws Invalid_Argument if dst is empty.
Definition at line 523 of file bls12_381_h2c.cpp.
References G1Projective(), Botan::CT::poison(), and Botan::CT::unpoison_all().
|
static |
Hash to curve (RFC 9380), suite BLS12381G1_XMD:SHA-256_SSWU_RO_
Throws Invalid_Argument if dst is empty.
Definition at line 502 of file bls12_381_h2c.cpp.
References G1Projective(), Botan::CT::poison(), and Botan::CT::unpoison_all().
|
inlinestatic |
Return the G1 identity element
Definition at line 269 of file bls12_381.h.
References G1Projective().
| bool Botan::BLS12_381::G1Projective::is_identity | ( | ) | const |
Check if this point is the identity element
Definition at line 147 of file bls12_381_g1.cpp.
References Botan::CT::all_zeros().
|
static |
Multiscalar multiplication, the sum of scalars[i]*points[i]
The empty sum is the identity element. Throws Invalid_Argument if the spans are of unequal length.
Warning: this function runs in variable time and must be used only with public inputs, such as signature verification. Use mul() with secret scalars.
Definition at line 185 of file bls12_381_g1.cpp.
References G1Projective(), and Botan::BLS12_381::PointMul< Pt >::msm_vartime().
| G1Projective Botan::BLS12_381::G1Projective::mul | ( | const Scalar & | scalar | ) | const |
Scalar multiplication
Constant time; safe for secret scalars
Definition at line 167 of file bls12_381_g1.cpp.
References G1Projective(), and Botan::BLS12_381::PointMul< Pt >::mul().
|
static |
Compute a*p + b*q in constant time
Faster than composing mul() and add(), and safe for secret scalars, as arise for example in Pedersen commitments.
Definition at line 172 of file bls12_381_g1.cpp.
References G1Projective(), and Botan::BLS12_381::PointMul< Pt >::mul2().
|
static |
Compute a*p + b*q
Warning: this function runs in variable time and must be used only with public inputs, such as signature verification. Use mul2() with secret scalars.
Definition at line 177 of file bls12_381_g1.cpp.
References G1Projective(), and Botan::BLS12_381::PointMul< Pt >::mul2_vartime().
| G1Projective Botan::BLS12_381::G1Projective::negate | ( | ) | const |
Return the negation of this point
Definition at line 139 of file bls12_381_g1.cpp.
References G1Projective().
| G1Affine Botan::BLS12_381::G1Projective::to_affine | ( | ) | const |
Convert to affine form, at the cost of a field inversion
Definition at line 130 of file bls12_381_g1.cpp.
References G1Affine.
|
static |
Convert a batch of points to affine
Equivalent to calling to_affine on each point, but much faster, since a single field inversion is shared across the batch.
Definition at line 135 of file bls12_381_g1.cpp.
|
friend |
Definition at line 366 of file bls12_381.h.
References G1Affine.
Referenced by add_mixed(), from_affine(), G1Affine, and to_affine().
|
friend |
|
friend |