Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All 68 failing test cases with develop ruleset & SELECT ALL strategy #13

Open
rakshitkr opened this issue Dec 7, 2020 · 1 comment
Open

Comments

@rakshitkr
Copy link
Collaborator

rakshitkr commented Dec 7, 2020

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.security.AlgorithmParameters;
import java.security.DigestException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.KeyManagementException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.KeyStore;
import java.security.KeyStore.Entry;
import java.security.KeyStore.LoadStoreParameter;
import java.security.KeyStore.ProtectionParameter;
import java.security.KeyStoreException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.Provider;
import java.security.SecureRandom;
import java.security.UnrecoverableEntryException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertSelector;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.PKIXBuilderParameters;
import java.security.spec.DSAParameterSpec;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.InvalidParameterSpecException;
import java.util.Set;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.Mac;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.ShortBufferException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.net.ssl.CertPathTrustManagerParameters;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.ManagerFactoryParameters;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;

import org.junit.Test;

import crypto.analysis.CrySLRulesetSelector.Ruleset;
import test.UsagePatternTestingFramework;
import test.assertions.Assertions;

public class AllFailingCasesTest extends UsagePatternTestingFramework {
	protected Ruleset getRuleSet() {
		return Ruleset.JavaCryptographicArchitecture;

	}

	@Test
	public void pKIXBuilderParametersValidTest2() throws InvalidAlgorithmParameterException {

		Set trustAnchors = null;
		CertSelector certSelector = null;

		PKIXBuilderParameters pKIXBuilderParameters0 = new PKIXBuilderParameters(trustAnchors, certSelector);
		Assertions.hasEnsuredPredicate(pKIXBuilderParameters0); // FAILS
		Assertions.mustBeInAcceptingState(pKIXBuilderParameters0); // FAILS

	}

	@Test
	public void trustManagerFactoryValidTest4()
			throws NoSuchAlgorithmException, IOException, KeyStoreException, CertificateException {

		InputStream fileinput = null;
		String keyStoreAlgorithm = null;
		char[] passwordIn = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.load(fileinput, passwordIn);
		Assertions.hasEnsuredPredicate(keyStore0);
		Assertions.mustBeInAcceptingState(keyStore0);

		TrustManagerFactory trustManagerFactory0 = TrustManagerFactory.getInstance("PKIX");
		trustManagerFactory0.init(keyStore0);
		TrustManager[] trustManager = trustManagerFactory0.getTrustManagers();
		Assertions.hasEnsuredPredicate(trustManagerFactory0); // FAILS
		Assertions.mustBeInAcceptingState(trustManagerFactory0);

	}

	@Test
	public void trustManagerFactoryValidTest5() throws NoSuchAlgorithmException, IOException, KeyStoreException,
			CertificateException, NoSuchProviderException {

		InputStream fileinput = null;
		String keyStoreAlgorithm = null;
		char[] passwordIn = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.load(fileinput, passwordIn);
		Assertions.hasEnsuredPredicate(keyStore0);
		Assertions.mustBeInAcceptingState(keyStore0);

		TrustManagerFactory trustManagerFactory0 = TrustManagerFactory.getInstance("PKIX", (String) null);
		trustManagerFactory0.init(keyStore0);
		TrustManager[] trustManager = trustManagerFactory0.getTrustManagers();
		Assertions.hasEnsuredPredicate(trustManagerFactory0); // FAILS
		Assertions.mustBeInAcceptingState(trustManagerFactory0);

	}

	@Test
	public void trustManagerFactoryValidTest6() throws NoSuchAlgorithmException, IOException, KeyStoreException,
			CertificateException, InvalidAlgorithmParameterException {

		InputStream fileinput = null;
		String keyStoreAlgorithm = null;
		char[] passwordIn = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.load(fileinput, passwordIn);
		Assertions.hasEnsuredPredicate(keyStore0);
		Assertions.mustBeInAcceptingState(keyStore0);

		CertSelector certSelector = null;

		PKIXBuilderParameters pKIXBuilderParameters0 = new PKIXBuilderParameters(keyStore0, certSelector);
		Assertions.hasEnsuredPredicate(pKIXBuilderParameters0);
		Assertions.mustBeInAcceptingState(pKIXBuilderParameters0);

		CertPathTrustManagerParameters certPathTrustManagerParameters0 = new CertPathTrustManagerParameters(
				pKIXBuilderParameters0);
		Assertions.hasEnsuredPredicate(certPathTrustManagerParameters0);
		Assertions.mustBeInAcceptingState(certPathTrustManagerParameters0);

		TrustManagerFactory trustManagerFactory0 = TrustManagerFactory.getInstance("PKIX");
		trustManagerFactory0.init(certPathTrustManagerParameters0);
		TrustManager[] trustManager = trustManagerFactory0.getTrustManagers();
		Assertions.hasEnsuredPredicate(trustManagerFactory0); // FAILS
		Assertions.mustBeInAcceptingState(trustManagerFactory0);

	}

	@Test
	public void secureRandomValidTest6() throws NoSuchAlgorithmException {

		int num = 0;

		SecureRandom secureRandom1 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom1.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom1);

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		secureRandom0.setSeed(genSeed);
		Assertions.hasEnsuredPredicate(secureRandom0); // FAILS
		Assertions.mustBeInAcceptingState(secureRandom0);

	}

	@Test
	public void secureRandomValidTest7() throws NoSuchAlgorithmException, NoSuchProviderException {

		int num = 0;

		SecureRandom secureRandom1 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom1.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom1);

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG", (String) null);
		secureRandom0.setSeed(genSeed);
		Assertions.hasEnsuredPredicate(secureRandom0); // FAILS
		Assertions.mustBeInAcceptingState(secureRandom0);

	}

	@Test
	public void secureRandomValidTest8() throws NoSuchAlgorithmException {

		int num = 0;

		SecureRandom secureRandom1 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom1.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom1);

		SecureRandom secureRandom0 = SecureRandom.getInstanceStrong();
		secureRandom0.setSeed(genSeed);
		Assertions.hasEnsuredPredicate(secureRandom0); // FAILS
		Assertions.mustBeInAcceptingState(secureRandom0);

	}

	@Test
	public void secureRandomValidTest9() throws NoSuchAlgorithmException {

		int num = 0;

		SecureRandom secureRandom1 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom1.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom1);

		SecureRandom secureRandom0 = new SecureRandom();
		secureRandom0.setSeed(genSeed);
		Assertions.hasEnsuredPredicate(secureRandom0); // FAILS
		Assertions.mustBeInAcceptingState(secureRandom0);

	}

	@Test
	public void secureRandomValidTest10() throws NoSuchAlgorithmException {

		int num = 0;

		SecureRandom secureRandom1 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom1.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom1);

		SecureRandom secureRandom0 = new SecureRandom(genSeed);
		secureRandom0.setSeed(genSeed);
		Assertions.hasEnsuredPredicate(secureRandom0); // FAILS
		Assertions.mustBeInAcceptingState(secureRandom0);

	}

	@Test
	public void secureRandomValidTest11() throws NoSuchAlgorithmException {

		long lSeed = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		secureRandom0.setSeed(lSeed);
		Assertions.hasEnsuredPredicate(secureRandom0); // FAILS
		Assertions.mustBeInAcceptingState(secureRandom0);

	}

	@Test
	public void sSLContextValidTest1() throws NoSuchAlgorithmException, KeyManagementException {

		TrustManager[] tms = null;
		KeyManager[] kms = null;

		SSLContext sSLContext0 = SSLContext.getInstance("TLSv1.2");
		sSLContext0.init(kms, tms, (SecureRandom) null);
		Assertions.hasEnsuredPredicate(sSLContext0); // FAILS
		Assertions.mustBeInAcceptingState(sSLContext0);

	}

	@Test
	public void sSLContextValidTest2()
			throws NoSuchAlgorithmException, KeyManagementException, NoSuchProviderException {

		TrustManager[] tms = null;
		KeyManager[] kms = null;

		SSLContext sSLContext0 = SSLContext.getInstance("TLSv1.2", (String) null);
		sSLContext0.init(kms, tms, (SecureRandom) null);
		Assertions.hasEnsuredPredicate(sSLContext0); // FAILS
		Assertions.mustBeInAcceptingState(sSLContext0);

	}

	@Test
	public void sSLContextValidTest3() throws NoSuchAlgorithmException, KeyManagementException {

		TrustManager[] tms = null;
		KeyManager[] kms = null;

		SSLContext sSLContext0 = SSLContext.getInstance("TLSv1.2");
		sSLContext0.init(kms, tms, (SecureRandom) null);
		SSLEngine sSLEngine = sSLContext0.createSSLEngine();
		Assertions.hasEnsuredPredicate(sSLContext0); // FAILS
		Assertions.mustBeInAcceptingState(sSLContext0);

	}

	@Test
	public void sSLContextValidTest4()
			throws NoSuchAlgorithmException, KeyManagementException, NoSuchProviderException {

		TrustManager[] tms = null;
		KeyManager[] kms = null;

		SSLContext sSLContext0 = SSLContext.getInstance("TLSv1.2", (String) null);
		sSLContext0.init(kms, tms, (SecureRandom) null);
		SSLEngine sSLEngine = sSLContext0.createSSLEngine();
		Assertions.hasEnsuredPredicate(sSLContext0); // FAILS
		Assertions.mustBeInAcceptingState(sSLContext0);

	}

	@Test
	public void sSLContextValidTest5() throws NoSuchAlgorithmException, KeyManagementException {

		TrustManager[] tms = null;
		KeyManager[] kms = null;

		SSLContext sSLContext0 = SSLContext.getInstance("TLSv1.2");
		sSLContext0.init(kms, tms, (SecureRandom) null);
		SSLEngine sSLEngine = sSLContext0.createSSLEngine((String) null, 0);
		Assertions.hasEnsuredPredicate(sSLContext0); // FAILS
		Assertions.mustBeInAcceptingState(sSLContext0);

	}

	@Test
	public void sSLParametersValidTest1() {

		SSLParameters sSLParameters0 = new SSLParameters(new String[] { "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" },
				new String[] { "TLSv1.2" });
		Assertions.hasEnsuredPredicate(sSLParameters0); // FAILS
		Assertions.mustBeInAcceptingState(sSLParameters0); // FAILS

	}

	@Test
	public void sSLParametersValidTest2() {

		SSLParameters sSLParameters0 = new SSLParameters(new String[] { "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" });
		sSLParameters0.setProtocols(new String[] { "TLSv1.2" });
		Assertions.hasEnsuredPredicate(sSLParameters0); // FAILS
		Assertions.mustBeInAcceptingState(sSLParameters0); // FAILS

	}

	@Test
	public void sSLParametersInvalidTest2() {

		SSLParameters sSLParameters0 = new SSLParameters(new String[] { "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" });
		Assertions.notHasEnsuredPredicate(sSLParameters0); // FAILS
		Assertions.mustNotBeInAcceptingState(sSLParameters0); // FAILS

	}

	@Test
	public void macInvalidTest9() throws IllegalStateException, BadPaddingException, NoSuchPaddingException,
			IllegalBlockSizeException, NoSuchAlgorithmException, InvalidKeyException, ShortBufferException {

		Certificate cert = null;
		byte[] plainText = null;
		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, cert);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText);
		Assertions.mustBeInAcceptingState(cipher0);

		int outOffset = 0;

		Mac mac0 = Mac.getInstance("HmacMD5");
		mac0.doFinal(cipherText, outOffset);
		Assertions.notHasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustNotBeInAcceptingState(mac0);

	}

	@Test
	public void macValidTest10() throws IllegalStateException, NoSuchAlgorithmException, InvalidKeyException {

		int offset = 0;
		int len = 0;
		byte[] pre_input = null;
		Key key = null;

		Mac mac0 = Mac.getInstance("HmacMD5");
		mac0.init(key);
		mac0.update(pre_input, offset, len);
		byte[] output1 = mac0.doFinal();
		Assertions.hasEnsuredPredicate(output1); // FAILS
		Assertions.mustBeInAcceptingState(mac0);

	}

	@Test
	public void macInvalidTest22() throws IllegalStateException, BadPaddingException, NoSuchPaddingException,
			IllegalBlockSizeException, NoSuchAlgorithmException, InvalidKeyException, ShortBufferException {

		Certificate cert = null;
		byte[] plainText = null;
		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, cert);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText);
		Assertions.mustBeInAcceptingState(cipher0);

		int outOffset = 0;
		byte inp = 0;

		Mac mac0 = Mac.getInstance("HmacMD5");
		mac0.update(inp);
		mac0.doFinal(cipherText, outOffset);
		Assertions.notHasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustNotBeInAcceptingState(mac0);

	}

	@Test
	public void keyPairGeneratorValidTest4() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException {

		BigInteger q = null;

		DSAParameterSpec dSAParameterSpec0 = new DSAParameterSpec(BigInteger.valueOf(2), q, BigInteger.valueOf(1));
		Assertions.hasEnsuredPredicate(dSAParameterSpec0);
		Assertions.mustBeInAcceptingState(dSAParameterSpec0);

		KeyPairGenerator keyPairGenerator0 = KeyPairGenerator.getInstance("RSA");
		keyPairGenerator0.initialize(dSAParameterSpec0);
		KeyPair keyPair = keyPairGenerator0.generateKeyPair();
		Assertions.hasEnsuredPredicate(keyPair); // FAILS
		Assertions.mustBeInAcceptingState(keyPairGenerator0);

	}

	@Test
	public void keyPairGeneratorValidTest5() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException {

		BigInteger q = null;

		DSAParameterSpec dSAParameterSpec0 = new DSAParameterSpec(BigInteger.valueOf(2), q, BigInteger.valueOf(1));
		Assertions.hasEnsuredPredicate(dSAParameterSpec0);
		Assertions.mustBeInAcceptingState(dSAParameterSpec0);

		KeyPairGenerator keyPairGenerator0 = KeyPairGenerator.getInstance("RSA");
		keyPairGenerator0.initialize(dSAParameterSpec0, (SecureRandom) null);
		KeyPair keyPair = keyPairGenerator0.generateKeyPair();
		Assertions.hasEnsuredPredicate(keyPair); // FAILS
		Assertions.mustBeInAcceptingState(keyPairGenerator0);

	}

	@Test
	public void keyManagerFactoryValidTest4() throws NoSuchAlgorithmException, UnrecoverableKeyException, IOException,
			KeyStoreException, CertificateException {

		InputStream fileinput = null;
		String keyStoreAlgorithm = null;
		char[] passwordIn = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.load(fileinput, passwordIn);
		Assertions.hasEnsuredPredicate(keyStore0);
		Assertions.mustBeInAcceptingState(keyStore0);

		char[] password = null;

		KeyManagerFactory keyManagerFactory0 = KeyManagerFactory.getInstance("PKIX");
		keyManagerFactory0.init(keyStore0, password);
		KeyManager[] keyManager = keyManagerFactory0.getKeyManagers();
		Assertions.notHasEnsuredPredicate(keyManager); // FAILS
		Assertions.mustBeInAcceptingState(keyManagerFactory0);

	}

	@Test
	public void keyManagerFactoryValidTest5() throws NoSuchAlgorithmException, UnrecoverableKeyException, IOException,
			KeyStoreException, CertificateException, NoSuchProviderException {

		InputStream fileinput = null;
		String keyStoreAlgorithm = null;
		char[] passwordIn = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.load(fileinput, passwordIn);
		Assertions.hasEnsuredPredicate(keyStore0);
		Assertions.mustBeInAcceptingState(keyStore0);

		char[] password = null;

		KeyManagerFactory keyManagerFactory0 = KeyManagerFactory.getInstance("PKIX", (String) null);
		keyManagerFactory0.init(keyStore0, password);
		KeyManager[] keyManager = keyManagerFactory0.getKeyManagers();
		Assertions.notHasEnsuredPredicate(keyManager); // FAILS
		Assertions.mustBeInAcceptingState(keyManagerFactory0);

	}

	@Test
	public void keyManagerFactoryValidTest6() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException {

		ManagerFactoryParameters params = null;

		KeyManagerFactory keyManagerFactory0 = KeyManagerFactory.getInstance("PKIX");
		keyManagerFactory0.init(params);
		KeyManager[] keyManager = keyManagerFactory0.getKeyManagers();
		Assertions.notHasEnsuredPredicate(keyManager); // FAILS
		Assertions.mustBeInAcceptingState(keyManagerFactory0);

	}

	@Test
	public void messageDigestInvalidTest3() throws NoSuchAlgorithmException {

		byte pre_inbyte = 0;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256");
		messageDigest0.update(pre_inbyte);
		byte[] out = messageDigest0.digest();
		Assertions.notHasEnsuredPredicate(out); // FAILS
		Assertions.mustNotBeInAcceptingState(messageDigest0); // FAILS

	}

	@Test
	public void messageDigestInvalidTest4() throws NoSuchAlgorithmException, NoSuchProviderException {

		byte pre_inbyte = 0;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256", (Provider) null);
		messageDigest0.update(pre_inbyte);
		byte[] out = messageDigest0.digest();
		Assertions.notHasEnsuredPredicate(out); // FAILS
		Assertions.mustNotBeInAcceptingState(messageDigest0); // FAILS

	}

	@Test
	public void messageDigestInvalidTest5() throws NoSuchAlgorithmException {

		byte[] pre_inbytearr = null;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256");
		messageDigest0.update(pre_inbytearr);
		byte[] out = messageDigest0.digest();
		Assertions.notHasEnsuredPredicate(out); // FAILS
		Assertions.mustNotBeInAcceptingState(messageDigest0); // FAILS

	}

	@Test
	public void messageDigestInvalidTest6() throws NoSuchAlgorithmException {

		byte[] pre_inbytearr = null;
		int pre_off = 0;
		int pre_len = 0;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256");
		messageDigest0.update(pre_inbytearr, pre_off, pre_len);
		byte[] out = messageDigest0.digest();
		Assertions.notHasEnsuredPredicate(out); // FAILS
		Assertions.mustNotBeInAcceptingState(messageDigest0); // FAILS

	}

	@Test
	public void messageDigestInvalidTest7() throws NoSuchAlgorithmException {

		ByteBuffer pre_inpBuf = null;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256");
		messageDigest0.update(pre_inpBuf);
		byte[] out = messageDigest0.digest();
		Assertions.notHasEnsuredPredicate(out); // FAILS
		Assertions.mustNotBeInAcceptingState(messageDigest0); // FAILS

	}

	@Test
	public void messageDigestInvalidTest8() throws NoSuchAlgorithmException, DigestException {

		int off = 0;
		byte pre_inbyte = 0;
		int len = 0;
		byte[] out = null;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256");
		messageDigest0.update(pre_inbyte);
		messageDigest0.digest(out, off, len);
		Assertions.notHasEnsuredPredicate(out); // FAILS
		Assertions.mustNotBeInAcceptingState(messageDigest0); // FAILS

	}

	@Test
	public void messageDigestInvalidTest9() throws NoSuchAlgorithmException {

		byte pre_inbyte = 0;
		byte[] inbytearr = null;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256");
		messageDigest0.update(pre_inbyte);
		byte[] out = messageDigest0.digest(inbytearr);
		Assertions.notHasEnsuredPredicate(out); // FAILS
		Assertions.mustNotBeInAcceptingState(messageDigest0); // FAILS

	}

	@Test
	public void messageDigestInvalidTest10() throws NoSuchAlgorithmException {

		byte[] inbytearr = null;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256");
		byte[] out = messageDigest0.digest(inbytearr);
		out = messageDigest0.digest();
		Assertions.hasEnsuredPredicate(out); // FAILS
		Assertions.mustNotBeInAcceptingState(messageDigest0);

	}

	@Test
	public void messageDigestInvalidTest11() throws NoSuchAlgorithmException, NoSuchProviderException {

		byte[] inbytearr = null;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256", (Provider) null);
		byte[] out = messageDigest0.digest(inbytearr);
		out = messageDigest0.digest();
		Assertions.hasEnsuredPredicate(out); // FAILS
		Assertions.mustNotBeInAcceptingState(messageDigest0);

	}

	@Test
	public void messageDigestInvalidTest12() throws NoSuchAlgorithmException, DigestException {

		int off = 0;
		byte[] inbytearr = null;
		int len = 0;
		byte[] out = null;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256");
		out = messageDigest0.digest(inbytearr);
		messageDigest0.digest(out, off, len);
		Assertions.hasEnsuredPredicate(out); // FAILS
		Assertions.mustNotBeInAcceptingState(messageDigest0);

	}

	@Test
	public void messageDigestInvalidTest13() throws NoSuchAlgorithmException {

		byte[] inbytearr = null;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256");
		byte[] out = messageDigest0.digest(inbytearr);
		out = messageDigest0.digest(inbytearr);
		Assertions.hasEnsuredPredicate(out); // FAILS
		Assertions.mustNotBeInAcceptingState(messageDigest0);

	}

	@Test
	public void messageDigestValidTest6() throws NoSuchAlgorithmException {

		byte[] pre_inbytearr = null;
		int pre_off = 0;
		byte[] inbytearr = null;
		int pre_len = 0;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256");
		byte[] out = messageDigest0.digest(inbytearr);
		messageDigest0.update(pre_inbytearr, pre_off, pre_len);
		out = messageDigest0.digest();
		Assertions.hasEnsuredPredicate(out); // FAILS
		Assertions.mustBeInAcceptingState(messageDigest0);

	}

	@Test
	public void messageDigestValidTest8() throws NoSuchAlgorithmException, DigestException {

		int off = 0;
		byte[] inbytearr = null;
		byte pre_inbyte = 0;
		int len = 0;
		byte[] out = null;

		MessageDigest messageDigest0 = MessageDigest.getInstance("SHA-256");
		out = messageDigest0.digest(inbytearr);
		messageDigest0.update(pre_inbyte);
		messageDigest0.digest(out, off, len);
		Assertions.hasEnsuredPredicate(out); // FAILS
		Assertions.mustBeInAcceptingState(messageDigest0);

	}

	@Test
	public void cipherInvalidTest23()
			throws NoSuchPaddingException, InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 29198, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		Assertions.hasEnsuredPredicate(pre_ciphertext);  // FAILS
		Assertions.mustNotBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherInvalidTest24()
			throws NoSuchPaddingException, InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 12457, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, secureRandom0);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		Assertions.hasEnsuredPredicate(pre_ciphertext);  // FAILS
		Assertions.mustNotBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherInvalidTest25() throws NoSuchPaddingException, InvalidKeySpecException, NoSuchAlgorithmException,
			InvalidKeyException, InvalidAlgorithmParameterException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 25312, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		IvParameterSpec ivParameterSpec0 = new IvParameterSpec(genSeed);
		Assertions.hasEnsuredPredicate(ivParameterSpec0);
		Assertions.mustBeInAcceptingState(ivParameterSpec0);

		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, ivParameterSpec0);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		Assertions.hasEnsuredPredicate(pre_ciphertext);  // FAILS
		Assertions.mustNotBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherInvalidTest26() throws NoSuchPaddingException, InvalidKeySpecException, NoSuchAlgorithmException,
			InvalidParameterSpecException, InvalidKeyException, InvalidAlgorithmParameterException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 25146, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		IvParameterSpec ivParameterSpec0 = new IvParameterSpec(genSeed);
		Assertions.hasEnsuredPredicate(ivParameterSpec0);
		Assertions.mustBeInAcceptingState(ivParameterSpec0);

		AlgorithmParameters algorithmParameters0 = AlgorithmParameters.getInstance("AES");
		algorithmParameters0.init(ivParameterSpec0);
		Assertions.hasEnsuredPredicate(algorithmParameters0);
		Assertions.mustBeInAcceptingState(algorithmParameters0);

		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, algorithmParameters0);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		Assertions.hasEnsuredPredicate(pre_ciphertext);  // FAILS
		Assertions.mustNotBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherInvalidTest27() throws NoSuchPaddingException, InvalidKeySpecException, NoSuchAlgorithmException,
			InvalidKeyException, InvalidAlgorithmParameterException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 12045, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		IvParameterSpec ivParameterSpec0 = new IvParameterSpec(genSeed);
		Assertions.hasEnsuredPredicate(ivParameterSpec0);
		Assertions.mustBeInAcceptingState(ivParameterSpec0);

		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, ivParameterSpec0, secureRandom0);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		Assertions.hasEnsuredPredicate(pre_ciphertext);  // FAILS
		Assertions.mustNotBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherInvalidTest28() throws NoSuchPaddingException, InvalidKeySpecException, NoSuchAlgorithmException,
			InvalidParameterSpecException, InvalidKeyException, InvalidAlgorithmParameterException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 25314, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		IvParameterSpec ivParameterSpec0 = new IvParameterSpec(genSeed);
		Assertions.hasEnsuredPredicate(ivParameterSpec0);
		Assertions.mustBeInAcceptingState(ivParameterSpec0);

		AlgorithmParameters algorithmParameters0 = AlgorithmParameters.getInstance("AES");
		algorithmParameters0.init(ivParameterSpec0);
		Assertions.hasEnsuredPredicate(algorithmParameters0);
		Assertions.mustBeInAcceptingState(algorithmParameters0);

		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, algorithmParameters0, secureRandom0);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		Assertions.hasEnsuredPredicate(pre_ciphertext); // FAILS
		Assertions.mustNotBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherValidTest13() throws BadPaddingException, NoSuchPaddingException, InvalidKeySpecException,
			IllegalBlockSizeException, NoSuchAlgorithmException, InvalidKeyException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 15583, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		byte[] plainText = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherValidTest14() throws BadPaddingException, NoSuchPaddingException, InvalidKeySpecException,
			IllegalBlockSizeException, NoSuchAlgorithmException, InvalidKeyException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 28745, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		byte[] plainText = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, secureRandom0);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherValidTest15()
			throws BadPaddingException, NoSuchPaddingException, InvalidKeySpecException, IllegalBlockSizeException,
			NoSuchAlgorithmException, InvalidKeyException, InvalidAlgorithmParameterException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 22583, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		IvParameterSpec ivParameterSpec0 = new IvParameterSpec(genSeed);
		Assertions.hasEnsuredPredicate(ivParameterSpec0);
		Assertions.mustBeInAcceptingState(ivParameterSpec0);

		byte[] plainText = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, ivParameterSpec0);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherValidTest16() throws BadPaddingException, NoSuchPaddingException, InvalidKeySpecException,
			IllegalBlockSizeException, NoSuchAlgorithmException, InvalidParameterSpecException, InvalidKeyException,
			InvalidAlgorithmParameterException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 27010, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		IvParameterSpec ivParameterSpec0 = new IvParameterSpec(genSeed);
		Assertions.hasEnsuredPredicate(ivParameterSpec0);
		Assertions.mustBeInAcceptingState(ivParameterSpec0);

		AlgorithmParameters algorithmParameters0 = AlgorithmParameters.getInstance("AES");
		algorithmParameters0.init(ivParameterSpec0);
		Assertions.hasEnsuredPredicate(algorithmParameters0);
		Assertions.mustBeInAcceptingState(algorithmParameters0);

		byte[] plainText = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, algorithmParameters0);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherValidTest17()
			throws BadPaddingException, NoSuchPaddingException, InvalidKeySpecException, IllegalBlockSizeException,
			NoSuchAlgorithmException, InvalidKeyException, InvalidAlgorithmParameterException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 25855, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		IvParameterSpec ivParameterSpec0 = new IvParameterSpec(genSeed);
		Assertions.hasEnsuredPredicate(ivParameterSpec0);
		Assertions.mustBeInAcceptingState(ivParameterSpec0);

		byte[] plainText = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, ivParameterSpec0, secureRandom0);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherValidTest18() throws BadPaddingException, NoSuchPaddingException, InvalidKeySpecException,
			IllegalBlockSizeException, NoSuchAlgorithmException, InvalidParameterSpecException, InvalidKeyException,
			InvalidAlgorithmParameterException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 23220, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		IvParameterSpec ivParameterSpec0 = new IvParameterSpec(genSeed);
		Assertions.hasEnsuredPredicate(ivParameterSpec0);
		Assertions.mustBeInAcceptingState(ivParameterSpec0);

		AlgorithmParameters algorithmParameters0 = AlgorithmParameters.getInstance("AES");
		algorithmParameters0.init(ivParameterSpec0);
		Assertions.hasEnsuredPredicate(algorithmParameters0);
		Assertions.mustBeInAcceptingState(algorithmParameters0);

		byte[] plainText = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, algorithmParameters0, secureRandom0);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherValidTest26() throws BadPaddingException, NoSuchPaddingException, InvalidKeySpecException,
			IllegalBlockSizeException, NoSuchAlgorithmException, InvalidKeyException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 19117, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		byte[] plainText = null;
		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherValidTest27() throws BadPaddingException, NoSuchPaddingException, InvalidKeySpecException,
			IllegalBlockSizeException, NoSuchAlgorithmException, InvalidKeyException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 14953, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		byte[] plainText = null;
		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, secureRandom0);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherValidTest28()
			throws BadPaddingException, NoSuchPaddingException, InvalidKeySpecException, IllegalBlockSizeException,
			NoSuchAlgorithmException, InvalidKeyException, InvalidAlgorithmParameterException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 26455, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		IvParameterSpec ivParameterSpec0 = new IvParameterSpec(genSeed);
		Assertions.hasEnsuredPredicate(ivParameterSpec0);
		Assertions.mustBeInAcceptingState(ivParameterSpec0);

		byte[] plainText = null;
		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, ivParameterSpec0);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherValidTest29() throws BadPaddingException, NoSuchPaddingException, InvalidKeySpecException,
			IllegalBlockSizeException, NoSuchAlgorithmException, InvalidParameterSpecException, InvalidKeyException,
			InvalidAlgorithmParameterException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 11221, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		IvParameterSpec ivParameterSpec0 = new IvParameterSpec(genSeed);
		Assertions.hasEnsuredPredicate(ivParameterSpec0);
		Assertions.mustBeInAcceptingState(ivParameterSpec0);

		AlgorithmParameters algorithmParameters0 = AlgorithmParameters.getInstance("AES");
		algorithmParameters0.init(ivParameterSpec0);
		Assertions.hasEnsuredPredicate(algorithmParameters0);
		Assertions.mustBeInAcceptingState(algorithmParameters0);

		byte[] plainText = null;
		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, algorithmParameters0);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherValidTest30()
			throws BadPaddingException, NoSuchPaddingException, InvalidKeySpecException, IllegalBlockSizeException,
			NoSuchAlgorithmException, InvalidKeyException, InvalidAlgorithmParameterException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 21043, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		IvParameterSpec ivParameterSpec0 = new IvParameterSpec(genSeed);
		Assertions.hasEnsuredPredicate(ivParameterSpec0);
		Assertions.mustBeInAcceptingState(ivParameterSpec0);

		byte[] plainText = null;
		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, ivParameterSpec0, secureRandom0);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void cipherValidTest31() throws BadPaddingException, NoSuchPaddingException, InvalidKeySpecException,
			IllegalBlockSizeException, NoSuchAlgorithmException, InvalidParameterSpecException, InvalidKeyException,
			InvalidAlgorithmParameterException {

		int num = 0;

		SecureRandom secureRandom0 = SecureRandom.getInstance("SHA1PRNG");
		byte[] genSeed = secureRandom0.generateSeed(num);
		Assertions.hasEnsuredPredicate(genSeed);
		Assertions.mustBeInAcceptingState(secureRandom0);

		int keylength = 0;
		char[] password = null;

		PBEKeySpec pBEKeySpec0 = new PBEKeySpec(password, genSeed, 25456, keylength);
		Assertions.hasEnsuredPredicate(pBEKeySpec0);

		SecretKeyFactory secretKeyFactory0 = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
		SecretKey secretKey = secretKeyFactory0.generateSecret(pBEKeySpec0);
		Assertions.hasEnsuredPredicate(secretKey);
		Assertions.mustBeInAcceptingState(secretKeyFactory0);

		IvParameterSpec ivParameterSpec0 = new IvParameterSpec(genSeed);
		Assertions.hasEnsuredPredicate(ivParameterSpec0);
		Assertions.mustBeInAcceptingState(ivParameterSpec0);

		AlgorithmParameters algorithmParameters0 = AlgorithmParameters.getInstance("AES");
		algorithmParameters0.init(ivParameterSpec0);
		Assertions.hasEnsuredPredicate(algorithmParameters0);
		Assertions.mustBeInAcceptingState(algorithmParameters0);

		byte[] plainText = null;
		byte[] pre_plaintext = null;

		Cipher cipher0 = Cipher.getInstance("RSA");
		cipher0.init(1, secretKey, algorithmParameters0, secureRandom0);
		byte[] pre_ciphertext = cipher0.update(pre_plaintext);
		byte[] cipherText = cipher0.doFinal(plainText);
		Assertions.hasEnsuredPredicate(cipherText); // FAILS
		Assertions.mustBeInAcceptingState(cipher0);
		pBEKeySpec0.clearPassword();
		Assertions.mustBeInAcceptingState(pBEKeySpec0);

	}

	@Test
	public void keyStoreInvalidTest10() throws NoSuchAlgorithmException, UnrecoverableKeyException, IOException,
			KeyStoreException, CertificateException {

		char[] passwordKey = null;
		String alias = null;
		Entry entry = null;
		InputStream fileinput = null;
		String keyStoreAlgorithm = null;
		String aliasSet = null;
		ProtectionParameter protParamSet = null;
		char[] passwordIn = null;
		LoadStoreParameter paramStore = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.load(fileinput, passwordIn);
		Key key = keyStore0.getKey(alias, passwordKey);
		keyStore0.setEntry(aliasSet, entry, protParamSet);
		keyStore0.store(paramStore);
		Assertions.hasEnsuredPredicate(key); // FAILS
		Assertions.mustNotBeInAcceptingState(keyStore0);

	}

	@Test
	public void keyStoreInvalidTest11() throws NoSuchAlgorithmException, UnrecoverableKeyException, IOException,
			KeyStoreException, CertificateException, NoSuchProviderException {

		char[] passwordKey = null;
		String alias = null;
		Entry entry = null;
		InputStream fileinput = null;
		String keyStoreAlgorithm = null;
		String aliasSet = null;
		ProtectionParameter protParamSet = null;
		char[] passwordIn = null;
		LoadStoreParameter paramStore = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm, (Provider) null);
		keyStore0.load(fileinput, passwordIn);
		Key key = keyStore0.getKey(alias, passwordKey);
		keyStore0.setEntry(aliasSet, entry, protParamSet);
		keyStore0.store(paramStore);
		Assertions.hasEnsuredPredicate(key); // FAILS
		Assertions.mustNotBeInAcceptingState(keyStore0);

	}

	@Test
	public void keyStoreInvalidTest12() throws NoSuchAlgorithmException, UnrecoverableKeyException, IOException,
			KeyStoreException, CertificateException {

		char[] passwordKey = null;
		String alias = null;
		Entry entry = null;
		LoadStoreParameter paramLoad = null;
		String keyStoreAlgorithm = null;
		String aliasSet = null;
		ProtectionParameter protParamSet = null;
		LoadStoreParameter paramStore = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.load(paramLoad);
		Key key = keyStore0.getKey(alias, passwordKey);
		keyStore0.setEntry(aliasSet, entry, protParamSet);
		keyStore0.store(paramStore);
		Assertions.hasEnsuredPredicate(key); // FAILS
		Assertions.mustNotBeInAcceptingState(keyStore0);

	}

	@Test
	public void keyStoreInvalidTest13() throws NoSuchAlgorithmException, UnrecoverableKeyException, IOException,
			KeyStoreException, CertificateException {

		char[] passwordKey = null;
		String alias = null;
		Entry entry = null;
		InputStream fileinput = null;
		String keyStoreAlgorithm = null;
		String aliasSet = null;
		ProtectionParameter protParamSet = null;
		OutputStream fileoutput = null;
		char[] passwordOut = null;
		char[] passwordIn = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.load(fileinput, passwordIn);
		Key key = keyStore0.getKey(alias, passwordKey);
		keyStore0.setEntry(aliasSet, entry, protParamSet);
		keyStore0.store(fileoutput, passwordOut);
		Assertions.hasEnsuredPredicate(key); // FAILS
		Assertions.mustNotBeInAcceptingState(keyStore0);

	}

	@Test
	public void keyStoreInvalidTest14() throws NoSuchAlgorithmException, IOException, KeyStoreException,
			CertificateException, UnrecoverableEntryException {

		String aliasGet = null;
		Entry entry = null;
		InputStream fileinput = null;
		String keyStoreAlgorithm = null;
		String aliasSet = null;
		ProtectionParameter protParamSet = null;
		char[] passwordIn = null;
		LoadStoreParameter paramStore = null;
		ProtectionParameter protParamGet = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.load(fileinput, passwordIn);
		keyStore0.getEntry(aliasGet, protParamGet);
		keyStore0.setEntry(aliasSet, entry, protParamSet);
		keyStore0.store(paramStore);
		Assertions.hasEnsuredPredicate(keyStore0); // FAILS
		Assertions.mustNotBeInAcceptingState(keyStore0);

	}

	@Test
	public void keyStoreInvalidTest15() throws NoSuchAlgorithmException, IOException, KeyStoreException,
			CertificateException, NoSuchProviderException, UnrecoverableEntryException {

		String aliasGet = null;
		Entry entry = null;
		InputStream fileinput = null;
		String keyStoreAlgorithm = null;
		String aliasSet = null;
		ProtectionParameter protParamSet = null;
		char[] passwordIn = null;
		LoadStoreParameter paramStore = null;
		ProtectionParameter protParamGet = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm, (Provider) null);
		keyStore0.load(fileinput, passwordIn);
		keyStore0.getEntry(aliasGet, protParamGet);
		keyStore0.setEntry(aliasSet, entry, protParamSet);
		keyStore0.store(paramStore);
		Assertions.hasEnsuredPredicate(keyStore0);
		Assertions.mustNotBeInAcceptingState(keyStore0);

	}

	@Test
	public void keyStoreInvalidTest16() throws NoSuchAlgorithmException, IOException, KeyStoreException,
			CertificateException, UnrecoverableEntryException {

		String aliasGet = null;
		Entry entry = null;
		LoadStoreParameter paramLoad = null;
		String keyStoreAlgorithm = null;
		String aliasSet = null;
		ProtectionParameter protParamSet = null;
		LoadStoreParameter paramStore = null;
		ProtectionParameter protParamGet = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.load(paramLoad);
		keyStore0.getEntry(aliasGet, protParamGet);
		keyStore0.setEntry(aliasSet, entry, protParamSet);
		keyStore0.store(paramStore);
		Assertions.hasEnsuredPredicate(keyStore0);
		Assertions.mustNotBeInAcceptingState(keyStore0);

	}

	@Test
	public void keyStoreInvalidTest17() throws NoSuchAlgorithmException, IOException, KeyStoreException,
			CertificateException, UnrecoverableEntryException {

		String aliasGet = null;
		Entry entry = null;
		InputStream fileinput = null;
		String keyStoreAlgorithm = null;
		String aliasSet = null;
		ProtectionParameter protParamSet = null;
		OutputStream fileoutput = null;
		char[] passwordOut = null;
		char[] passwordIn = null;
		ProtectionParameter protParamGet = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.load(fileinput, passwordIn);
		keyStore0.getEntry(aliasGet, protParamGet);
		keyStore0.setEntry(aliasSet, entry, protParamSet);
		keyStore0.store(fileoutput, passwordOut);
		Assertions.hasEnsuredPredicate(keyStore0);
		Assertions.mustNotBeInAcceptingState(keyStore0);

	}

	@Test
	public void keyStoreInvalidTest7() throws NoSuchAlgorithmException, UnrecoverableKeyException, IOException,
			KeyStoreException, CertificateException, UnrecoverableEntryException {

		char[] passwordKey = null;
		String aliasGet = null;
		String alias = null;
		Entry entry = null;
		String keyStoreAlgorithm = null;
		String aliasSet = null;
		ProtectionParameter protParamSet = null;
		LoadStoreParameter paramStore = null;
		ProtectionParameter protParamGet = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.getEntry(aliasGet, protParamGet);
		Key key = keyStore0.getKey(alias, passwordKey);
		keyStore0.setEntry(aliasSet, entry, protParamSet);
		keyStore0.store(paramStore);
		Assertions.notHasEnsuredPredicate(key);
		Assertions.mustNotBeInAcceptingState(keyStore0); // FAILS

	}

	@Test
	public void keyStoreInvalidTest8() throws NoSuchAlgorithmException, UnrecoverableKeyException, IOException,
			KeyStoreException, CertificateException, NoSuchProviderException, UnrecoverableEntryException {

		char[] passwordKey = null;
		String aliasGet = null;
		String alias = null;
		Entry entry = null;
		String keyStoreAlgorithm = null;
		String aliasSet = null;
		ProtectionParameter protParamSet = null;
		LoadStoreParameter paramStore = null;
		ProtectionParameter protParamGet = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm, (Provider) null);
		keyStore0.getEntry(aliasGet, protParamGet);
		Key key = keyStore0.getKey(alias, passwordKey);
		keyStore0.setEntry(aliasSet, entry, protParamSet);
		keyStore0.store(paramStore);
		Assertions.notHasEnsuredPredicate(key);
		Assertions.mustNotBeInAcceptingState(keyStore0); // FAILS

	}

	@Test
	public void keyStoreInvalidTest9() throws NoSuchAlgorithmException, UnrecoverableKeyException, IOException,
			KeyStoreException, CertificateException, UnrecoverableEntryException {

		char[] passwordKey = null;
		String aliasGet = null;
		String alias = null;
		Entry entry = null;
		String keyStoreAlgorithm = null;
		String aliasSet = null;
		ProtectionParameter protParamSet = null;
		OutputStream fileoutput = null;
		char[] passwordOut = null;
		ProtectionParameter protParamGet = null;

		KeyStore keyStore0 = KeyStore.getInstance(keyStoreAlgorithm);
		keyStore0.getEntry(aliasGet, protParamGet);
		Key key = keyStore0.getKey(alias, passwordKey);
		keyStore0.setEntry(aliasSet, entry, protParamSet);
		keyStore0.store(fileoutput, passwordOut);
		Assertions.notHasEnsuredPredicate(key);
		Assertions.mustNotBeInAcceptingState(keyStore0); // FAILS

	}
}
@rakshitkr rakshitkr changed the title All failing test cases with develop ruleset All 68 failing test cases with develop ruleset Dec 7, 2020
@rakshitkr
Copy link
Collaborator Author

rakshitkr commented Dec 7, 2020

All the above test cases are generated based on Select All strategy with develop ruleset and fails on running CryptoAnalysis with the same ruleset.

@rakshitkr rakshitkr changed the title All 68 failing test cases with develop ruleset All 68 failing test cases with develop ruleset & SELECT ALL strategy Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant