test_class.file: java_src/src/test/java/com/google/crypto/tink/subtle/KwpTest.java
test_class.identifier: KwpTest
test_case.body: @Test
    public void testInvalidWrappingSizes() throws Exception {
      byte[] wrapKey = Random.randBytes(16);
      KeyWrap wrapper = new Kwp(wrapKey);
      for (int wrappedSize = 0; wrappedSize < 16; wrappedSize++) {
        try {
          wrapper.wrap(new byte[wrappedSize]);
          fail("Should not wrap short keys");
        } catch (GeneralSecurityException ex) {
          // expected
        }
      }
    }
test_case.class_method_signature: KwpTest.testInvalidWrappingSizes()
test_case.full_signature: @Test public void testInvalidWrappingSizes()
test_case.identifier: testInvalidWrappingSizes
test_case.invocations: randBytes wrap fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInvalidWrappingSizes()
focal_class.declarator: aesKey
focal_class.modifier: private final
focal_class.original_string: private final SecretKey aesKey;
focal_class.type: SecretKey
focal_class.var_name: aesKey
focal_class.declarator: MIN_WRAP_KEY_SIZE = 16
focal_class.modifier: static final
focal_class.original_string: static final int MIN_WRAP_KEY_SIZE = 16;
focal_class.type: int
focal_class.var_name: MIN_WRAP_KEY_SIZE
focal_class.declarator: MAX_WRAP_KEY_SIZE = 4096
focal_class.modifier: static final
focal_class.original_string: static final int MAX_WRAP_KEY_SIZE = 4096;
focal_class.type: int
focal_class.var_name: MAX_WRAP_KEY_SIZE
focal_class.declarator: ROUNDS = 6
focal_class.modifier: static final
focal_class.original_string: static final int ROUNDS = 6;
focal_class.type: int
focal_class.var_name: ROUNDS
focal_class.declarator: PREFIX = new byte[]{(byte) 0xa6, (byte) 0x59, (byte) 0x59, (byte) 0xa6}
focal_class.modifier: static final
focal_class.original_string: static final byte[] PREFIX = new byte[]{(byte) 0xa6, (byte) 0x59, (byte) 0x59, (byte) 0xa6};
focal_class.type: byte[]
focal_class.var_name: PREFIX
focal_class.file: java_src/src/main/java/com/google/crypto/tink/subtle/Kwp.java
focal_class.identifier: Kwp
focal_class.interfaces: implements KeyWrap
focal_class.class_method_signature: Kwp.Kwp(final byte[] key)
focal_class.full_signature: public  Kwp(final byte[] key)
focal_class.identifier: Kwp
focal_class.modifiers: public
focal_class.parameters: (final byte[] key)
focal_class.signature:  Kwp(final byte[] key)
focal_class.class_method_signature: Kwp.wrappingSize(int inputSize)
focal_class.full_signature: private int wrappingSize(int inputSize)
focal_class.identifier: wrappingSize
focal_class.modifiers: private
focal_class.parameters: (int inputSize)
focal_class.return: int
focal_class.signature: int wrappingSize(int inputSize)
focal_class.class_method_signature: Kwp.computeW(final byte[] iv, final byte[] key)
focal_class.full_signature: private byte[] computeW(final byte[] iv, final byte[] key)
focal_class.identifier: computeW
focal_class.modifiers: private
focal_class.parameters: (final byte[] iv, final byte[] key)
focal_class.return: byte[]
focal_class.signature: byte[] computeW(final byte[] iv, final byte[] key)
focal_class.class_method_signature: Kwp.invertW(final byte[] wrapped)
focal_class.full_signature: private byte[] invertW(final byte[] wrapped)
focal_class.identifier: invertW
focal_class.modifiers: private
focal_class.parameters: (final byte[] wrapped)
focal_class.return: byte[]
focal_class.signature: byte[] invertW(final byte[] wrapped)
focal_class.class_method_signature: Kwp.wrap(final byte[] data)
focal_class.full_signature: @Override public byte[] wrap(final byte[] data)
focal_class.identifier: wrap
focal_class.modifiers: @Override public
focal_class.parameters: (final byte[] data)
focal_class.return: byte[]
focal_class.signature: byte[] wrap(final byte[] data)
focal_class.class_method_signature: Kwp.unwrap(final byte[] data)
focal_class.full_signature: @Override public byte[] unwrap(final byte[] data)
focal_class.identifier: unwrap
focal_class.modifiers: @Override public
focal_class.parameters: (final byte[] data)
focal_class.return: byte[]
focal_class.signature: byte[] unwrap(final byte[] data)
focal_method.body: @Override
    public byte[] wrap(final byte[] data) throws GeneralSecurityException {
      if (data.length < MIN_WRAP_KEY_SIZE) {
        throw new GeneralSecurityException("Key size of key to wrap too small");
      }
      if (data.length > MAX_WRAP_KEY_SIZE) {
        throw new GeneralSecurityException("Key size of key to wrap too large");
      }
      byte[] iv = new byte[8];
      System.arraycopy(PREFIX, 0, iv, 0, PREFIX.length);
      for (int i = 0; i < 4; i++) {
        iv[4 + i] = (byte) ((data.length >> (8 * (3 - i))) & 0xff);
      }
      return computeW(iv, data);
    }
focal_method.class_method_signature: Kwp.wrap(final byte[] data)
focal_method.full_signature: @Override public byte[] wrap(final byte[] data)
focal_method.identifier: wrap
focal_method.invocations: arraycopy computeW
focal_method.modifiers: @Override public
focal_method.parameters: (final byte[] data)
focal_method.return: byte[]
focal_method.signature: byte[] wrap(final byte[] data)