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

org.bouncycastle.crypto.hash2curve.test

## Class BLS12_381G2HashToCurveTest

- java.lang.Object
- - junit.framework.Assert
  - - junit.framework.TestCase
    - - org.bouncycastle.crypto.hash2curve.test.BLS12_381G2HashToCurveTest

- All Implemented Interfaces:
    junit.framework.Test

      public class BLS12_381G2HashToCurveTest
      extends junit.framework.TestCase

  Known-answer tests for BLS12381G2_XMD:SHA-256_SSWU_RO_ from RFC 9380 Appendix J.10.1. Each vector checks intermediate layers (u[0], u[1], Q0, Q1) before the final hashed point P, so a regression localises to the specific stage that broke.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BLS12_381G2HashToCurveTest()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `testFp2Sgn0SpecVectors()`
    `void` | `testFp2Sqrt()`
    `void` | `testFp2SqrtNullForAnotherNonSquare()`
    `void` | `testFp2SqrtNullForNonSquare()`
    `void` | `testFp2SqrtOfZeroIsZero()`
    `void` | `testGenerator()`
    `void` | `testJ101Vectors()`

    - ### Methods inherited from class junit.framework.TestCase

      `assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString`

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

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

- - ### Constructor Detail

    - #### BLS12_381G2HashToCurveTest

          public BLS12_381G2HashToCurveTest()

  - ### Method Detail

    - #### testJ101Vectors

          public void testJ101Vectors()

    - #### testGenerator

          public void testGenerator()

    - #### testFp2Sqrt

          public void testFp2Sqrt()

    - #### testFp2SqrtNullForNonSquare

          public void testFp2SqrtNullForNonSquare()

    - #### testFp2SqrtNullForAnotherNonSquare

          public void testFp2SqrtNullForAnotherNonSquare()

    - #### testFp2SqrtOfZeroIsZero

          public void testFp2SqrtOfZeroIsZero()

    - #### testFp2Sgn0SpecVectors

          public void testFp2Sgn0SpecVectors()