diff --git a/src/main/java/me/hatter/math/Phi.java b/src/main/java/me/hatter/math/EulerTheorem.java similarity index 96% rename from src/main/java/me/hatter/math/Phi.java rename to src/main/java/me/hatter/math/EulerTheorem.java index f08a131..db006ed 100644 --- a/src/main/java/me/hatter/math/Phi.java +++ b/src/main/java/me/hatter/math/EulerTheorem.java @@ -2,7 +2,7 @@ package me.hatter.math; import java.math.BigInteger; -public class Phi { +public class EulerTheorem { public static void main(String[] args) { for (long x = 4; x < 10000; x++) { diff --git a/src/main/java/me/hatter/math/ModularInv.java b/src/main/java/me/hatter/math/ModularInv.java index 19a1478..641e383 100644 --- a/src/main/java/me/hatter/math/ModularInv.java +++ b/src/main/java/me/hatter/math/ModularInv.java @@ -18,7 +18,7 @@ public class ModularInv { BigInteger x = a.modInverse(p); BigInteger y = modularInv(a, p); // a^(phi(p)-1) mod p - BigInteger z = a.modPow(Phi.phi(p).subtract(BigInteger.ONE), p); + BigInteger z = a.modPow(EulerTheorem.phi(p).subtract(BigInteger.ONE), p); System.out.println(Arrays.asList(a + "^-1 mod " + p, x, y, z)); if (!y.equals(x) || !y.equals(z)) { throw new RuntimeException();