// Path: lib/src/main/java/com/google/capillary/RsaEcdsaConstants.java
// public enum Padding {
//   OAEP("OAEPPadding"),
//   PKCS1("PKCS1Padding");
// 
//   private static final String PREFIX = "RSA/ECB/";
// 
//   private final String padding;
// 
//   Padding(String val) {
//     padding = val;
//   }
// 
//   /**
//    * Returns the current padding enum's transformation string that should be used when calling
//    * {@code javax.crypto.Cipher.getInstance}.
//    *
//    * @return the transformation string.
//    */
//   public String getTransformation() {
//     return PREFIX + padding;
//   }
// }


import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.fail;
import com.google.capillary.RsaEcdsaConstants.Padding;
import com.google.crypto.tink.HybridDecrypt;
import com.google.crypto.tink.HybridEncrypt;
import com.google.crypto.tink.PublicKeySign;
import com.google.crypto.tink.PublicKeyVerify;
import com.google.crypto.tink.subtle.Random;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.util.Arrays;
import org.junit.Test;
/*
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.capillary;



@RunWith(JUnit4.class)
public final class RsaEcdsaHybridDecryptTest {

  private final PublicKeySign senderSigner;
  private final PublicKeyVerify senderVerifier;
  private final PublicKey recipientPublicKey;
  private final PrivateKey recipientPrivateKey;

  /**
   * Creates a new {@link RsaEcdsaHybridDecryptTest} instance.
   */
  public RsaEcdsaHybridDecryptTest() throws GeneralSecurityException, IOException {
    Config.initialize();
    senderSigner = TestUtils.createTestSenderSigner();
    senderVerifier = TestUtils.createTestSenderVerifier();
    recipientPublicKey = TestUtils.createTestRsaPublicKey();
    recipientPrivateKey = TestUtils.createTestRsaPrivateKey();
  }

  @Test
  public void testModifyCiphertext() throws GeneralSecurityException {
    byte[] plaintext = Random.randBytes(20);

    // Try Encryption/Decryption for each padding mode.
// Path: lib/src/main/java/com/google/capillary/RsaEcdsaConstants.java
// public enum Padding {
//   OAEP("OAEPPadding"),
//   PKCS1("PKCS1Padding");
// 
//   private static final String PREFIX = "RSA/ECB/";
// 
//   private final String padding;
// 
//   Padding(String val) {
//     padding = val;
//   }
// 
//   /**
//    * Returns the current padding enum's transformation string that should be used when calling
//    * {@code javax.crypto.Cipher.getInstance}.
//    *
//    * @return the transformation string.
//    */
//   public String getTransformation() {
//     return PREFIX + padding;
//   }
// }


// Path: lib/src/test/java/com/google/capillary/RsaEcdsaHybridDecryptTest.java
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.fail;
import com.google.capillary.RsaEcdsaConstants.Padding;
import com.google.crypto.tink.HybridDecrypt;
import com.google.crypto.tink.HybridEncrypt;
import com.google.crypto.tink.PublicKeySign;
import com.google.crypto.tink.PublicKeyVerify;
import com.google.crypto.tink.subtle.Random;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.util.Arrays;
import org.junit.Test;

/*
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.capillary;



@RunWith(JUnit4.class)
public final class RsaEcdsaHybridDecryptTest {

  private final PublicKeySign senderSigner;
  private final PublicKeyVerify senderVerifier;
  private final PublicKey recipientPublicKey;
  private final PrivateKey recipientPrivateKey;

  /**
   * Creates a new {@link RsaEcdsaHybridDecryptTest} instance.
   */
  public RsaEcdsaHybridDecryptTest() throws GeneralSecurityException, IOException {
    Config.initialize();
    senderSigner = TestUtils.createTestSenderSigner();
    senderVerifier = TestUtils.createTestSenderVerifier();
    recipientPublicKey = TestUtils.createTestRsaPublicKey();
    recipientPrivateKey = TestUtils.createTestRsaPrivateKey();
  }

  @Test
  public void testModifyCiphertext() throws GeneralSecurityException {
    byte[] plaintext = Random.randBytes(20);

    // Try Encryption/Decryption for each padding mode.
    for (Padding padding : Padding.values()) {