Skip to content

Commit 2b3f8f1

Browse files
committed
fix: remove redundant main method for PMD compliance
1 parent c543588 commit 2b3f8f1

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

src/main/java/com/thealgorithms/ciphers/ElGamalCipher.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,3 @@ public BigInteger decrypt(BigInteger c1, BigInteger c2) {
3434
BigInteger sInv = s.modInverse(p);
3535
return c2.multiply(sInv).mod(p);
3636
}
37-
38-
// Example usage
39-
public static void main(String[] args) {
40-
ElGamalCipher elgamal = new ElGamalCipher();
41-
elgamal.generateKeys(256);
42-
43-
BigInteger message = new BigInteger("12345");
44-
BigInteger[] cipher = elgamal.encrypt(message);
45-
BigInteger decrypted = elgamal.decrypt(cipher[0], cipher[1]);
46-
47-
System.out.println("Original: " + message);
48-
System.out.println("Encrypted: c1=" + cipher[0] + ", c2=" + cipher[1]);
49-
System.out.println("Decrypted: " + decrypted);
50-
}
51-
}

0 commit comments

Comments
 (0)