Typo and style fixes (#25)

This commit is contained in:
Thai Duong
2017-02-07 17:01:34 -08:00
committed by GitHub
parent 62e1bf0ec4
commit 7dfe46ba87
5 changed files with 69 additions and 65 deletions
@@ -71,9 +71,9 @@ public class DhiesTest extends TestCase {
}
/**
* WARNING: This test uses weak crypto (i.e. DHIESWithAES), if supported. Checks that key agreement
* using DHIES works in the sense that it can decrypt what it encrypts. Unfortunately it seems that
* there is no secure mode using AES.
* WARNING: This test uses weak crypto (i.e. DHIESWithAES), if supported. Checks that key
* agreement using DHIES works in the sense that it can decrypt what it encrypts. Unfortunately it
* seems that there is no secure mode using AES.
*/
@SuppressWarnings("InsecureCryptoUsage")
public void testDhiesBasic() throws Exception {
@@ -671,7 +671,7 @@ public class DsaTest extends TestCase {
+ "22e342be484c05763939601cd667",
"300a090380fe01090380fe01",
};
@SuppressWarnings("InsecureCryptoUsage")
public void testVectors(
String[] signatures,
@@ -217,6 +217,7 @@ public class EciesTest extends TestCase {
fail("This should not work");
} catch (GeneralSecurityException ex) {
// This is as expected
// Bouncy Castle 1.56 throws this exception
} catch (Exception ex) {
fail("Expected subclass of java.security.GeneralSecurityException, but got: "
+ ex.getClass().getName());
@@ -284,7 +285,7 @@ public class EciesTest extends TestCase {
byte[] message = "Hello".getBytes("UTF-8");
eciesA.init(Cipher.ENCRYPT_MODE, keyPair.getPublic());
byte[] ciphertext = eciesA.doFinal(message);
eciesB.init(Cipher.DECRYPT_MODE, keyPair.getPrivate(), eciesA.getParameters());
eciesB.init(Cipher.DECRYPT_MODE, keyPair.getPrivate(), eciesB.getParameters());
byte[] decrypted = eciesB.doFinal(ciphertext);
assertEquals(TestUtil.bytesToHex(message), TestUtil.bytesToHex(decrypted));
}