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/subtle/RsaSsaPssSignJceTest.java
test_class.identifier: RsaSsaPssSignJceTest
test_case.body: @Test
    public void testZeroSaltLength() throws Exception {
      if (TestUtil.isTsan()) {
        // This test times out when running under thread sanitizer, so we just skip.
        return;
      }
      int keySize = 2048;
      KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
      keyGen.initialize(keySize);
      KeyPair keyPair = keyGen.generateKeyPair();
      RSAPublicKey pub = (RSAPublicKey) keyPair.getPublic();
      RSAPrivateCrtKey priv = (RSAPrivateCrtKey) keyPair.getPrivate();
  
      // Sign with RsaSsaPssSignJce.
      byte[] message = "Hello".getBytes(UTF_8);
      RsaSsaPssSignJce signer = new RsaSsaPssSignJce(priv, HashType.SHA256, HashType.SHA256, 0);
  
      byte[] signature = signer.sign(message);
      // Verify with JCE's Signature.
      RsaSsaPssVerifyJce verifier = new RsaSsaPssVerifyJce(pub, HashType.SHA256, HashType.SHA256, 0);
      try {
        verifier.verify(signature, message);
      } catch (GeneralSecurityException e) {
        throw new AssertionError("Valid signature, shouldn't throw exception", e);
      }
    }
test_case.class_method_signature: RsaSsaPssSignJceTest.testZeroSaltLength()
test_case.full_signature: @Test public void testZeroSaltLength()
test_case.identifier: testZeroSaltLength
test_case.invocations: isTsan getInstance initialize generateKeyPair getPublic getPrivate getBytes sign verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testZeroSaltLength()
focal_class.declarator: privateKey
focal_class.modifier: private final
focal_class.original_string: private final RSAPrivateCrtKey privateKey;
focal_class.type: RSAPrivateCrtKey
focal_class.var_name: privateKey
focal_class.declarator: publicKey
focal_class.modifier: private final
focal_class.original_string: private final RSAPublicKey publicKey;
focal_class.type: RSAPublicKey
focal_class.var_name: publicKey
focal_class.declarator: sigHash
focal_class.modifier: private final
focal_class.original_string: private final HashType sigHash;
focal_class.type: HashType
focal_class.var_name: sigHash
focal_class.declarator: mgf1Hash
focal_class.modifier: private final
focal_class.original_string: private final HashType mgf1Hash;
focal_class.type: HashType
focal_class.var_name: mgf1Hash
focal_class.declarator: saltLength
focal_class.modifier: private final
focal_class.original_string: private final int saltLength;
focal_class.type: int
focal_class.var_name: saltLength
focal_class.declarator: RAW_RSA_ALGORITHM = "RSA/ECB/NOPADDING"
focal_class.modifier: private static final
focal_class.original_string: private static final String RAW_RSA_ALGORITHM = "RSA/ECB/NOPADDING";
focal_class.type: String
focal_class.var_name: RAW_RSA_ALGORITHM
focal_class.file: java_src/src/main/java/com/google/crypto/tink/subtle/RsaSsaPssSignJce.java
focal_class.identifier: RsaSsaPssSignJce
focal_class.interfaces: implements PublicKeySign
focal_class.class_method_signature: RsaSsaPssSignJce.RsaSsaPssSignJce(
        final RSAPrivateCrtKey priv, HashType sigHash, HashType mgf1Hash, int saltLength)
focal_class.full_signature: public  RsaSsaPssSignJce(
        final RSAPrivateCrtKey priv, HashType sigHash, HashType mgf1Hash, int saltLength)
focal_class.identifier: RsaSsaPssSignJce
focal_class.modifiers: public
focal_class.parameters: (
        final RSAPrivateCrtKey priv, HashType sigHash, HashType mgf1Hash, int saltLength)
focal_class.signature:  RsaSsaPssSignJce(
        final RSAPrivateCrtKey priv, HashType sigHash, HashType mgf1Hash, int saltLength)
focal_class.class_method_signature: RsaSsaPssSignJce.sign(final byte[] data)
focal_class.full_signature: @Override public byte[] sign(final byte[] data)
focal_class.identifier: sign
focal_class.modifiers: @Override public
focal_class.parameters: (final byte[] data)
focal_class.return: byte[]
focal_class.signature: byte[] sign(final byte[] data)
focal_class.class_method_signature: RsaSsaPssSignJce.rsasp1(byte[] m)
focal_class.full_signature: private byte[] rsasp1(byte[] m)
focal_class.identifier: rsasp1
focal_class.modifiers: private
focal_class.parameters: (byte[] m)
focal_class.return: byte[]
focal_class.signature: byte[] rsasp1(byte[] m)
focal_class.class_method_signature: RsaSsaPssSignJce.emsaPssEncode(byte[] m, int emBits)
focal_class.full_signature: private byte[] emsaPssEncode(byte[] m, int emBits)
focal_class.identifier: emsaPssEncode
focal_class.modifiers: private
focal_class.parameters: (byte[] m, int emBits)
focal_class.return: byte[]
focal_class.signature: byte[] emsaPssEncode(byte[] m, int emBits)
focal_method.body: @Override
    public byte[] sign(final byte[] data) throws GeneralSecurityException {
      // https://tools.ietf.org/html/rfc8017#section-8.1.1.
      int modBits = publicKey.getModulus().bitLength();
  
      byte[] em = emsaPssEncode(data, modBits - 1);
      return rsasp1(em);
    }
focal_method.class_method_signature: RsaSsaPssSignJce.sign(final byte[] data)
focal_method.full_signature: @Override public byte[] sign(final byte[] data)
focal_method.identifier: sign
focal_method.invocations: bitLength getModulus emsaPssEncode rsasp1
focal_method.modifiers: @Override public
focal_method.parameters: (final byte[] data)
focal_method.return: byte[]
focal_method.signature: byte[] sign(final byte[] data)