test_class.declarator: NIST_KEY = "2b7e151628aed2a6abf7158809cf4f3c"
test_class.modifier: private static final
test_class.original_string: private static final String NIST_KEY = "2b7e151628aed2a6abf7158809cf4f3c";
test_class.type: String
test_class.var_name: NIST_KEY
test_class.declarator: NIST_PLAINTEXT =
        "6bc1bee22e409f96e93d7e117393172a"
            + "ae2d8a571e03ac9c9eb76fac45af8e51"
            + "30c81c46a35ce411e5fbc1191a0a52ef"
            + "f69f2445df4f9b17ad2b417be66c3710"
test_class.modifier: private static final
test_class.original_string: private static final String NIST_PLAINTEXT =
        "6bc1bee22e409f96e93d7e117393172a"
            + "ae2d8a571e03ac9c9eb76fac45af8e51"
            + "30c81c46a35ce411e5fbc1191a0a52ef"
            + "f69f2445df4f9b17ad2b417be66c3710";
test_class.type: String
test_class.var_name: NIST_PLAINTEXT
test_class.declarator: NIST_CIPHERTEXT =
        "874d6191b620e3261bef6864990db6ce"
            + "9806f66b7970fdff8617187bb9fffdff"
            + "5ae4df3edbd5d35e5b4f09020db03eab"
            + "1e031dda2fbe03d1792170a0f3009cee"
test_class.modifier: private static final
test_class.original_string: private static final String NIST_CIPHERTEXT =
        "874d6191b620e3261bef6864990db6ce"
            + "9806f66b7970fdff8617187bb9fffdff"
            + "5ae4df3edbd5d35e5b4f09020db03eab"
            + "1e031dda2fbe03d1792170a0f3009cee";
test_class.type: String
test_class.var_name: NIST_CIPHERTEXT
test_class.declarator: NIST_IV = "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"
test_class.modifier: private static final
test_class.original_string: private static final String NIST_IV = "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff";
test_class.type: String
test_class.var_name: NIST_IV
test_class.declarator: PLAINTEXT =
        "I'm counter mode and I'm not vulnerable to padding oracle attack like CBC mode"
test_class.modifier: private static final
test_class.original_string: private static final String PLAINTEXT =
        "I'm counter mode and I'm not vulnerable to padding oracle attack like CBC mode";
test_class.type: String
test_class.var_name: PLAINTEXT
test_class.declarator: msg
test_class.modifier: private
test_class.original_string: private byte[] msg;
test_class.type: byte[]
test_class.var_name: msg
test_class.file: java_src/src/test/java/com/google/crypto/tink/subtle/AesCtrJceCipherTest.java
test_class.identifier: AesCtrJceCipherTest
test_case.body: @Test
    public void testNistVector() throws Exception {
      byte[] rawCiphertext = TestUtil.hexDecode(NIST_CIPHERTEXT);
      byte[] iv = TestUtil.hexDecode(NIST_IV);
      byte[] ciphertext = new byte[iv.length + rawCiphertext.length];
      System.arraycopy(iv, 0, ciphertext, 0, iv.length);
      System.arraycopy(rawCiphertext, 0, ciphertext, iv.length, rawCiphertext.length);
      AesCtrJceCipher cipher = new AesCtrJceCipher(TestUtil.hexDecode(NIST_KEY), iv.length);
      assertArrayEquals(TestUtil.hexDecode(NIST_PLAINTEXT), cipher.decrypt(ciphertext));
    }
test_case.class_method_signature: AesCtrJceCipherTest.testNistVector()
test_case.full_signature: @Test public void testNistVector()
test_case.identifier: testNistVector
test_case.invocations: hexDecode hexDecode arraycopy arraycopy hexDecode assertArrayEquals hexDecode decrypt
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNistVector()
focal_class.declarator: localCipher =
        new ThreadLocal<Cipher>() {
          @Override
          protected Cipher initialValue() {
            try {
              return EngineFactory.CIPHER.getInstance(CIPHER_ALGORITHM);
            } catch (GeneralSecurityException ex) {
              throw new IllegalStateException(ex);
            }
          }
        }
focal_class.modifier: private static final
focal_class.original_string: private static final ThreadLocal<Cipher> localCipher =
        new ThreadLocal<Cipher>() {
          @Override
          protected Cipher initialValue() {
            try {
              return EngineFactory.CIPHER.getInstance(CIPHER_ALGORITHM);
            } catch (GeneralSecurityException ex) {
              throw new IllegalStateException(ex);
            }
          }
        };
focal_class.type: ThreadLocal<Cipher>
focal_class.var_name: localCipher
focal_class.declarator: KEY_ALGORITHM = "AES"
focal_class.modifier: private static final
focal_class.original_string: private static final String KEY_ALGORITHM = "AES";
focal_class.type: String
focal_class.var_name: KEY_ALGORITHM
focal_class.declarator: CIPHER_ALGORITHM = "AES/CTR/NoPadding"
focal_class.modifier: private static final
focal_class.original_string: private static final String CIPHER_ALGORITHM = "AES/CTR/NoPadding";
focal_class.type: String
focal_class.var_name: CIPHER_ALGORITHM
focal_class.declarator: MIN_IV_SIZE_IN_BYTES = 12
focal_class.modifier: private static final
focal_class.original_string: private static final int MIN_IV_SIZE_IN_BYTES = 12;
focal_class.type: int
focal_class.var_name: MIN_IV_SIZE_IN_BYTES
focal_class.declarator: keySpec
focal_class.modifier: private final
focal_class.original_string: private final SecretKeySpec keySpec;
focal_class.type: SecretKeySpec
focal_class.var_name: keySpec
focal_class.declarator: ivSize
focal_class.modifier: private final
focal_class.original_string: private final int ivSize;
focal_class.type: int
focal_class.var_name: ivSize
focal_class.declarator: blockSize
focal_class.modifier: private final
focal_class.original_string: private final int blockSize;
focal_class.type: int
focal_class.var_name: blockSize
focal_class.file: java_src/src/main/java/com/google/crypto/tink/subtle/AesCtrJceCipher.java
focal_class.identifier: AesCtrJceCipher
focal_class.interfaces: implements IndCpaCipher
focal_class.class_method_signature: AesCtrJceCipher.AesCtrJceCipher(final byte[] key, int ivSize)
focal_class.full_signature: public  AesCtrJceCipher(final byte[] key, int ivSize)
focal_class.identifier: AesCtrJceCipher
focal_class.modifiers: public
focal_class.parameters: (final byte[] key, int ivSize)
focal_class.signature:  AesCtrJceCipher(final byte[] key, int ivSize)
focal_class.class_method_signature: AesCtrJceCipher.encrypt(final byte[] plaintext)
focal_class.full_signature: @Override public byte[] encrypt(final byte[] plaintext)
focal_class.identifier: encrypt
focal_class.modifiers: @Override public
focal_class.parameters: (final byte[] plaintext)
focal_class.return: byte[]
focal_class.signature: byte[] encrypt(final byte[] plaintext)
focal_class.class_method_signature: AesCtrJceCipher.decrypt(final byte[] ciphertext)
focal_class.full_signature: @Override public byte[] decrypt(final byte[] ciphertext)
focal_class.identifier: decrypt
focal_class.modifiers: @Override public
focal_class.parameters: (final byte[] ciphertext)
focal_class.return: byte[]
focal_class.signature: byte[] decrypt(final byte[] ciphertext)
focal_class.class_method_signature: AesCtrJceCipher.doCtr(
        final byte[] input,
        int inputOffset,
        int inputLen,
        byte[] output,
        int outputOffset,
        final byte[] iv,
        boolean encrypt)
focal_class.full_signature: private void doCtr(
        final byte[] input,
        int inputOffset,
        int inputLen,
        byte[] output,
        int outputOffset,
        final byte[] iv,
        boolean encrypt)
focal_class.identifier: doCtr
focal_class.modifiers: private
focal_class.parameters: (
        final byte[] input,
        int inputOffset,
        int inputLen,
        byte[] output,
        int outputOffset,
        final byte[] iv,
        boolean encrypt)
focal_class.return: void
focal_class.signature: void doCtr(
        final byte[] input,
        int inputOffset,
        int inputLen,
        byte[] output,
        int outputOffset,
        final byte[] iv,
        boolean encrypt)
focal_method.body: @Override
    public byte[] decrypt(final byte[] ciphertext) throws GeneralSecurityException {
      if (ciphertext.length < ivSize) {
        throw new GeneralSecurityException("ciphertext too short");
      }
      byte[] iv = new byte[ivSize];
      System.arraycopy(ciphertext, 0, iv, 0, ivSize);
      byte[] plaintext = new byte[ciphertext.length - ivSize];
      doCtr(ciphertext, ivSize, ciphertext.length - ivSize, plaintext, 0, iv, false);
      return plaintext;
    }
focal_method.class_method_signature: AesCtrJceCipher.decrypt(final byte[] ciphertext)
focal_method.full_signature: @Override public byte[] decrypt(final byte[] ciphertext)
focal_method.identifier: decrypt
focal_method.invocations: arraycopy doCtr
focal_method.modifiers: @Override public
focal_method.parameters: (final byte[] ciphertext)
focal_method.return: byte[]
focal_method.signature: byte[] decrypt(final byte[] ciphertext)