Skip to content

Commit b18cc32

Browse files
authored
Update DiffieHellman.java
1 parent b9b5363 commit b18cc32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public static void main(String[] args) {
3333
y = new BigInteger(read.next());
3434
b = g.modPow(y, n);
3535

36-
k1 = B.modPow(x, n);
37-
k2 = A.modPow(y, n);
36+
k1 = b.modPow(x, n);
37+
k2 = a.modPow(y, n);
3838

3939
System.out.println("A's secret key: " + k1);
4040
System.out.println("B's secret key: " + k2);

0 commit comments

Comments
 (0)