org.bouncycastle.math.raw

## Class Mod

- java.lang.Object
- - org.bouncycastle.math.raw.Mod

-     public abstract class Mod
      extends java.lang.Object

  Modular inversion as implemented in this class is based on the paper "Fast constant-time gcd computation and modular inversion" by Daniel J. Bernstein and Bo-Yin Yang.

  In some cases (when it is faster) we use the "half delta" variant of safegcd based on hddivsteps.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Mod()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `checkedModOddInverse(int[] m, int[] x, int[] z)`
    `static void` | `checkedModOddInverseVar(int[] m, int[] x, int[] z)`
    `static int` | `inverse32(int d)`
    `static int` | `modOddInverse(int[] m, int[] x, int[] z)`
    `static boolean` | `modOddInverseVar(int[] m, int[] x, int[] z)`
    `static int` | `modOddIsCoprime(int[] m, int[] x)`
    `static boolean` | `modOddIsCoprimeVar(int[] m, int[] x)`
    `static int[]` | `random(int[] p)`

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

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

- - ### Constructor Detail

    - #### Mod

          public Mod()

  - ### Method Detail

    - #### checkedModOddInverse

          public static void checkedModOddInverse(int[] m,
                                                  int[] x,
                                                  int[] z)

    - #### checkedModOddInverseVar

          public static void checkedModOddInverseVar(int[] m,
                                                     int[] x,
                                                     int[] z)

    - #### inverse32

          public static int inverse32(int d)

    - #### modOddInverse

          public static int modOddInverse(int[] m,
                                          int[] x,
                                          int[] z)

    - #### modOddInverseVar

          public static boolean modOddInverseVar(int[] m,
                                                 int[] x,
                                                 int[] z)

    - #### modOddIsCoprime

          public static int modOddIsCoprime(int[] m,
                                            int[] x)

    - #### modOddIsCoprimeVar

          public static boolean modOddIsCoprimeVar(int[] m,
                                                   int[] x)

    - #### random

          public static int[] random(int[] p)