696697698699700701702703704705706
// int inputOffset, int inputLen, byte[] output, int // outputOffset) // throws ShortBufferException - if the given output buffer is // too // small to hold the result ecipher.update(new byte[20], 0, 20, cipherText); fail("failed exception test - no ShortBufferException thrown"); } catch (ShortBufferException e) {
7576777879808182838485
Cipher.ENCRYPT_MODE, sk, new IvParameterSpec(Hex.decode("F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF"))); for (int j = 0; j != plain.length; j++) { byte[] crypt = c.update(plain[j]); if (!areEqual(crypt, cipher[i][j])) { fail("AESSIC encrypt failed: key " + i + " block " + j); } }
8889909192939495969798
Cipher.DECRYPT_MODE, sk, new IvParameterSpec(Hex.decode("F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF"))); for (int j = 0; j != plain.length; j++) { byte[] crypt = c.update(cipher[i][j]); if (!areEqual(crypt, plain[j])) { fail("AESSIC decrypt failed: key " + i + " block " + j); } }
9899100101102103104105106107108
// int outLen = c1.update(in, 0, 2, out1, 0); outLen += c1.doFinal(in, 2, in.length - 2, out1, outLen); outLen = c2.update(out1, 0, 2, out2, 0); outLen += c2.doFinal(out1, 2, out1.length - 2, out2, outLen); if (!areEqual(in, out2)) {
145146147148149150151152153154155
// c = Cipher.getInstance("RSA", "BC"); c.init(Cipher.ENCRYPT_MODE, pubKey, rand); c.update(input); out = c.doFinal(); if (!areEqual(out, output[0])) {
10241025102610271028102910301031103210331034
if (serializedData != null) { int numBytes; byte[] buf = new byte[8192]; ByteArrayOutputStream baos = new ByteArrayOutputStream(); while ((numBytes = serializedData.read(buf)) != -1) { byte[] data = c.update(buf, 0, numBytes); baos.write(data); } baos.write(c.doFinal()); encryptedBytes = baos.toByteArray(); } else {
965966967968969970971972973974975
10341035103610371038103910401041104210431044
7273747576777879808182
byte[] verifierPrime = verifier.clone(); byte[] verifierHashPrime = verifierHash.clone(); try { rc4.update(verifierPrime, 0, verifierPrime.length, verifierPrime); rc4.update(verifierHashPrime, 0, verifierHashPrime.length, verifierHashPrime); } catch (ShortBufferException e) { throw new EncryptedDocumentException("buffer too short", e); }