Class SqrtRatio

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

public class SqrtRatio extends Object
The result of a sqrt_ratio calculation
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    SqrtRatio(boolean isQR, BigInteger ratio)
    Constructs an instance of SqrtRatio representing the result of a square root ratio computation.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the ratio value resulting from the square root ratio computation.
    boolean
    Checks whether the computed value is a quadratic residue (QR) modulo a specific field.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SqrtRatio

      protected SqrtRatio(boolean isQR, 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 Details

    • 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 BigInteger getRatio()
      Retrieves the ratio value resulting from the square root ratio computation.
      Returns:
      the ratio value as a BigInteger.