Package org.bouncycastle.math.raw
Class Mod
java.lang.Object
org.bouncycastle.math.raw.Mod
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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)
-
Constructor Details
-
Mod
public Mod()
-
-
Method Details
-
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)
-