test_class.declarator: UTF_8 = Charset.forName("UTF-8")
test_class.modifier: private static final
test_class.original_string: private static final Charset UTF_8 = Charset.forName("UTF-8");
test_class.type: Charset
test_class.var_name: UTF_8
test_class.file: java_src/src/test/java/com/google/crypto/tink/hybrid/subtle/RsaKemTest.java
test_class.identifier: RsaKemTest
test_case.body: @Test
    public void bigIntToByteArray_approximate() throws Exception {
      int expectedSize = 2048;
      BigInteger bigInt = new BigInteger(2048, new Random());
      byte[] bigIntBytes = RsaKem.bigIntToByteArray(bigInt, expectedSize);
  
      assertThat(bigIntBytes).hasLength(expectedSize);
      assertThat(new BigInteger(1, bigIntBytes)).isEqualTo(bigInt);
    }
test_case.class_method_signature: RsaKemTest.bigIntToByteArray_approximate()
test_case.full_signature: @Test public void bigIntToByteArray_approximate()
test_case.identifier: bigIntToByteArray_approximate
test_case.invocations: bigIntToByteArray hasLength assertThat isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void bigIntToByteArray_approximate()
focal_class.declarator: EMPTY_AAD = new byte[0]
focal_class.modifier: static final
focal_class.original_string: static final byte[] EMPTY_AAD = new byte[0];
focal_class.type: byte[]
focal_class.var_name: EMPTY_AAD
focal_class.declarator: MIN_RSA_KEY_LENGTH_BITS = 2048
focal_class.modifier: static final
focal_class.original_string: static final int MIN_RSA_KEY_LENGTH_BITS = 2048;
focal_class.type: int
focal_class.var_name: MIN_RSA_KEY_LENGTH_BITS
focal_class.file: java_src/src/main/java/com/google/crypto/tink/hybrid/subtle/RsaKem.java
focal_class.identifier: RsaKem
focal_class.class_method_signature: RsaKem.RsaKem()
focal_class.full_signature: private  RsaKem()
focal_class.identifier: RsaKem
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  RsaKem()
focal_class.class_method_signature: RsaKem.validateRsaModulus(BigInteger mod)
focal_class.full_signature: static void validateRsaModulus(BigInteger mod)
focal_class.identifier: validateRsaModulus
focal_class.modifiers: static
focal_class.parameters: (BigInteger mod)
focal_class.return: void
focal_class.signature: void validateRsaModulus(BigInteger mod)
focal_class.class_method_signature: RsaKem.bigIntSizeInBytes(BigInteger mod)
focal_class.full_signature: static int bigIntSizeInBytes(BigInteger mod)
focal_class.identifier: bigIntSizeInBytes
focal_class.modifiers: static
focal_class.parameters: (BigInteger mod)
focal_class.return: int
focal_class.signature: int bigIntSizeInBytes(BigInteger mod)
focal_class.class_method_signature: RsaKem.bigIntToByteArray(BigInteger bigInt, int size)
focal_class.full_signature: static byte[] bigIntToByteArray(BigInteger bigInt, int size)
focal_class.identifier: bigIntToByteArray
focal_class.modifiers: static
focal_class.parameters: (BigInteger bigInt, int size)
focal_class.return: byte[]
focal_class.signature: byte[] bigIntToByteArray(BigInteger bigInt, int size)
focal_class.class_method_signature: RsaKem.generateSecret(BigInteger max)
focal_class.full_signature: static byte[] generateSecret(BigInteger max)
focal_class.identifier: generateSecret
focal_class.modifiers: static
focal_class.parameters: (BigInteger max)
focal_class.return: byte[]
focal_class.signature: byte[] generateSecret(BigInteger max)
focal_class.class_method_signature: RsaKem.generateRsaKeyPair(int keySize)
focal_class.full_signature: static KeyPair generateRsaKeyPair(int keySize)
focal_class.identifier: generateRsaKeyPair
focal_class.modifiers: static
focal_class.parameters: (int keySize)
focal_class.return: KeyPair
focal_class.signature: KeyPair generateRsaKeyPair(int keySize)
focal_method.body: static byte[] bigIntToByteArray(BigInteger bigInt, int size) {
      byte[] value = bigInt.toByteArray();
      if (value.length == size) {
        return value;
      }
  
      byte[] result = new byte[size];
      if (value.length == result.length + 1) {
        if (value[0] != 0) {
          throw new IllegalArgumentException(
              "Value is one-byte longer than the expected size, but its first byte is not 0");
        }
        System.arraycopy(value, 1, result, 0, result.length);
      } else if (value.length < result.length) {
        System.arraycopy(value, 0, result, result.length - value.length, value.length);
      } else {
        throw new IllegalArgumentException(
            String.format(
                "Value has invalid length, must be of length at most (%d + 1), but" + " got %d",
                size, value.length));
      }
      return result;
    }
focal_method.class_method_signature: RsaKem.bigIntToByteArray(BigInteger bigInt, int size)
focal_method.full_signature: static byte[] bigIntToByteArray(BigInteger bigInt, int size)
focal_method.identifier: bigIntToByteArray
focal_method.invocations: toByteArray arraycopy arraycopy format
focal_method.modifiers: static
focal_method.parameters: (BigInteger bigInt, int size)
focal_method.return: byte[]
focal_method.signature: byte[] bigIntToByteArray(BigInteger bigInt, int size)