public void performTest() { checkMask(1, new KDF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1); checkMask(2, new KDF1BytesGenerator(new SHA1Digest()), seed2, mask2); checkMask(3, new KDF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed3, mask3); try { new KDF1BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20); fail("short input array not caught"); } catch (DataLengthException e) { // expected } }