IESCipher c1 = new org.bouncycastle.jcajce.provider.asymmetric.ec.IESCipher.ECIES();
IESCipher c2 = new org.bouncycastle.jcajce.provider.asymmetric.ec.IESCipher.ECIES();
IESParameterSpec params = new IESParameterSpec(derivation,encoding,128);
// Testing ECIES with default curve in streaming mode
KeyPairGenerator g = KeyPairGenerator.getInstance("EC", "BC");
doTest("ECIES with default", g, "ECIES", params);
// Testing ECIES with 192-bit curve in streaming mode
g.initialize(192, new SecureRandom());
doTest("ECIES with 192-bit", g, "ECIES", params);
// Testing ECIES with 256-bit curve in streaming mode
g.initialize(256, new SecureRandom());
doTest("ECIES with 256-bit", g, "ECIES", params);
c1 = new IESCipher(new IESEngine(new ECDHBasicAgreement(),
new KDF2BytesGenerator(new SHA1Digest()),
new HMac(new SHA1Digest()),
new PaddedBufferedBlockCipher(new DESEngine())));
c2 = new IESCipher(new IESEngine(new ECDHBasicAgreement(),
new KDF2BytesGenerator(new SHA1Digest()),
new HMac(new SHA1Digest()),
new PaddedBufferedBlockCipher(new DESEngine())));
params = new IESParameterSpec(derivation, encoding, 128, 128);
// Testing ECIES with default curve using DES
g = KeyPairGenerator.getInstance("EC", "BC");
doTest("default", g, "ECIESwithDESEDE", params);
// Testing ECIES with 192-bit curve using DES
g.initialize(192, new SecureRandom());
doTest("192-bit", g, "ECIESwithDESEDE", params);
// Testing ECIES with 256-bit curve using DES
g.initialize(256, new SecureRandom());
doTest("256-bit", g, "ECIESwithDESEDE", params);
c1 = new org.bouncycastle.jcajce.provider.asymmetric.ec.IESCipher.ECIESwithAES();
c2 = new org.bouncycastle.jcajce.provider.asymmetric.ec.IESCipher.ECIESwithAES();
params = new IESParameterSpec(derivation, encoding, 128, 128);
// Testing ECIES with default curve using AES
g = KeyPairGenerator.getInstance("EC", "BC");
doTest("default", g, "ECIESwithAES", params);
// Testing ECIES with 192-bit curve using AES
g.initialize(192, new SecureRandom());
doTest("192-bit", g, "ECIESwithAES", params);
// Testing ECIES with 256-bit curve using AES
g.initialize(256, new SecureRandom());
doTest("256-bit", g, "ECIESwithAES", params);
}