Skip to content

Commit efb90e2

Browse files
authored
Merge pull request #128 from tls-attacker/ffdheKeyshares
Fixed interpretation of FFDHE key share byte values
2 parents 7e24932 + 5172f92 commit efb90e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TLS-Core/src/main/java/de/rub/nds/tlsattacker/core/crypto/KeyShareCalculator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static byte[] computeSharedSecret(NamedGroup group, BigInteger privateKey
9696
}
9797
} else {
9898
FFDHEGroup ffdheGroup = GroupFactory.getGroup(group);
99-
BigInteger sharedElement = new BigInteger(publicKey).modPow(privateKey.abs(), ffdheGroup.getP().abs());
99+
BigInteger sharedElement = new BigInteger(1, publicKey).modPow(privateKey.abs(), ffdheGroup.getP().abs());
100100
return ArrayConverter.bigIntegerToNullPaddedByteArray(sharedElement,
101101
ffdheGroup.getP().bitLength() / Bits.IN_A_BYTE);
102102
}

0 commit comments

Comments
 (0)