Package org.bouncycastle.crypto.bls
Class BLS12_381G1
- java.lang.Object
-
- org.bouncycastle.crypto.bls.BLS12_381G1
-
public class BLS12_381G1 extends java.lang.ObjectCurve parameters for BLS12-381 G1, the prime-order subgroup ofE(Fp)defined byy^2 = x^3 + 4overFp, as standardised in draft-irtf-cfrg-bls-signature and RFC 9380 sec. 8.8.1.The curve is exposed via the standard
ECCurve.Fp(BigInteger-backed) so that hash-to-curve and other G1-only consumers can be built on top without depending on a custom limb-array representation.
-
-
Field Summary
Fields Modifier and Type Field Description static java.math.BigIntegerCOFACTORG1 cofactor h.static java.math.BigIntegerH_EFFEffective cofactor for hash-to-curve (RFC 9380 sec. 8.8.1):h_eff = 1 - xwherex = -0xd201000000010000is the BLS12-381 trace parameter, soh_eff = 0xd201000000010001.static java.math.BigIntegerORDERG1 prime-order subgroup order r. 255 bits.static java.math.BigIntegerQBase field characteristic p. 381 bits.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ECPointconstantTimeMultiply(ECPoint p, java.math.BigInteger scalar)Constant-time scalar multiplication on G1, suitable for secret scalars (e.g.static ECCurvecreateCurve()static ECPointgetGenerator(ECCurve curve)
-
-
-
Field Detail
-
Q
public static final java.math.BigInteger Q
Base field characteristic p. 381 bits.
-
ORDER
public static final java.math.BigInteger ORDER
G1 prime-order subgroup order r. 255 bits.
-
COFACTOR
public static final java.math.BigInteger COFACTOR
G1 cofactor h.
-
H_EFF
public static final java.math.BigInteger H_EFF
Effective cofactor for hash-to-curve (RFC 9380 sec. 8.8.1):h_eff = 1 - xwherex = -0xd201000000010000is the BLS12-381 trace parameter, soh_eff = 0xd201000000010001. Multiplying any point on E(Fp) by h_eff lands in the prime-order subgroup; this is faster than the full cofactor multiplication and is the form mandated by the hash-to-curve suite.
-
-
Method Detail
-
createCurve
public static ECCurve createCurve()
- Returns:
- a fresh
ECCurveinstance for BLS12-381 G1 (y^2 = x^3 + 4over Fp). Each call returns an independent curve; consumers that build derived structures (auxiliary isogeny curves, lookup tables, etc.) should reuse one instance.
-
getGenerator
public static ECPoint getGenerator(ECCurve curve)
- Returns:
- the standard generator G1 of the prime-order subgroup, on the
given curve instance (must be an instance returned by
createCurve()).
-
constantTimeMultiply
public static ECPoint constantTimeMultiply(ECPoint p, java.math.BigInteger scalar)
Constant-time scalar multiplication on G1, suitable for secret scalars (e.g.sk * G1_geninskToPk).Same approach as
BLS12_381G2Point.constantTimeMultiply(java.math.BigInteger): a fixed-iteration "double, conditionally add" ladder over 256 bits with an array-indexed select replacing the bit-conditionalif. Same caveats apply — the underlying BC ECPoint arithmetic still has data-dependent branches for infinity / equal-x cases (negligibly probable for random secret scalars on a prime-order subgroup), and JVM-level timing variance is not addressable in pure Java.
-
-