{
byte[] derivation = Hex.decode("202122232425262728292a2b2c2d2e2f");
byte[] encoding = Hex.decode("303132333435363738393a3b3c3d3e3f");
IESCipher c1 = new org.bouncycastle.jcajce.provider.asymmetric.dh.IESCipher.IES();
IESCipher c2 = new org.bouncycastle.jcajce.provider.asymmetric.dh.IESCipher.IES();
IESParameterSpec params = new IESParameterSpec(derivation,encoding,128);
// Testing DHIES with default prime in streaming mode
KeyPairGenerator g = KeyPairGenerator.getInstance("DH", "BC");
g.initialize(param);
doTest("DHIES with default", g, "DHIES", params);
// Testing DHIES with 512-bit prime in streaming mode
g.initialize(512, new SecureRandom());
doTest("DHIES with 512-bit", g, "DHIES", params);
// Testing ECIES with 1024-bit prime in streaming mode
g.initialize(1024, new SecureRandom());
doTest("DHIES with 1024-bit", g, "DHIES", params);
c1 = new IESCipher(new IESEngine(new DHBasicAgreement(),
new KDF2BytesGenerator(new SHA1Digest()),
new HMac(new SHA1Digest()),
new PaddedBufferedBlockCipher(new DESEngine())));
c2 = new IESCipher(new IESEngine(new DHBasicAgreement(),
new KDF2BytesGenerator(new SHA1Digest()),
new HMac(new SHA1Digest()),
new PaddedBufferedBlockCipher(new DESEngine())));
params = new IESParameterSpec(derivation, encoding, 128, 192);