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

org.bouncycastle.crypto.hash2curve.impl

## Class SqrtRatio

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

-     public class SqrtRatio
      extends java.lang.Object

  The result of a sqrt_ratio calculation

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SqrtRatio(boolean isQR, java.math.BigInteger ratio)` Constructs an instance of SqrtRatio representing the result of a square root ratio computation.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.math.BigInteger` | `getRatio()` Retrieves the ratio value resulting from the square root ratio computation.
    `boolean` | `isQR()` Checks whether the computed value is a quadratic residue (QR) modulo a specific field.

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

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

- - ### Constructor Detail

    - #### SqrtRatio

          protected SqrtRatio(boolean isQR,
                              java.math.BigInteger ratio)

      Constructs an instance of SqrtRatio representing the result of a square root ratio computation.
      Parameters:
        `isQR` - A boolean flag indicating whether the computed value is a quadratic residue (QR) modulo a specific field. This helps determine if the ratio under consideration has a valid square root.
        `ratio` - The ratio value resulting from the square root ratio computation.

  - ### Method Detail

    - #### isQR

          public boolean isQR()

      Checks whether the computed value is a quadratic residue (QR) modulo a specific field.
      Returns:
        true if the computed value is a quadratic residue (QR); false otherwise.

    - #### getRatio

          public java.math.BigInteger getRatio()

      Retrieves the ratio value resulting from the square root ratio computation.
      Returns:
        the ratio value as a BigInteger.