File tree 1 file changed +0
-17
lines changed
src/main/java/com/thealgorithms/ciphers
1 file changed +0
-17
lines changed Original file line number Diff line number Diff line change @@ -33,21 +33,4 @@ public BigInteger calculateSharedSecret(BigInteger otherPublicValue) {
33
33
// Returns b^x mod p or a^y mod p
34
34
return otherPublicValue .modPow (secret , prime );
35
35
}
36
-
37
- // Static utility methods for direct calculation (if needed)
38
- public static BigInteger calculatePublicValue (BigInteger base , BigInteger secret , BigInteger prime ) {
39
- // Check for valid inputs
40
- if (base == null || secret == null || prime == null || base .signum () <= 0 || secret .signum () <= 0 || prime .signum () <= 0 ) {
41
- throw new IllegalArgumentException ("Base, secret, and prime must be non-null and positive values." );
42
- }
43
- return base .modPow (secret , prime );
44
- }
45
-
46
- public static BigInteger calculateSharedSecret (BigInteger otherPublicValue , BigInteger secret , BigInteger prime ) {
47
- // Check for valid inputs
48
- if (otherPublicValue == null || secret == null || prime == null || otherPublicValue .signum () <= 0 || secret .signum () <= 0 || prime .signum () <= 0 ) {
49
- throw new IllegalArgumentException ("Other public value, secret, and prime must be non-null and positive values." );
50
- }
51
- return otherPublicValue .modPow (secret , prime );
52
- }
53
36
}
You can’t perform that action at this time.
0 commit comments