BLS12_381G1CurveProcessor (Bouncy Castle Library 1.85 API Specification)
Date: 2026-07-12

org.bouncycastle.crypto.hash2curve.impl

## Class BLS12_381G1CurveProcessor

- java.lang.Object
- - org.bouncycastle.crypto.hash2curve.impl.BLS12_381G1CurveProcessor

- All Implemented Interfaces:
    CurveProcessor

      public class BLS12_381G1CurveProcessor
      extends java.lang.Object
      implements CurveProcessor

  CurveProcessor for the BLS12381G1_XMD:SHA-256_SSWU_RO_ hash-to-curve suite. Cofactor clearing is done by scalar-multiplication by `BLS12_381G1.H_EFF` (Bowe's fast cofactor clear), as mandated by RFC 9380 sec. 8.8.1.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BLS12_381G1CurveProcessor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ECPoint` | `add(ECPoint p, ECPoint q)` Add two points in the curve group.
    `ECPoint` | `clearCofactor(ECPoint ecPoint)` Clears the cofactor from the given elliptic curve point.
    `AffineXY` | `mapToAffineXY(ECPoint p)` Converts an elliptic-curve point into the affine (x, y) coordinate representation defined by the hash-to-curve suite.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BLS12_381G1CurveProcessor

          public BLS12_381G1CurveProcessor()

  - ### Method Detail

    - #### add

          public ECPoint add(ECPoint p,
                             ECPoint q)

      Description copied from interface: `CurveProcessor`
      Add two points in the curve group. Semantics are curve-model specific.
      Specified by:
        `add` in interface `CurveProcessor`

    - #### clearCofactor

          public ECPoint clearCofactor(ECPoint ecPoint)

      Description copied from interface: `CurveProcessor`
      Clears the cofactor from the given elliptic curve point.
      Specified by:
        `clearCofactor` in interface `CurveProcessor`
      Parameters:
        `ecPoint` - the elliptic curve point to process
      Returns:
        the elliptic curve point with the cofactor cleared

    - #### mapToAffineXY

          public AffineXY mapToAffineXY(ECPoint p)

      Description copied from interface: `CurveProcessor`
      Converts an elliptic-curve point into the affine (x, y) coordinate representation defined by the hash-to-curve suite.

      The returned coordinates are intended for serialization, testing, and interoperability with the reference outputs defined in RFC 9380. For most Weierstrass curves, this is simply the affine (x, y) coordinates of the given point. For curves that use a different coordinate model in the specification (e.g. Montgomery curves such as curve25519), this method applies the appropriate coordinate transformation.

      This method does not change the underlying group element represented by the point. It only changes how that point is expressed as field elements. The input point is expected to be a valid point on the curve used by the implementation.

      Specified by:
        `mapToAffineXY` in interface `CurveProcessor`
      Parameters:
        `p` - a valid elliptic-curve point
      Returns:
        the affine (x, y) coordinates corresponding to the suite-specific representation of the given point