Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Free functions

get_pGETTER FUNCTIONS /// Returns the prime modulus p of the base field Fp for a given curve….
has_endomorphism_availableChecks if a curve has an efficient endomorphism available for GLV decomposition. GLV (Gallant-Lambert-Vanstone) decomposition accelerates scalar multiplication…
get_aReturns the Weierstrass ‘a’ parameter for a given curve. For Weierstrass curves: y² = x³ + ax + b…
get_bReturns the Weierstrass ‘b’ parameter for a given curve. For Weierstrass curves: y² = x³ + ax + b…
get_b_twistReturns the b parameter for the twisted curve E’(Fp2) used in pairing operations. The twisted curve has equation: y² = x³ + b’ where b’ is in Fp2….
get_gReturns a generator g of the multiplicative group Fp * for a given curve. This generator is used for various field operations and exponentiations….
get_nReturns the order n of the curve’s prime-order subgroup. This is the number of points in the main cryptographic subgroup. For most curves, this equals #E(Fp)/cofactor….
get_min_oneReturns (-1) mod p precomputed for the base field Fp. This is equivalent to (p - 1) and is frequently used in field arithmetic….
get_min_one_orderReturns (-1) mod n precomputed for the scalar field (curve order). This is equivalent to (n - 1) and is used for scalar arithmetic operations….
get_modulusReturns the base field modulus p as a CircuitModulus for circuit operations. CircuitModulus is used by Cairo’s circuit builtins for modular arithmetic….
get_curve_order_modulusReturns the curve order n as a CircuitModulus for circuit operations. CircuitModulus is used by Cairo’s circuit builtins for modular arithmetic in the scalar field….
get_GReturns the standard generator point G of the curve’s prime-order subgroup. This is the base point used for scalar multiplication and key generation….
get_eigenvalueReturns the eigenvalue λ for the curve’s efficiently computable endomorphism. The endomorphism φ satisfies φ(P) = λ·P for points P on the curve….
get_nG_glv_fake_glvReturns the precomputed point 2^(nbits-1)·G for GLV/fake-GLV decomposition. This precomputed value is used to accelerate scalar multiplication via…
get_third_root_of_unityReturns a primitive cube root of unity ω in the base field Fp. This element satisfies ω³ = 1 and ω ≠ 1, and is used in GLV endomorphism computations for accelerating scalar multiplication….
get_BLS12_381_modulusReturns the BLS12-381 base field modulus as CircuitModulus.
get_BN254_modulusReturns the BN254 base field modulus as CircuitModulus.
get_SECP256K1_modulusReturns the SECP256K1 base field modulus as CircuitModulus.
get_SECP256R1_modulusReturns the SECP256R1 (P-256) base field modulus as CircuitModulus.
get_ED25519_modulusReturns the ED25519 base field modulus as CircuitModulus. (Modulus of the birationally equivalent Weierstrass curve)
get_GRUMPKIN_modulusReturns the GRUMPKIN base field modulus as CircuitModulus.
get_BN254_order_modulusReturns the BN254 curve order as CircuitModulus.
get_BLS12_381_order_modulusReturns the BLS12-381 curve order as CircuitModulus.
get_SECP256K1_order_modulusReturns the SECP256K1 curve order as CircuitModulus.
get_SECP256R1_order_modulusReturns the SECP256R1 (P-256) curve order as CircuitModulus.
get_ED25519_order_modulusReturns the ED25519 curve order as CircuitModulus.
get_GRUMPKIN_order_modulusReturns the GRUMPKIN curve order as CircuitModulus.