{
SecureRandom rand = new SecureRandom(new byte[20]);
rand.setSeed(System.currentTimeMillis());
TestResult res = testPadding(new PKCS7Padding(), rand,
Hex.decode("ffffff0505050505"),
Hex.decode("0000000004040404"));
if (!res.isSuccessful())
{
return res;
}
res = testPadding(new ISO10126d2Padding(), rand,
null,
null);
if (!res.isSuccessful())
{
return res;
}
res = testPadding(new X923Padding(), rand,
null,
null);
if (!res.isSuccessful())
{
return res;
}
res = testPadding(new TBCPadding(), rand,
Hex.decode("ffffff0000000000"),
Hex.decode("00000000ffffffff"));
if (!res.isSuccessful())
{
return res;
}
res = testPadding(new ZeroBytePadding(), rand,
Hex.decode("ffffff0000000000"),
null);
if (!res.isSuccessful())
{
return res;
}
return new SimpleTestResult(true, getName() + ": Okay");