Assert.assertThat(isPrime, equalTo(true));
}
@Test
public void shouldGenerateSameSecretForBoth() throws CreatingDHAgreementException, InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException, InvalidAlgorithmParameterException {
DHAgreementModel A = dhAlgorithm.generateInitialNumbers();
DHAgreementModel B = dhAlgorithm.generateInitialNumbers(A.getP(), A.getG());
byte[] server = dhAlgorithm.generateSecret(A.get_a(), B.getPublicA());
byte[] client = dhAlgorithm.generateSecret(B.get_a(), A.getPublicA());
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
byte[] digestServer = messageDigest.digest(server);
byte[] digestClient = messageDigest.digest(client);