Info Call to Crypto API

Description

List of all calls to cryptographic methods.

Recommendation

Do not use insecure or weak cryptographic algorithms. For example, the Data Encryption Standard (DES) encryption algorithm is considered highly insecure

Do not use Object.equals() to compare cryptographic keys

Cryptographic keys should never be serialized

Technical details

Method org.spongycastle.pkcs.jcajce.JcePKCSPBEInputDecryptorProviderBuilder$1.get() calling method javax.crypto.spec.IvParameterSpec.<init>()


    public org.spongycastle.operator.InputDecryptor get(org.spongycastle.asn1.x509.AlgorithmIdentifier p20)
    {
        org.spongycastle.asn1.ASN1ObjectIdentifier v9 = p20.getAlgorithm();
        try {
            if (!v9.on(org.spongycastle.asn1.pkcs.PKCSObjectIdentifiers.pkcs_12PbeIds)) {
                if (v9.equals(org.spongycastle.asn1.pkcs.PKCSObjectIdentifiers.id_PBES2)) {
                    javax.crypto.SecretKey v15;
                    org.spongycastle.asn1.pkcs.PBES2Parameters v8 = org.spongycastle.asn1.pkcs.PBES2Parameters.getInstance(p20.getParameters());
                    org.spongycastle.asn1.pkcs.PBKDF2Params v13 = org.spongycastle.asn1.pkcs.PBKDF2Params.getInstance(v8.getKeyDerivationFunc().getParameters());
                    org.spongycastle.asn1.x509.AlgorithmIdentifier v12 = org.spongycastle.asn1.x509.AlgorithmIdentifier.getInstance(v8.getEncryptionScheme());
                    javax.crypto.SecretKeyFactory v16 = org.spongycastle.pkcs.jcajce.JcePKCSPBEInputDecryptorProviderBuilder.access$000(this.this$0).createSecretKeyFactory(v8.getKeyDerivationFunc().getAlgorithm().getId());
                    if (!v13.isDefaultPrf()) {
                        v15 = v16.generateSecret(new org.spongycastle.jcajce.spec.PBKDF2KeySpec(this.val$password, v13.getSalt(), v13.getIterationCount().intValue(), org.spongycastle.pkcs.jcajce.JcePKCSPBEInputDecryptorProviderBuilder.access$200(this.this$0).getKeySize(v12), v13.getPrf()));
                    } else {
                        v15 = v16.generateSecret(new javax.crypto.spec.PBEKeySpec(this.val$password, v13.getSalt(), v13.getIterationCount().intValue(), org.spongycastle.pkcs.jcajce.JcePKCSPBEInputDecryptorProviderBuilder.access$200(this.this$0).getKeySize(v12)));
                    }
                    this.cipher = org.spongycastle.pkcs.jcajce.JcePKCSPBEInputDecryptorProviderBuilder.access$000(this.this$0).createCipher(v8.getEncryptionScheme().getAlgorithm().getId());
                    this.encryptionAlg = org.spongycastle.asn1.x509.AlgorithmIdentifier.getInstance(v8.getEncryptionScheme());
                    org.spongycastle.asn1.ASN1Encodable v11 = v8.getEncryptionScheme().getParameters();
                    if (!(v11 instanceof org.spongycastle.asn1.ASN1OctetString)) {
                        org.spongycastle.asn1.cryptopro.GOST28147Parameters v14 = org.spongycastle.asn1.cryptopro.GOST28147Parameters.getInstance(v11);
                        this.cipher.init(2, v15, new org.spongycastle.jcajce.spec.GOST28147ParameterSpec(v14.getEncryptionParamSet(), v14.getIV()));
                    } else {
                        this.cipher.init(2, v15, new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(v11).getOctets()));
                    }
                }
            } else {
                org.spongycastle.asn1.pkcs.PKCS12PBEParams v17 = org.spongycastle.asn1.pkcs.PKCS12PBEParams.getInstance(p20.getParameters());
                this.cipher = org.spongycastle.pkcs.jcajce.JcePKCSPBEInputDecryptorProviderBuilder.access$000(this.this$0).createCipher(v9.getId());
                this.cipher.init(2, new org.spongycastle.jcajce.PKCS12KeyWithParameters(this.val$password, org.spongycastle.pkcs.jcajce.JcePKCSPBEInputDecryptorProviderBuilder.access$100(this.this$0), v17.getIV(), v17.getIterations().intValue()));
                this.encryptionAlg = p20;
            }
        } catch (Exception v10) {
            throw new org.spongycastle.operator.OperatorCreationException(new StringBuilder().append("unable to create InputDecryptor: ").append(v10.getMessage()).toString(), v10);
        }
        return new org.spongycastle.pkcs.jcajce.JcePKCSPBEInputDecryptorProviderBuilder$1$1(this);
    }

Method org.spongycastle.openssl.jcajce.PEMUtilities.crypt() calling method javax.crypto.spec.IvParameterSpec.<init>()


    static byte[] crypt(boolean p19, org.spongycastle.jcajce.util.JcaJceHelper p20, byte[] p21, char[] p22, String p23, byte[] p24)
    {
        javax.crypto.spec.RC2ParameterSpec v15_2 = new javax.crypto.spec.IvParameterSpec(p24);
        String v9 = "CBC";
        String v14 = "PKCS5Padding";
        if (p23.endsWith("-CFB")) {
            v9 = "CFB";
            v14 = "NoPadding";
        }
        if ((p23.endsWith("-ECB")) || (("DES-EDE".equals(p23)) || ("DES-EDE3".equals(p23)))) {
            v9 = "ECB";
            v15_2 = 0;
        }
        if (p23.endsWith("-OFB")) {
            v9 = "OFB";
            v14 = "NoPadding";
        }
        String v5;
        javax.crypto.SecretKey v16;
        if (!p23.startsWith("DES-EDE")) {
            if (!p23.startsWith("DES-")) {
                if (!p23.startsWith("BF-")) {
                    if (!p23.startsWith("RC2-")) {
                        if (!p23.startsWith("AES-")) {
                            throw new org.spongycastle.openssl.EncryptionException("unknown encryption with private key");
                        } else {
                            v5 = "AES";
                            byte[] v17 = p24;
                            if (p24.length > 8) {
                                String v0_24 = new byte[8];
                                v17 = v0_24;
                                System.arraycopy(p24, 0, v17, 0, 8);
                            }
                            int v12_0;
                            if (!p23.startsWith("AES-128-")) {
                                if (!p23.startsWith("AES-192-")) {
                                    if (!p23.startsWith("AES-256-")) {
                                        throw new org.spongycastle.openssl.EncryptionException("unknown AES encryption with private key");
                                    } else {
                                        v12_0 = 256;
                                    }
                                } else {
                                    v12_0 = 192;
                                }
                            } else {
                                v12_0 = 128;
                            }
                            v16 = org.spongycastle.openssl.jcajce.PEMUtilities.getKey(p20, p22, "AES", (v12_0 / 8), v17);
                        }
                    } else {
                        v5 = "RC2";
                        int v12_1 = 128;
                        if (!p23.startsWith("RC2-40-")) {
                            if (p23.startsWith("RC2-64-")) {
                                v12_1 = 64;
                            }
                        } else {
                            v12_1 = 40;
                        }
                        v16 = org.spongycastle.openssl.jcajce.PEMUtilities.getKey(p20, p22, "RC2", (v12_1 / 8), p24);
                        if (v15_2 != null) {
                            v15_2 = new javax.crypto.spec.RC2ParameterSpec(v12_1, p24);
                        } else {
                            v15_2 = new javax.crypto.spec.RC2ParameterSpec(v12_1);
                        }
                    }
                } else {
                    v5 = "Blowfish";
                    v16 = org.spongycastle.openssl.jcajce.PEMUtilities.getKey(p20, p22, "Blowfish", 16, p24);
                }
            } else {
                v5 = "DES";
                v16 = org.spongycastle.openssl.jcajce.PEMUtilities.getKey(p20, p22, "DES", 8, p24);
            }
        } else {
            int v8;
            v5 = "DESede";
            if (p23.startsWith("DES-EDE3")) {
                v8 = 0;
            } else {
                v8 = 1;
            }
            v16 = org.spongycastle.openssl.jcajce.PEMUtilities.getKey(p20, p22, "DESede", 24, p24, v8);
        }
        try {
            int v13;
            javax.crypto.Cipher v10 = p20.createCipher(new StringBuilder().append(v5).append("/").append(v9).append("/").append(v14).toString());
        } catch (Exception v11) {
            throw new org.spongycastle.openssl.EncryptionException("exception using cipher - please check password and data.", v11);
        }
        if (!p19) {
            v13 = 2;
        } else {
            v13 = 1;
        }
        if (v15_2 != null) {
            v10.init(v13, v16, v15_2);
        } else {
            v10.init(v13, v16);
        }
        return v10.doFinal(p21);
    }

Method org.spongycastle.jcajce.provider.symmetric.Shacal2$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[32];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("Shacal2");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.SM4$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[16];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("SM4");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.SEED$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[16];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("SEED");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.RC6$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[16];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("RC6");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.RC5$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[8];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("RC5");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.RC2$AlgParams.localEngineGetParameterSpec() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.spec.AlgorithmParameterSpec localEngineGetParameterSpec(Class p4)
    {
        if ((p4 != javax.crypto.spec.RC2ParameterSpec) || (this.parameterVersion == -1)) {
            if (p4 != javax.crypto.spec.IvParameterSpec) {
                throw new java.security.spec.InvalidParameterSpecException("unknown parameter spec passed to RC2 parameters object.");
            } else {
                javax.crypto.spec.RC2ParameterSpec v0_2 = new javax.crypto.spec.IvParameterSpec(this.iv);
            }
        } else {
            if (this.parameterVersion >= 256) {
                v0_2 = new javax.crypto.spec.RC2ParameterSpec(this.parameterVersion, this.iv);
            } else {
                v0_2 = new javax.crypto.spec.RC2ParameterSpec(org.spongycastle.jcajce.provider.symmetric.RC2$AlgParams.ekb[this.parameterVersion], this.iv);
            }
        }
        return v0_2;
    }

Method org.spongycastle.jcajce.provider.symmetric.RC2$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        java.security.AlgorithmParameters v2;
        if (this.spec != null) {
            try {
                v2 = this.createParametersInstance("RC2");
                v2.init(this.spec);
            } catch (Exception v0_1) {
                throw new RuntimeException(v0_1.getMessage());
            }
        } else {
            byte[] v1 = new byte[8];
            if (this.random == null) {
                this.random = new java.security.SecureRandom();
            }
            this.random.nextBytes(v1);
            try {
                v2 = this.createParametersInstance("RC2");
                v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            } catch (Exception v0_0) {
                throw new RuntimeException(v0_0.getMessage());
            }
        }
        return v2;
    }

Method org.spongycastle.jcajce.provider.symmetric.Noekeon$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[16];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("Noekeon");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.IDEA$AlgParams.localEngineGetParameterSpec() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.spec.AlgorithmParameterSpec localEngineGetParameterSpec(Class p3)
    {
        if (p3 != javax.crypto.spec.IvParameterSpec) {
            throw new java.security.spec.InvalidParameterSpecException("unknown parameter spec passed to IV parameters object.");
        } else {
            return new javax.crypto.spec.IvParameterSpec(this.iv);
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.IDEA$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[8];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("IDEA");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.GOST28147$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[16];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("GOST28147");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.DESede$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[8];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("DES");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.DES$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[8];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("DES");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.Camellia$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[16];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("Camellia");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.CAST5$AlgParams.localEngineGetParameterSpec() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.spec.AlgorithmParameterSpec localEngineGetParameterSpec(Class p3)
    {
        if (p3 != javax.crypto.spec.IvParameterSpec) {
            throw new java.security.spec.InvalidParameterSpecException("unknown parameter spec passed to CAST5 parameters object.");
        } else {
            return new javax.crypto.spec.IvParameterSpec(this.iv);
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.CAST5$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[8];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("CAST5");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.AES$AlgParamsGCM.localEngineGetParameterSpec() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.spec.AlgorithmParameterSpec localEngineGetParameterSpec(Class p4)
    {
        if ((p4 != java.security.spec.AlgorithmParameterSpec) && (!org.spongycastle.jcajce.provider.symmetric.GcmSpecUtil.isGcmSpec(p4))) {
            if (p4 != javax.crypto.spec.IvParameterSpec) {
                throw new java.security.spec.InvalidParameterSpecException(new StringBuilder().append("AlgorithmParameterSpec not recognized: ").append(p4.getName()).toString());
            } else {
                java.security.spec.InvalidParameterSpecException v0_3 = new javax.crypto.spec.IvParameterSpec(this.gcmParams.getNonce());
            }
        } else {
            if (!org.spongycastle.jcajce.provider.symmetric.GcmSpecUtil.gcmSpecExists()) {
                v0_3 = new javax.crypto.spec.IvParameterSpec(this.gcmParams.getNonce());
            } else {
                v0_3 = org.spongycastle.jcajce.provider.symmetric.GcmSpecUtil.extractGcmSpec(this.gcmParams.toASN1Primitive());
            }
        }
        return v0_3;
    }

Method org.spongycastle.jcajce.provider.symmetric.AES$AlgParamsCCM.localEngineGetParameterSpec() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.spec.AlgorithmParameterSpec localEngineGetParameterSpec(Class p4)
    {
        if ((p4 != java.security.spec.AlgorithmParameterSpec) && (!org.spongycastle.jcajce.provider.symmetric.GcmSpecUtil.isGcmSpec(p4))) {
            if (p4 != javax.crypto.spec.IvParameterSpec) {
                throw new java.security.spec.InvalidParameterSpecException(new StringBuilder().append("AlgorithmParameterSpec not recognized: ").append(p4.getName()).toString());
            } else {
                java.security.spec.InvalidParameterSpecException v0_3 = new javax.crypto.spec.IvParameterSpec(this.ccmParams.getNonce());
            }
        } else {
            if (!org.spongycastle.jcajce.provider.symmetric.GcmSpecUtil.gcmSpecExists()) {
                v0_3 = new javax.crypto.spec.IvParameterSpec(this.ccmParams.getNonce());
            } else {
                v0_3 = org.spongycastle.jcajce.provider.symmetric.GcmSpecUtil.extractGcmSpec(this.ccmParams.toASN1Primitive());
            }
        }
        return v0_3;
    }

Method org.spongycastle.jcajce.provider.symmetric.util.IvAlgorithmParameters.localEngineGetParameterSpec() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.spec.AlgorithmParameterSpec localEngineGetParameterSpec(Class p3)
    {
        if (p3 != javax.crypto.spec.IvParameterSpec) {
            throw new java.security.spec.InvalidParameterSpecException("unknown parameter spec passed to IV parameters object.");
        } else {
            return new javax.crypto.spec.IvParameterSpec(this.iv);
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.AES$AlgParamGen.engineGenerateParameters() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.AlgorithmParameters engineGenerateParameters()
    {
        byte[] v1 = new byte[16];
        if (this.random == null) {
            this.random = new java.security.SecureRandom();
        }
        this.random.nextBytes(v1);
        try {
            java.security.AlgorithmParameters v2 = this.createParametersInstance("AES");
            v2.init(new javax.crypto.spec.IvParameterSpec(v1));
            return v2;
        } catch (Exception v0) {
            throw new RuntimeException(v0.getMessage());
        }
    }

Method org.spongycastle.jcajce.provider.keystore.pkcs12.PKCS12KeyStoreSpi.createCipher() calling method javax.crypto.spec.IvParameterSpec.<init>()


    private javax.crypto.Cipher createCipher(int p17, char[] p18, org.spongycastle.asn1.x509.AlgorithmIdentifier p19)
    {
        javax.crypto.SecretKey v14;
        org.spongycastle.asn1.pkcs.PBES2Parameters v7 = org.spongycastle.asn1.pkcs.PBES2Parameters.getInstance(p19.getParameters());
        org.spongycastle.asn1.pkcs.PBKDF2Params v12 = org.spongycastle.asn1.pkcs.PBKDF2Params.getInstance(v7.getKeyDerivationFunc().getParameters());
        org.spongycastle.asn1.x509.AlgorithmIdentifier v10 = org.spongycastle.asn1.x509.AlgorithmIdentifier.getInstance(v7.getEncryptionScheme());
        javax.crypto.SecretKeyFactory v15 = this.helper.createSecretKeyFactory(v7.getKeyDerivationFunc().getAlgorithm().getId());
        if (!v12.isDefaultPrf()) {
            v14 = v15.generateSecret(new org.spongycastle.jcajce.spec.PBKDF2KeySpec(p18, v12.getSalt(), v12.getIterationCount().intValue(), org.spongycastle.jcajce.provider.keystore.pkcs12.PKCS12KeyStoreSpi.keySizeProvider.getKeySize(v10), v12.getPrf()));
        } else {
            v14 = v15.generateSecret(new javax.crypto.spec.PBEKeySpec(p18, v12.getSalt(), v12.getIterationCount().intValue(), org.spongycastle.jcajce.provider.keystore.pkcs12.PKCS12KeyStoreSpi.keySizeProvider.getKeySize(v10)));
        }
        javax.crypto.Cipher v8 = javax.crypto.Cipher.getInstance(v7.getEncryptionScheme().getAlgorithm().getId());
        org.spongycastle.asn1.x509.AlgorithmIdentifier.getInstance(v7.getEncryptionScheme());
        org.spongycastle.asn1.ASN1Encodable v9 = v7.getEncryptionScheme().getParameters();
        if (!(v9 instanceof org.spongycastle.asn1.ASN1OctetString)) {
            org.spongycastle.asn1.cryptopro.GOST28147Parameters v13 = org.spongycastle.asn1.cryptopro.GOST28147Parameters.getInstance(v9);
            v8.init(p17, v14, new org.spongycastle.jcajce.spec.GOST28147ParameterSpec(v13.getEncryptionParamSet(), v13.getIV()));
        } else {
            v8.init(p17, v14, new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(v9).getOctets()));
        }
        return v8;
    }

Method org.spongycastle.cms.jcajce.JcePasswordRecipientInfoGenerator.generateEncryptedBytes() calling method javax.crypto.spec.IvParameterSpec.<init>()


    public byte[] generateEncryptedBytes(org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9, org.spongycastle.operator.GenericKey p10)
    {
        java.security.Key v0 = this.helper.getJceKey(p10);
        javax.crypto.Cipher v3 = this.helper.createRFC3211Wrapper(p8.getAlgorithm());
        try {
            v3.init(3, new javax.crypto.spec.SecretKeySpec(p9, v3.getAlgorithm()), new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(p8.getParameters()).getOctets()));
            return v3.wrap(v0);
        } catch (java.security.GeneralSecurityException v1) {
            throw new org.spongycastle.cms.CMSException(new StringBuilder().append("cannot process content encryption key: ").append(v1.getMessage()).toString(), v1);
        }
    }

Method org.spongycastle.cms.jcajce.JcePasswordRecipient.extractSecretKey() calling method javax.crypto.spec.IvParameterSpec.<init>()


    protected java.security.Key extractSecretKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p7, org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9, byte[] p10)
    {
        javax.crypto.Cipher v2 = this.helper.createRFC3211Wrapper(p7.getAlgorithm());
        try {
            v2.init(4, new javax.crypto.spec.SecretKeySpec(p9, v2.getAlgorithm()), new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(p7.getParameters()).getOctets()));
            return v2.unwrap(p10, p8.getAlgorithm().getId(), 3);
        } catch (java.security.GeneralSecurityException v0) {
            throw new org.spongycastle.cms.CMSException(new StringBuilder().append("cannot process content encryption key: ").append(v0.getMessage()).toString(), v0);
        }
    }

Method org.spongycastle.cms.jcajce.EnvelopedDataHelper$1.doInJCE() calling method javax.crypto.spec.IvParameterSpec.<init>()


    public Object doInJCE()
    {
        javax.crypto.Cipher v0 = this.this$0.createCipher(this.val$encryptionAlgID.getAlgorithm());
        org.spongycastle.asn1.ASN1Encodable v4 = this.val$encryptionAlgID.getParameters();
        String v2 = this.val$encryptionAlgID.getAlgorithm().getId();
        if ((v4 == null) || ((v4 instanceof org.spongycastle.asn1.ASN1Null))) {
            if ((!v2.equals(org.spongycastle.cms.CMSAlgorithm.DES_CBC.getId())) && ((!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.DES_EDE3_CBC)) && ((!v2.equals("1.3.6.1.4.1.188.7.1.1.2")) && (!v2.equals("1.2.840.113533.7.66.10"))))) {
                v0.init(2, this.val$sKey);
            } else {
                byte[] v7_1 = new byte[8];
                v0.init(2, this.val$sKey, new javax.crypto.spec.IvParameterSpec(v7_1));
            }
        } else {
            try {
                java.security.AlgorithmParameters v3 = this.this$0.createAlgorithmParameters(this.val$encryptionAlgID.getAlgorithm());
                org.spongycastle.cms.jcajce.CMSUtils.loadParameters(v3, v4);
                v0.init(2, this.val$sKey, v3);
            } catch (java.security.NoSuchAlgorithmException v1) {
                if (!v2.equals(org.spongycastle.cms.CMSAlgorithm.DES_CBC.getId())) {
                    if (!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.DES_EDE3_CBC)) {
                        if (!v2.equals("1.3.6.1.4.1.188.7.1.1.2")) {
                            if (!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.AES128_CBC)) {
                                if (!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.AES192_CBC)) {
                                    if (!v2.equals(org.spongycastle.cms.CMSEnvelopedDataGenerator.AES256_CBC)) {
                                        throw v1;
                                    }
                                }
                            }
                        }
                    }
                }
                v0.init(2, this.val$sKey, new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(v4).getOctets()));
            }
        }
        return v0;
    }

Method org.spongycastle.cert.crmf.jcajce.CRMFHelper$1.doInJCE() calling method javax.crypto.spec.IvParameterSpec.<init>()


    public Object doInJCE()
    {
        javax.crypto.Cipher v0 = this.this$0.createCipher(this.val$encryptionAlgID.getAlgorithm());
        org.spongycastle.asn1.ASN1Primitive v4_0 = ((org.spongycastle.asn1.ASN1Primitive) this.val$encryptionAlgID.getParameters());
        org.spongycastle.asn1.ASN1ObjectIdentifier v2 = this.val$encryptionAlgID.getAlgorithm();
        try {
            if ((v4_0 == null) || ((v4_0 instanceof org.spongycastle.asn1.ASN1Null))) {
                if ((!v2.equals(org.spongycastle.cms.CMSAlgorithm.DES_EDE3_CBC)) && ((!v2.equals(org.spongycastle.cms.CMSAlgorithm.IDEA_CBC)) && (!v2.equals(org.spongycastle.cms.CMSAlgorithm.CAST5_CBC)))) {
                    v0.init(2, this.val$sKey);
                } else {
                    byte[] v7_1 = new byte[8];
                    v0.init(2, this.val$sKey, new javax.crypto.spec.IvParameterSpec(v7_1));
                }
            } else {
                java.security.AlgorithmParameters v3 = this.this$0.createAlgorithmParameters(this.val$encryptionAlgID.getAlgorithm());
                org.spongycastle.jcajce.util.AlgorithmParametersUtils.loadParameters(v3, v4_0);
                v0.init(2, this.val$sKey, v3);
            }
        } catch (java.io.IOException v1_1) {
            if (!v2.equals(org.spongycastle.cms.CMSAlgorithm.DES_EDE3_CBC)) {
                if (!v2.equals(org.spongycastle.cms.CMSAlgorithm.IDEA_CBC)) {
                    if (!v2.equals(org.spongycastle.cms.CMSAlgorithm.AES128_CBC)) {
                        if (!v2.equals(org.spongycastle.cms.CMSAlgorithm.AES192_CBC)) {
                            if (!v2.equals(org.spongycastle.cms.CMSAlgorithm.AES256_CBC)) {
                                throw v1_1;
                            }
                        }
                    }
                }
            }
            v0.init(2, this.val$sKey, new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(v4_0).getOctets()));
        }
        return v0;
    }

Method org.spongycastle.jcajce.provider.symmetric.util.BaseStreamCipher.engineInit() calling method java.security.Key.getAlgorithm()


    protected void engineInit(int p15, java.security.Key p16, java.security.spec.AlgorithmParameterSpec p17, java.security.SecureRandom p18)
    {
        this.pbeSpec = 0;
        this.pbeAlgorithm = 0;
        this.engineParams = 0;
        if ((p16 instanceof javax.crypto.SecretKey)) {
            org.spongycastle.crypto.params.ParametersWithIV v12_0;
            if (!(p16 instanceof org.spongycastle.jcajce.PKCS12Key)) {
                if (!(p16 instanceof org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey)) {
                    if (p17 != null) {
                        if (!(p17 instanceof javax.crypto.spec.IvParameterSpec)) {
                            throw new java.security.InvalidAlgorithmParameterException("unknown parameter type.");
                        } else {
                            v12_0 = new org.spongycastle.crypto.params.ParametersWithIV(new org.spongycastle.crypto.params.KeyParameter(p16.getEncoded()), ((javax.crypto.spec.IvParameterSpec) p17).getIV());
                            this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v12_0);
                        }
                    } else {
                        if (this.digest <= 0) {
                            v12_0 = new org.spongycastle.crypto.params.KeyParameter(p16.getEncoded());
                        } else {
                            throw new java.security.InvalidKeyException("Algorithm requires a PBE key");
                        }
                    }
                } else {
                    if (((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getOID() == null) {
                        this.pbeAlgorithm = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getAlgorithm();
                    } else {
                        this.pbeAlgorithm = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getOID().getId();
                    }
                    if (((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getParam() == null) {
                        if (!(p17 instanceof javax.crypto.spec.PBEParameterSpec)) {
                            throw new java.security.InvalidAlgorithmParameterException("PBE requires PBE parameters to be set.");
                        } else {
                            v12_0 = org.spongycastle.jcajce.provider.symmetric.util.PBE$Util.makePBEParameters(((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16), p17, this.cipher.getAlgorithmName());
                            this.pbeSpec = ((javax.crypto.spec.PBEParameterSpec) p17);
                        }
                    } else {
                        v12_0 = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getParam();
                        this.pbeSpec = new javax.crypto.spec.PBEParameterSpec(((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getSalt(), ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getIterationCount());
                    }
                    if (((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p16).getIvSize() != 0) {
                        this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v12_0);
                    }
                }
            } else {
                this.pbeSpec = ((javax.crypto.spec.PBEParameterSpec) p17);
                if (((((org.spongycastle.jcajce.PKCS12Key) p16) instanceof org.spongycastle.jcajce.PKCS12KeyWithParameters)) && (this.pbeSpec == null)) {
                    this.pbeSpec = new javax.crypto.spec.PBEParameterSpec(((org.spongycastle.jcajce.PKCS12KeyWithParameters) ((org.spongycastle.jcajce.PKCS12Key) p16)).getSalt(), ((org.spongycastle.jcajce.PKCS12KeyWithParameters) ((org.spongycastle.jcajce.PKCS12Key) p16)).getIterationCount());
                }
                v12_0 = org.spongycastle.jcajce.provider.symmetric.util.PBE$Util.makePBEParameters(((org.spongycastle.jcajce.PKCS12Key) p16).getEncoded(), 2, this.digest, this.keySizeInBits, (this.ivLength * 8), this.pbeSpec, this.cipher.getAlgorithmName());
            }
            if ((this.ivLength != 0) && (!(v12_0 instanceof org.spongycastle.crypto.params.ParametersWithIV))) {
                java.security.SecureRandom v10_0 = p18;
                if (p18 == null) {
                    v10_0 = new java.security.SecureRandom();
                }
                if ((p15 != 1) && (p15 != 3)) {
                    throw new java.security.InvalidAlgorithmParameterException("no IV set when one expected");
                } else {
                    byte[] v9 = new byte[this.ivLength];
                    v10_0.nextBytes(v9);
                    org.spongycastle.crypto.params.ParametersWithIV v13_1 = new org.spongycastle.crypto.params.ParametersWithIV(v12_0, v9);
                    this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v13_1);
                    v12_0 = v13_1;
                }
            }
            try {
                switch (p15) {
                    case 1:
                    case 3:
                        this.cipher.init(1, v12_0);
                        return;
                    case 2:
                    case 4:
                        this.cipher.init(0, v12_0);
                        return;
                    default:
                        throw new java.security.InvalidParameterException(new StringBuilder().append("unknown opmode ").append(p15).append(" passed").toString());
                }
            } catch (Exception v8) {
            }
            throw new java.security.InvalidKeyException(v8.getMessage());
        } else {
            throw new java.security.InvalidKeyException(new StringBuilder().append("Key for algorithm ").append(p16.getAlgorithm()).append(" not suitable for symmetric enryption.").toString());
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineInit() calling method java.security.Key.getAlgorithm()


    protected void engineInit(int p23, java.security.Key p24, java.security.spec.AlgorithmParameterSpec p25, java.security.SecureRandom p26)
    {
        this.pbeSpec = 0;
        this.pbeAlgorithm = 0;
        this.engineParams = 0;
        this.aeadParams = 0;
        if ((p24 instanceof javax.crypto.SecretKey)) {
            if ((p25 != null) || (!this.baseEngine.getAlgorithmName().startsWith("RC5-64"))) {
                if ((this.scheme != 2) && (!(p24 instanceof org.spongycastle.jcajce.PKCS12Key))) {
                    if (!(p24 instanceof org.spongycastle.jcajce.PBKDF1Key)) {
                        if (!(p24 instanceof org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey)) {
                            if (!(p24 instanceof javax.crypto.interfaces.PBEKey)) {
                                if ((p24 instanceof org.spongycastle.jcajce.spec.RepeatedSecretKeySpec)) {
                                    org.spongycastle.crypto.params.ParametersWithIV v17_0 = 0;
                                } else {
                                    if ((this.scheme != 0) && ((this.scheme != 4) && ((this.scheme != 1) && (this.scheme != 5)))) {
                                        v17_0 = new org.spongycastle.crypto.params.KeyParameter;
                                        v17_0(p24.getEncoded());
                                    } else {
                                        throw new java.security.InvalidKeyException("Algorithm requires a PBE key");
                                    }
                                }
                            } else {
                                this.pbeSpec = ((javax.crypto.spec.PBEParameterSpec) p25);
                                if (((((javax.crypto.interfaces.PBEKey) p24) instanceof org.spongycastle.jcajce.PKCS12KeyWithParameters)) && (this.pbeSpec == null)) {
                                    this.pbeSpec = new javax.crypto.spec.PBEParameterSpec(((javax.crypto.interfaces.PBEKey) p24).getSalt(), ((javax.crypto.interfaces.PBEKey) p24).getIterationCount());
                                }
                                v17_0 = org.spongycastle.jcajce.provider.symmetric.util.PBE$Util.makePBEParameters(((javax.crypto.interfaces.PBEKey) p24).getEncoded(), this.scheme, this.digest, this.keySizeInBits, (this.ivLength * 8), this.pbeSpec, this.cipher.getAlgorithmName());
                                if ((v17_0 instanceof org.spongycastle.crypto.params.ParametersWithIV)) {
                                    this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v17_0);
                                }
                            }
                        } else {
                            if (((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p24).getOID() == null) {
                                this.pbeAlgorithm = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p24).getAlgorithm();
                            } else {
                                this.pbeAlgorithm = ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p24).getOID().getId();
                            }
                            if (((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p24).getParam() == null) {
                                if (!(p25 instanceof javax.crypto.spec.PBEParameterSpec)) {
                                    throw new java.security.InvalidAlgorithmParameterException("PBE requires PBE parameters to be set.");
                                } else {
                                    this.pbeSpec = ((javax.crypto.spec.PBEParameterSpec) p25);
                                    v17_0 = org.spongycastle.jcajce.provider.symmetric.util.PBE$Util.makePBEParameters(((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p24), p25, this.cipher.getUnderlyingCipher().getAlgorithmName());
                                }
                            } else {
                                v17_0 = this.adjustParameters(p25, ((org.spongycastle.jcajce.provider.symmetric.util.BCPBEKey) p24).getParam());
                            }
                            if ((v17_0 instanceof org.spongycastle.crypto.params.ParametersWithIV)) {
                                this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v17_0);
                            }
                        }
                    } else {
                        if ((p25 instanceof javax.crypto.spec.PBEParameterSpec)) {
                            this.pbeSpec = ((javax.crypto.spec.PBEParameterSpec) p25);
                        }
                        if (((((org.spongycastle.jcajce.PBKDF1Key) p24) instanceof org.spongycastle.jcajce.PBKDF1KeyWithParameters)) && (this.pbeSpec == null)) {
                            this.pbeSpec = new javax.crypto.spec.PBEParameterSpec(((org.spongycastle.jcajce.PBKDF1KeyWithParameters) ((org.spongycastle.jcajce.PBKDF1Key) p24)).getSalt(), ((org.spongycastle.jcajce.PBKDF1KeyWithParameters) ((org.spongycastle.jcajce.PBKDF1Key) p24)).getIterationCount());
                        }
                        v17_0 = org.spongycastle.jcajce.provider.symmetric.util.PBE$Util.makePBEParameters(((org.spongycastle.jcajce.PBKDF1Key) p24).getEncoded(), 0, this.digest, this.keySizeInBits, (this.ivLength * 8), this.pbeSpec, this.cipher.getAlgorithmName());
                        if ((v17_0 instanceof org.spongycastle.crypto.params.ParametersWithIV)) {
                            this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v17_0);
                        }
                    }
                } else {
                    try {
                        if ((p25 instanceof javax.crypto.spec.PBEParameterSpec)) {
                            this.pbeSpec = ((javax.crypto.spec.PBEParameterSpec) p25);
                        }
                    } catch (Exception v10) {
                        throw new java.security.InvalidKeyException("PKCS12 requires a SecretKey/PBEKey");
                    }
                    if (((((javax.crypto.SecretKey) p24) instanceof javax.crypto.interfaces.PBEKey)) && (this.pbeSpec == null)) {
                        this.pbeSpec = new javax.crypto.spec.PBEParameterSpec(((javax.crypto.interfaces.PBEKey) ((javax.crypto.SecretKey) p24)).getSalt(), ((javax.crypto.interfaces.PBEKey) ((javax.crypto.SecretKey) p24)).getIterationCount());
                    }
                    if ((this.pbeSpec != null) || ((((javax.crypto.SecretKey) p24) instanceof javax.crypto.interfaces.PBEKey))) {
                        v17_0 = org.spongycastle.jcajce.provider.symmetric.util.PBE$Util.makePBEParameters(((javax.crypto.SecretKey) p24).getEncoded(), 2, this.digest, this.keySizeInBits, (this.ivLength * 8), this.pbeSpec, this.cipher.getAlgorithmName());
                        if ((v17_0 instanceof org.spongycastle.crypto.params.ParametersWithIV)) {
                            this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v17_0);
                        }
                    } else {
                        throw new java.security.InvalidKeyException("Algorithm requires a PBE key");
                    }
                }
                if (!(p25 instanceof javax.crypto.spec.IvParameterSpec)) {
                    if (!(p25 instanceof org.spongycastle.jcajce.spec.GOST28147ParameterSpec)) {
                        if (!(p25 instanceof javax.crypto.spec.RC2ParameterSpec)) {
                            if (!(p25 instanceof javax.crypto.spec.RC5ParameterSpec)) {
                                if ((org.spongycastle.jcajce.provider.symmetric.util.BaseBlockCipher.gcmSpecClass == null) || (!org.spongycastle.jcajce.provider.symmetric.util.BaseBlockCipher.gcmSpecClass.isInstance(p25))) {
                                    if ((p25 != null) && (!(p25 instanceof javax.crypto.spec.PBEParameterSpec))) {
                                        throw new java.security.InvalidAlgorithmParameterException("unknown parameter type.");
                                    }
                                } else {
                                    if ((this.isAEADModeName(this.modeName)) || ((this.cipher instanceof org.spongycastle.jcajce.provider.symmetric.util.BaseBlockCipher$AEADGenericBlockCipher))) {
                                        try {
                                            org.spongycastle.crypto.params.KeyParameter v15_0;
                                            String v5_5 = new Class[0];
                                            reflect.Method v21 = org.spongycastle.jcajce.provider.symmetric.util.BaseBlockCipher.gcmSpecClass.getDeclaredMethod("getTLen", v5_5);
                                            String v5_7 = new Class[0];
                                            byte[] v12_0 = org.spongycastle.jcajce.provider.symmetric.util.BaseBlockCipher.gcmSpecClass.getDeclaredMethod("getIV", v5_7);
                                        } catch (Exception v10) {
                                            throw new java.security.InvalidAlgorithmParameterException("Cannot process GCMParameterSpec.");
                                        }
                                        if (!(v17_0 instanceof org.spongycastle.crypto.params.ParametersWithIV)) {
                                            v15_0 = ((org.spongycastle.crypto.params.KeyParameter) v17_0);
                                        } else {
                                            v15_0 = ((org.spongycastle.crypto.params.KeyParameter) ((org.spongycastle.crypto.params.ParametersWithIV) v17_0).getParameters());
                                        }
                                        v17_0 = new org.spongycastle.crypto.params.AEADParameters;
                                        org.spongycastle.crypto.params.ParametersWithIV v3_79 = new Object[0];
                                        org.spongycastle.crypto.params.ParametersWithIV v3_83 = new Object[0];
                                        v17_0(v15_0, ((Integer) v21.invoke(p25, v3_79)).intValue(), ((byte[]) ((byte[]) v12_0.invoke(p25, v3_83))));
                                        this.aeadParams = v17_0;
                                    } else {
                                        throw new java.security.InvalidAlgorithmParameterException("GCMParameterSpec can only be used with AEAD modes.");
                                    }
                                }
                            } else {
                                v17_0 = new org.spongycastle.crypto.params.RC5Parameters;
                                v17_0(p24.getEncoded(), ((javax.crypto.spec.RC5ParameterSpec) p25).getRounds());
                                if (!this.baseEngine.getAlgorithmName().startsWith("RC5")) {
                                    throw new java.security.InvalidAlgorithmParameterException("RC5 parameters passed to a cipher that is not RC5.");
                                } else {
                                    if (!this.baseEngine.getAlgorithmName().equals("RC5-32")) {
                                        if ((this.baseEngine.getAlgorithmName().equals("RC5-64")) && (((javax.crypto.spec.RC5ParameterSpec) p25).getWordSize() != 64)) {
                                            throw new java.security.InvalidAlgorithmParameterException(new StringBuilder().append("RC5 already set up for a word size of 64 not ").append(((javax.crypto.spec.RC5ParameterSpec) p25).getWordSize()).append(".").toString());
                                        }
                                    } else {
                                        if (((javax.crypto.spec.RC5ParameterSpec) p25).getWordSize() != 32) {
                                            throw new java.security.InvalidAlgorithmParameterException(new StringBuilder().append("RC5 already set up for a word size of 32 not ").append(((javax.crypto.spec.RC5ParameterSpec) p25).getWordSize()).append(".").toString());
                                        }
                                    }
                                    if ((((javax.crypto.spec.RC5ParameterSpec) p25).getIV() != null) && (this.ivLength != 0)) {
                                        if (!(v17_0 instanceof org.spongycastle.crypto.params.ParametersWithIV)) {
                                            org.spongycastle.crypto.params.ParametersWithIV v18_0 = new org.spongycastle.crypto.params.ParametersWithIV;
                                            v18_0(v17_0, ((javax.crypto.spec.RC5ParameterSpec) p25).getIV());
                                            v17_0 = v18_0;
                                        } else {
                                            org.spongycastle.crypto.params.ParametersWithIV v18_1 = new org.spongycastle.crypto.params.ParametersWithIV;
                                            v18_1(((org.spongycastle.crypto.params.ParametersWithIV) v17_0).getParameters(), ((javax.crypto.spec.RC5ParameterSpec) p25).getIV());
                                            v17_0 = v18_1;
                                        }
                                        this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v17_0);
                                    }
                                }
                            }
                        } else {
                            v17_0 = new org.spongycastle.crypto.params.RC2Parameters;
                            v17_0(p24.getEncoded(), ((javax.crypto.spec.RC2ParameterSpec) p25).getEffectiveKeyBits());
                            if ((((javax.crypto.spec.RC2ParameterSpec) p25).getIV() != null) && (this.ivLength != 0)) {
                                if (!(v17_0 instanceof org.spongycastle.crypto.params.ParametersWithIV)) {
                                    org.spongycastle.crypto.params.ParametersWithIV v18_2 = new org.spongycastle.crypto.params.ParametersWithIV;
                                    v18_2(v17_0, ((javax.crypto.spec.RC2ParameterSpec) p25).getIV());
                                    v17_0 = v18_2;
                                } else {
                                    org.spongycastle.crypto.params.ParametersWithIV v18_3 = new org.spongycastle.crypto.params.ParametersWithIV;
                                    v18_3(((org.spongycastle.crypto.params.ParametersWithIV) v17_0).getParameters(), ((javax.crypto.spec.RC2ParameterSpec) p25).getIV());
                                    v17_0 = v18_3;
                                }
                                this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v17_0);
                            }
                        }
                    } else {
                        v17_0 = new org.spongycastle.crypto.params.ParametersWithSBox;
                        v17_0(new org.spongycastle.crypto.params.KeyParameter(p24.getEncoded()), ((org.spongycastle.jcajce.spec.GOST28147ParameterSpec) p25).getSbox());
                        if ((((org.spongycastle.jcajce.spec.GOST28147ParameterSpec) p25).getIV() != null) && (this.ivLength != 0)) {
                            if (!(v17_0 instanceof org.spongycastle.crypto.params.ParametersWithIV)) {
                                org.spongycastle.crypto.params.ParametersWithIV v18_4 = new org.spongycastle.crypto.params.ParametersWithIV;
                                v18_4(v17_0, ((org.spongycastle.jcajce.spec.GOST28147ParameterSpec) p25).getIV());
                                v17_0 = v18_4;
                            } else {
                                org.spongycastle.crypto.params.ParametersWithIV v18_5 = new org.spongycastle.crypto.params.ParametersWithIV;
                                v18_5(((org.spongycastle.crypto.params.ParametersWithIV) v17_0).getParameters(), ((org.spongycastle.jcajce.spec.GOST28147ParameterSpec) p25).getIV());
                                v17_0 = v18_5;
                            }
                            this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v17_0);
                        }
                    }
                } else {
                    if (this.ivLength == 0) {
                        if ((this.modeName != null) && (this.modeName.equals("ECB"))) {
                            throw new java.security.InvalidAlgorithmParameterException("ECB mode does not use an IV");
                        }
                    } else {
                        if ((((javax.crypto.spec.IvParameterSpec) p25).getIV().length == this.ivLength) || (((this.cipher instanceof org.spongycastle.jcajce.provider.symmetric.util.BaseBlockCipher$AEADGenericBlockCipher)) || (!this.fixedIv))) {
                            if (!(v17_0 instanceof org.spongycastle.crypto.params.ParametersWithIV)) {
                                org.spongycastle.crypto.params.ParametersWithIV v18_6 = new org.spongycastle.crypto.params.ParametersWithIV;
                                v18_6(v17_0, ((javax.crypto.spec.IvParameterSpec) p25).getIV());
                                v17_0 = v18_6;
                            } else {
                                org.spongycastle.crypto.params.ParametersWithIV v18_7 = new org.spongycastle.crypto.params.ParametersWithIV;
                                v18_7(((org.spongycastle.crypto.params.ParametersWithIV) v17_0).getParameters(), ((javax.crypto.spec.IvParameterSpec) p25).getIV());
                                v17_0 = v18_7;
                            }
                            this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v17_0);
                        } else {
                            throw new java.security.InvalidAlgorithmParameterException(new StringBuilder().append("IV must be ").append(this.ivLength).append(" bytes long.").toString());
                        }
                    }
                }
                if ((this.ivLength == 0) || (((v17_0 instanceof org.spongycastle.crypto.params.ParametersWithIV)) || ((v17_0 instanceof org.spongycastle.crypto.params.AEADParameters)))) {
                    org.spongycastle.crypto.params.ParametersWithIV v18_8 = v17_0;
                } else {
                    java.security.SecureRandom v13_0 = p26;
                    if (p26 == null) {
                        v13_0 = new java.security.SecureRandom();
                    }
                    if ((p23 != 1) && (p23 != 3)) {
                        if (this.cipher.getUnderlyingCipher().getAlgorithmName().indexOf("PGPCFB") >= 0) {
                        } else {
                            throw new java.security.InvalidAlgorithmParameterException("no IV set when one expected");
                        }
                    } else {
                        byte[] v12_1 = new byte[this.ivLength];
                        v13_0.nextBytes(v12_1);
                        v18_8 = new org.spongycastle.crypto.params.ParametersWithIV;
                        v18_8(v17_0, v12_1);
                        this.ivParam = ((org.spongycastle.crypto.params.ParametersWithIV) v18_8);
                    }
                }
                if ((p26 == null) || (!this.padded)) {
                    org.spongycastle.crypto.params.ParametersWithIV v17_6 = v18_8;
                } else {
                    v17_6 = new org.spongycastle.crypto.params.ParametersWithRandom;
                    v17_6(v18_8, p26);
                }
                try {
                    switch (p23) {
                        case 1:
                        case 3:
                            this.cipher.init(1, v17_6);
                            return;
                        case 2:
                        case 4:
                            this.cipher.init(0, v17_6);
                            return;
                        default:
                            throw new java.security.InvalidParameterException(new StringBuilder().append("unknown opmode ").append(p23).append(" passed").toString());
                    }
                } catch (Exception v10) {
                }
                throw new org.spongycastle.jcajce.provider.symmetric.util.BaseBlockCipher$1(this, v10.getMessage(), v10);
            } else {
                throw new java.security.InvalidAlgorithmParameterException("RC5 requires an RC5ParametersSpec to be passed in.");
            }
        } else {
            throw new java.security.InvalidKeyException(new StringBuilder().append("Key for algorithm ").append(p24.getAlgorithm()).append(" not suitable for symmetric enryption.").toString());
        }
    }

Method org.spongycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi.encodeKey() calling method java.security.Key.getAlgorithm()


    private void encodeKey(java.security.Key p3, java.io.DataOutputStream p4)
    {
        byte[] v0 = p3.getEncoded();
        if (!(p3 instanceof java.security.PrivateKey)) {
            if (!(p3 instanceof java.security.PublicKey)) {
                p4.write(2);
            } else {
                p4.write(1);
            }
        } else {
            p4.write(0);
        }
        p4.writeUTF(p3.getFormat());
        p4.writeUTF(p3.getAlgorithm());
        p4.writeInt(v0.length);
        p4.write(v0);
        return;
    }

Method org.spongycastle.jcajce.util.ProviderJcaJceHelper.createKeyGenerator() calling method javax.crypto.KeyGenerator.getInstance()


    public javax.crypto.KeyGenerator createKeyGenerator(String p2)
    {
        return javax.crypto.KeyGenerator.getInstance(p2, this.provider);
    }

Method org.spongycastle.jcajce.util.NamedJcaJceHelper.createKeyGenerator() calling method javax.crypto.KeyGenerator.getInstance()


    public javax.crypto.KeyGenerator createKeyGenerator(String p2)
    {
        return javax.crypto.KeyGenerator.getInstance(p2, this.providerName);
    }

Method org.spongycastle.jcajce.util.DefaultJcaJceHelper.createKeyGenerator() calling method javax.crypto.KeyGenerator.getInstance()


    public javax.crypto.KeyGenerator createKeyGenerator(String p2)
    {
        return javax.crypto.KeyGenerator.getInstance(p2);
    }

Method org.spongycastle.cms.jcajce.JceCMSMacCalculatorBuilder$CMSMacCalculator.<init>() calling method javax.crypto.KeyGenerator.generateKey()


    JceCMSMacCalculatorBuilder$CMSMacCalculator(org.spongycastle.cms.jcajce.JceCMSMacCalculatorBuilder p6, org.spongycastle.asn1.ASN1ObjectIdentifier p7, int p8, java.security.SecureRandom p9)
    {
        this.this$0 = p6;
        javax.crypto.KeyGenerator v0 = org.spongycastle.cms.jcajce.JceCMSMacCalculatorBuilder.access$000(p6).createKeyGenerator(p7);
        if (p9 == null) {
            p9 = new java.security.SecureRandom();
        }
        this.random = p9;
        if (p8 >= 0) {
            v0.init(p8, p9);
        } else {
            v0.init(p9);
        }
        this.encKey = v0.generateKey();
        this.algorithmIdentifier = org.spongycastle.cms.jcajce.JceCMSMacCalculatorBuilder.access$000(p6).getAlgorithmIdentifier(p7, this.generateParameterSpec(p7, this.encKey));
        this.mac = org.spongycastle.cms.jcajce.JceCMSMacCalculatorBuilder.access$000(p6).createContentMac(this.encKey, this.algorithmIdentifier);
        return;
    }

Method org.spongycastle.cms.jcajce.JceCMSContentEncryptorBuilder$CMSOutputEncryptor.<init>() calling method javax.crypto.KeyGenerator.generateKey()


    JceCMSContentEncryptorBuilder$CMSOutputEncryptor(org.spongycastle.cms.jcajce.JceCMSContentEncryptorBuilder p7, org.spongycastle.asn1.ASN1ObjectIdentifier p8, int p9, java.security.SecureRandom p10)
    {
        this.this$0 = p7;
        javax.crypto.KeyGenerator v1 = org.spongycastle.cms.jcajce.JceCMSContentEncryptorBuilder.access$000(p7).createKeyGenerator(p8);
        if (p10 == null) {
            p10 = new java.security.SecureRandom();
        }
        if (p9 >= 0) {
            v1.init(p9, p10);
        } else {
            v1.init(p10);
        }
        this.cipher = org.spongycastle.cms.jcajce.JceCMSContentEncryptorBuilder.access$000(p7).createCipher(p8);
        this.encKey = v1.generateKey();
        java.security.AlgorithmParameters v2 = org.spongycastle.cms.jcajce.JceCMSContentEncryptorBuilder.access$000(p7).generateParameters(p8, this.encKey, p10);
        try {
            this.cipher.init(1, this.encKey, v2, p10);
        } catch (java.security.GeneralSecurityException v0) {
            throw new org.spongycastle.cms.CMSException(new StringBuilder().append("unable to initialize cipher: ").append(v0.getMessage()).toString(), v0);
        }
        if (v2 == null) {
            v2 = this.cipher.getParameters();
        }
        this.algorithmIdentifier = org.spongycastle.cms.jcajce.JceCMSContentEncryptorBuilder.access$000(p7).getAlgorithmIdentifier(p8, v2);
        return;
    }

Method org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder$CRMFOutputEncryptor.<init>() calling method javax.crypto.KeyGenerator.generateKey()


    JceCRMFEncryptorBuilder$CRMFOutputEncryptor(org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder p7, org.spongycastle.asn1.ASN1ObjectIdentifier p8, int p9, java.security.SecureRandom p10)
    {
        this.this$0 = p7;
        javax.crypto.KeyGenerator v1 = org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder.access$000(p7).createKeyGenerator(p8);
        if (p10 == null) {
            p10 = new java.security.SecureRandom();
        }
        if (p9 < 0) {
            p9 = org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder.access$100().getKeySize(p8);
        }
        if (p9 >= 0) {
            v1.init(p9, p10);
        } else {
            v1.init(p10);
        }
        this.cipher = org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder.access$000(p7).createCipher(p8);
        this.encKey = v1.generateKey();
        java.security.AlgorithmParameters v2 = org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder.access$000(p7).generateParameters(p8, this.encKey, p10);
        try {
            this.cipher.init(1, this.encKey, v2, p10);
        } catch (java.security.GeneralSecurityException v0) {
            throw new org.spongycastle.cert.crmf.CRMFException(new StringBuilder().append("unable to initialize cipher: ").append(v0.getMessage()).toString(), v0);
        }
        if (v2 == null) {
            v2 = this.cipher.getParameters();
        }
        this.algorithmIdentifier = org.spongycastle.cert.crmf.jcajce.JceCRMFEncryptorBuilder.access$000(p7).getAlgorithmIdentifier(p8, v2);
        return;
    }

Method org.spongycastle.jcajce.provider.keystore.pkcs12.PKCS12KeyStoreSpi.createCipher() calling method javax.crypto.Cipher.getInstance()


    private javax.crypto.Cipher createCipher(int p17, char[] p18, org.spongycastle.asn1.x509.AlgorithmIdentifier p19)
    {
        javax.crypto.SecretKey v14;
        org.spongycastle.asn1.pkcs.PBES2Parameters v7 = org.spongycastle.asn1.pkcs.PBES2Parameters.getInstance(p19.getParameters());
        org.spongycastle.asn1.pkcs.PBKDF2Params v12 = org.spongycastle.asn1.pkcs.PBKDF2Params.getInstance(v7.getKeyDerivationFunc().getParameters());
        org.spongycastle.asn1.x509.AlgorithmIdentifier v10 = org.spongycastle.asn1.x509.AlgorithmIdentifier.getInstance(v7.getEncryptionScheme());
        javax.crypto.SecretKeyFactory v15 = this.helper.createSecretKeyFactory(v7.getKeyDerivationFunc().getAlgorithm().getId());
        if (!v12.isDefaultPrf()) {
            v14 = v15.generateSecret(new org.spongycastle.jcajce.spec.PBKDF2KeySpec(p18, v12.getSalt(), v12.getIterationCount().intValue(), org.spongycastle.jcajce.provider.keystore.pkcs12.PKCS12KeyStoreSpi.keySizeProvider.getKeySize(v10), v12.getPrf()));
        } else {
            v14 = v15.generateSecret(new javax.crypto.spec.PBEKeySpec(p18, v12.getSalt(), v12.getIterationCount().intValue(), org.spongycastle.jcajce.provider.keystore.pkcs12.PKCS12KeyStoreSpi.keySizeProvider.getKeySize(v10)));
        }
        javax.crypto.Cipher v8 = javax.crypto.Cipher.getInstance(v7.getEncryptionScheme().getAlgorithm().getId());
        org.spongycastle.asn1.x509.AlgorithmIdentifier.getInstance(v7.getEncryptionScheme());
        org.spongycastle.asn1.ASN1Encodable v9 = v7.getEncryptionScheme().getParameters();
        if (!(v9 instanceof org.spongycastle.asn1.ASN1OctetString)) {
            org.spongycastle.asn1.cryptopro.GOST28147Parameters v13 = org.spongycastle.asn1.cryptopro.GOST28147Parameters.getInstance(v9);
            v8.init(p17, v14, new org.spongycastle.jcajce.spec.GOST28147ParameterSpec(v13.getEncryptionParamSet(), v13.getIV()));
        } else {
            v8.init(p17, v14, new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(v9).getOctets()));
        }
        return v8;
    }

Method org.spongycastle.jcajce.util.ProviderJcaJceHelper.createCipher() calling method javax.crypto.Cipher.getInstance()


    public javax.crypto.Cipher createCipher(String p2)
    {
        return javax.crypto.Cipher.getInstance(p2, this.provider);
    }

Method org.spongycastle.jcajce.util.NamedJcaJceHelper.createCipher() calling method javax.crypto.Cipher.getInstance()


    public javax.crypto.Cipher createCipher(String p2)
    {
        return javax.crypto.Cipher.getInstance(p2, this.providerName);
    }

Method org.spongycastle.jcajce.util.DefaultJcaJceHelper.createCipher() calling method javax.crypto.Cipher.getInstance()


    public javax.crypto.Cipher createCipher(String p2)
    {
        return javax.crypto.Cipher.getInstance(p2);
    }

Method org.spongycastle.operator.jcajce.JceAsymmetricKeyWrapper.generateWrappedKey() calling method javax.crypto.Cipher.doFinal()


    public byte[] generateWrappedKey(org.spongycastle.operator.GenericKey p8)
    {
        javax.crypto.Cipher v3 = this.helper.createAsymmetricWrapper(this.getAlgorithmIdentifier().getAlgorithm(), this.extraMappings);
        java.security.AlgorithmParameters v0 = this.helper.createAlgorithmParameters(this.getAlgorithmIdentifier());
        byte[] v2 = 0;
        try {
            if (v0 == null) {
                v3.init(3, this.publicKey, this.random);
                v2 = v3.wrap(org.spongycastle.operator.jcajce.OperatorUtils.getJceKey(p8));
            } else {
                v3.init(3, this.publicKey, v0, this.random);
            }
        } catch (org.spongycastle.operator.OperatorException v4) {
        } catch (org.spongycastle.operator.OperatorException v4) {
        } catch (org.spongycastle.operator.OperatorException v4) {
        } catch (org.spongycastle.operator.OperatorException v4) {
        } catch (org.spongycastle.operator.OperatorException v4) {
        }
        if (v2 == null) {
            try {
                v3.init(1, this.publicKey, this.random);
                v2 = v3.doFinal(org.spongycastle.operator.jcajce.OperatorUtils.getJceKey(p8).getEncoded());
            } catch (java.security.GeneralSecurityException v1_1) {
                throw new org.spongycastle.operator.OperatorException("unable to encrypt contents key", v1_1);
            } catch (java.security.GeneralSecurityException v1_0) {
                throw new org.spongycastle.operator.OperatorException("unable to encrypt contents key", v1_0);
            }
        }
        return v2;
    }

Method org.spongycastle.operator.jcajce.JceAsymmetricKeyUnwrapper.generateUnwrappedKey() calling method javax.crypto.Cipher.doFinal()


    public org.spongycastle.operator.GenericKey generateUnwrappedKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p10, byte[] p11)
    {
        java.security.Key v4_0 = 0;
        try {
            javax.crypto.Cipher v3 = this.helper.createAsymmetricWrapper(this.getAlgorithmIdentifier().getAlgorithm(), this.extraMappings);
            java.security.AlgorithmParameters v0 = this.helper.createAlgorithmParameters(this.getAlgorithmIdentifier());
            try {
                if (v0 == null) {
                    v3.init(4, this.privKey);
                    v4_0 = v3.unwrap(p11, this.helper.getKeyAlgorithmName(p10.getAlgorithm()), 3);
                    if (this.unwrappedKeyMustBeEncodable) {
                        try {
                            byte[] v2 = v4_0.getEncoded();
                        } catch (javax.crypto.BadPaddingException v1) {
                            v4_0 = 0;
                        }
                        if ((v2 == null) || (v2.length == 0)) {
                            v4_0 = 0;
                        }
                    }
                    java.security.Key v5 = v4_0;
                } else {
                    v3.init(4, this.privKey, v0);
                }
            } catch (org.spongycastle.operator.jcajce.JceGenericKey v6) {
                v5 = v4_0;
            } catch (org.spongycastle.operator.jcajce.JceGenericKey v6) {
                v5 = v4_0;
            } catch (org.spongycastle.operator.jcajce.JceGenericKey v6) {
                v5 = v4_0;
            } catch (org.spongycastle.operator.jcajce.JceGenericKey v6) {
                v5 = v4_0;
            }
            java.security.Key v4_1;
            if (v5 != null) {
                v4_1 = v5;
            } else {
                try {
                    v3.init(2, this.privKey);
                    v4_1 = new javax.crypto.spec.SecretKeySpec(v3.doFinal(p11), p10.getAlgorithm().getId());
                } catch (javax.crypto.BadPaddingException v1_0) {
                    throw new org.spongycastle.operator.OperatorException(new StringBuilder().append("key invalid: ").append(v1_0.getMessage()).toString(), v1_0);
                } catch (javax.crypto.BadPaddingException v1_2) {
                    throw new org.spongycastle.operator.OperatorException(new StringBuilder().append("illegal blocksize: ").append(v1_2.getMessage()).toString(), v1_2);
                } catch (javax.crypto.BadPaddingException v1_1) {
                    throw new org.spongycastle.operator.OperatorException(new StringBuilder().append("bad padding: ").append(v1_1.getMessage()).toString(), v1_1);
                }
            }
            return new org.spongycastle.operator.jcajce.JceGenericKey(p10, v4_1);
        } catch (javax.crypto.BadPaddingException v1_0) {
        } catch (javax.crypto.BadPaddingException v1_2) {
        } catch (javax.crypto.BadPaddingException v1_1) {
        }
    }

Method org.spongycastle.openssl.jcajce.PEMUtilities.crypt() calling method javax.crypto.Cipher.doFinal()


    static byte[] crypt(boolean p19, org.spongycastle.jcajce.util.JcaJceHelper p20, byte[] p21, char[] p22, String p23, byte[] p24)
    {
        javax.crypto.spec.RC2ParameterSpec v15_2 = new javax.crypto.spec.IvParameterSpec(p24);
        String v9 = "CBC";
        String v14 = "PKCS5Padding";
        if (p23.endsWith("-CFB")) {
            v9 = "CFB";
            v14 = "NoPadding";
        }
        if ((p23.endsWith("-ECB")) || (("DES-EDE".equals(p23)) || ("DES-EDE3".equals(p23)))) {
            v9 = "ECB";
            v15_2 = 0;
        }
        if (p23.endsWith("-OFB")) {
            v9 = "OFB";
            v14 = "NoPadding";
        }
        String v5;
        javax.crypto.SecretKey v16;
        if (!p23.startsWith("DES-EDE")) {
            if (!p23.startsWith("DES-")) {
                if (!p23.startsWith("BF-")) {
                    if (!p23.startsWith("RC2-")) {
                        if (!p23.startsWith("AES-")) {
                            throw new org.spongycastle.openssl.EncryptionException("unknown encryption with private key");
                        } else {
                            v5 = "AES";
                            byte[] v17 = p24;
                            if (p24.length > 8) {
                                String v0_24 = new byte[8];
                                v17 = v0_24;
                                System.arraycopy(p24, 0, v17, 0, 8);
                            }
                            int v12_0;
                            if (!p23.startsWith("AES-128-")) {
                                if (!p23.startsWith("AES-192-")) {
                                    if (!p23.startsWith("AES-256-")) {
                                        throw new org.spongycastle.openssl.EncryptionException("unknown AES encryption with private key");
                                    } else {
                                        v12_0 = 256;
                                    }
                                } else {
                                    v12_0 = 192;
                                }
                            } else {
                                v12_0 = 128;
                            }
                            v16 = org.spongycastle.openssl.jcajce.PEMUtilities.getKey(p20, p22, "AES", (v12_0 / 8), v17);
                        }
                    } else {
                        v5 = "RC2";
                        int v12_1 = 128;
                        if (!p23.startsWith("RC2-40-")) {
                            if (p23.startsWith("RC2-64-")) {
                                v12_1 = 64;
                            }
                        } else {
                            v12_1 = 40;
                        }
                        v16 = org.spongycastle.openssl.jcajce.PEMUtilities.getKey(p20, p22, "RC2", (v12_1 / 8), p24);
                        if (v15_2 != null) {
                            v15_2 = new javax.crypto.spec.RC2ParameterSpec(v12_1, p24);
                        } else {
                            v15_2 = new javax.crypto.spec.RC2ParameterSpec(v12_1);
                        }
                    }
                } else {
                    v5 = "Blowfish";
                    v16 = org.spongycastle.openssl.jcajce.PEMUtilities.getKey(p20, p22, "Blowfish", 16, p24);
                }
            } else {
                v5 = "DES";
                v16 = org.spongycastle.openssl.jcajce.PEMUtilities.getKey(p20, p22, "DES", 8, p24);
            }
        } else {
            int v8;
            v5 = "DESede";
            if (p23.startsWith("DES-EDE3")) {
                v8 = 0;
            } else {
                v8 = 1;
            }
            v16 = org.spongycastle.openssl.jcajce.PEMUtilities.getKey(p20, p22, "DESede", 24, p24, v8);
        }
        try {
            int v13;
            javax.crypto.Cipher v10 = p20.createCipher(new StringBuilder().append(v5).append("/").append(v9).append("/").append(v14).toString());
        } catch (Exception v11) {
            throw new org.spongycastle.openssl.EncryptionException("exception using cipher - please check password and data.", v11);
        }
        if (!p19) {
            v13 = 2;
        } else {
            v13 = 1;
        }
        if (v15_2 != null) {
            v10.init(v13, v16, v15_2);
        } else {
            v10.init(v13, v16);
        }
        return v10.doFinal(p21);
    }

Method org.spongycastle.jcajce.provider.keystore.pkcs12.PKCS12KeyStoreSpi.cryptData() calling method javax.crypto.Cipher.doFinal()


    protected byte[] cryptData(boolean p13, org.spongycastle.asn1.x509.AlgorithmIdentifier p14, char[] p15, boolean p16, byte[] p17)
    {
        int v6;
        org.spongycastle.asn1.ASN1ObjectIdentifier v1 = p14.getAlgorithm();
        if (!p13) {
            v6 = 2;
        } else {
            v6 = 1;
        }
        java.io.IOException v9_3;
        if (!v1.on(org.spongycastle.asn1.pkcs.PKCSObjectIdentifiers.pkcs_12PbeIds)) {
            if (!v1.equals(org.spongycastle.asn1.pkcs.PKCSObjectIdentifiers.id_PBES2)) {
                throw new java.io.IOException(new StringBuilder().append("unknown PBE algorithm: ").append(v1).toString());
            } else {
                try {
                    v9_3 = this.createCipher(v6, p15, p14).doFinal(p17);
                } catch (Exception v4_0) {
                    throw new java.io.IOException(new StringBuilder().append("exception decrypting data - ").append(v4_0.toString()).toString());
                }
            }
        } else {
            org.spongycastle.asn1.pkcs.PKCS12PBEParams v7 = org.spongycastle.asn1.pkcs.PKCS12PBEParams.getInstance(p14.getParameters());
            new javax.crypto.spec.PBEKeySpec(p15);
            try {
                javax.crypto.spec.PBEParameterSpec v3_1 = new javax.crypto.spec.PBEParameterSpec(v7.getIV(), v7.getIterations().intValue());
                org.spongycastle.jcajce.PKCS12Key v5_1 = new org.spongycastle.jcajce.PKCS12Key(p15, p16);
                javax.crypto.Cipher v2_1 = this.helper.createCipher(v1.getId());
                v2_1.init(v6, v5_1, v3_1);
                v9_3 = v2_1.doFinal(p17);
            } catch (Exception v4_1) {
                throw new java.io.IOException(new StringBuilder().append("exception decrypting data - ").append(v4_1.toString()).toString());
            }
        }
        return v9_3;
    }

Method org.spongycastle.jcajce.io.CipherOutputStream.close() calling method javax.crypto.Cipher.doFinal()


    public void close()
    {
        java.io.IOException v1_0 = 0;
        try {
            byte[] v2 = this.cipher.doFinal();
        } catch (java.io.IOException v0_0) {
            v1_0 = new org.spongycastle.crypto.io.InvalidCipherTextIOException("Error during cipher finalisation", v0_0);
            try {
                this.flush();
                this.out.close();
            } catch (java.io.IOException v0_1) {
                if (v1_0 != null) {
                } else {
                    v1_0 = v0_1;
                }
            }
            if (v1_0 == null) {
                return;
            } else {
                throw v1_0;
            }
        } catch (java.io.IOException v0_2) {
            v1_0 = new java.io.IOException(new StringBuilder().append("Error closing stream: ").append(v0_2).toString());
        }
        if (v2 == null) {
        } else {
            this.out.write(v2);
        }
    }

Method org.spongycastle.jcajce.io.CipherInputStream.finaliseCipher() calling method javax.crypto.Cipher.doFinal()


    private byte[] finaliseCipher()
    {
        try {
            this.finalized = 1;
            return this.cipher.doFinal();
        } catch (java.security.GeneralSecurityException v0) {
            throw new org.spongycastle.crypto.io.InvalidCipherTextIOException("Error finalising cipher", v0);
        }
    }

Method org.spongycastle.cert.crmf.jcajce.JceAsymmetricValueDecryptorGenerator.extractSecretKey() calling method javax.crypto.Cipher.doFinal()


    private java.security.Key extractSecretKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p7, org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9)
    {
        try {
            javax.crypto.Cipher v1 = this.helper.createCipher(p7.getAlgorithm());
            try {
                v1.init(4, this.recipientKey);
                java.security.Key v2_0 = v1.unwrap(p9, p8.getAlgorithm().getId(), 3);
                java.security.Key v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            }
            java.security.Key v2_1;
            if (v3 != null) {
                v2_1 = v3;
            } else {
                try {
                    v1.init(2, this.recipientKey);
                    v2_1 = new javax.crypto.spec.SecretKeySpec(v1.doFinal(p9), p8.getAlgorithm().getId());
                } catch (javax.crypto.BadPaddingException v0_2) {
                    throw new org.spongycastle.cert.crmf.CRMFException("key invalid in message.", v0_2);
                } catch (javax.crypto.BadPaddingException v0_1) {
                    throw new org.spongycastle.cert.crmf.CRMFException("illegal blocksize in message.", v0_1);
                } catch (javax.crypto.BadPaddingException v0_0) {
                    throw new org.spongycastle.cert.crmf.CRMFException("bad padding in message.", v0_0);
                }
            }
            return v2_1;
        } catch (javax.crypto.BadPaddingException v0_2) {
        } catch (javax.crypto.BadPaddingException v0_1) {
        } catch (javax.crypto.BadPaddingException v0_0) {
        }
    }

Method org.spongycastle.operator.jcajce.OperatorUtils.getJceKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    static java.security.Key getJceKey(org.spongycastle.operator.GenericKey p3)
    {
        IllegalArgumentException v0_5;
        if (!(p3.getRepresentation() instanceof java.security.Key)) {
            if (!(p3.getRepresentation() instanceof byte[])) {
                throw new IllegalArgumentException("unknown generic key type");
            } else {
                v0_5 = new javax.crypto.spec.SecretKeySpec(((byte[]) ((byte[]) p3.getRepresentation())), "ENC");
            }
        } else {
            v0_5 = ((java.security.Key) p3.getRepresentation());
        }
        return v0_5;
    }

Method org.spongycastle.operator.jcajce.JceAsymmetricKeyUnwrapper.generateUnwrappedKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public org.spongycastle.operator.GenericKey generateUnwrappedKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p10, byte[] p11)
    {
        java.security.Key v4_0 = 0;
        try {
            javax.crypto.Cipher v3 = this.helper.createAsymmetricWrapper(this.getAlgorithmIdentifier().getAlgorithm(), this.extraMappings);
            java.security.AlgorithmParameters v0 = this.helper.createAlgorithmParameters(this.getAlgorithmIdentifier());
            try {
                if (v0 == null) {
                    v3.init(4, this.privKey);
                    v4_0 = v3.unwrap(p11, this.helper.getKeyAlgorithmName(p10.getAlgorithm()), 3);
                    if (this.unwrappedKeyMustBeEncodable) {
                        try {
                            byte[] v2 = v4_0.getEncoded();
                        } catch (javax.crypto.BadPaddingException v1) {
                            v4_0 = 0;
                        }
                        if ((v2 == null) || (v2.length == 0)) {
                            v4_0 = 0;
                        }
                    }
                    java.security.Key v5 = v4_0;
                } else {
                    v3.init(4, this.privKey, v0);
                }
            } catch (org.spongycastle.operator.jcajce.JceGenericKey v6) {
                v5 = v4_0;
            } catch (org.spongycastle.operator.jcajce.JceGenericKey v6) {
                v5 = v4_0;
            } catch (org.spongycastle.operator.jcajce.JceGenericKey v6) {
                v5 = v4_0;
            } catch (org.spongycastle.operator.jcajce.JceGenericKey v6) {
                v5 = v4_0;
            }
            java.security.Key v4_1;
            if (v5 != null) {
                v4_1 = v5;
            } else {
                try {
                    v3.init(2, this.privKey);
                    v4_1 = new javax.crypto.spec.SecretKeySpec(v3.doFinal(p11), p10.getAlgorithm().getId());
                } catch (javax.crypto.BadPaddingException v1_0) {
                    throw new org.spongycastle.operator.OperatorException(new StringBuilder().append("key invalid: ").append(v1_0.getMessage()).toString(), v1_0);
                } catch (javax.crypto.BadPaddingException v1_2) {
                    throw new org.spongycastle.operator.OperatorException(new StringBuilder().append("illegal blocksize: ").append(v1_2.getMessage()).toString(), v1_2);
                } catch (javax.crypto.BadPaddingException v1_1) {
                    throw new org.spongycastle.operator.OperatorException(new StringBuilder().append("bad padding: ").append(v1_1.getMessage()).toString(), v1_1);
                }
            }
            return new org.spongycastle.operator.jcajce.JceGenericKey(p10, v4_1);
        } catch (javax.crypto.BadPaddingException v1_0) {
        } catch (javax.crypto.BadPaddingException v1_2) {
        } catch (javax.crypto.BadPaddingException v1_1) {
        }
    }

Method org.spongycastle.openssl.jcajce.PEMUtilities.getKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    private static javax.crypto.SecretKey getKey(org.spongycastle.jcajce.util.JcaJceHelper p7, char[] p8, String p9, int p10, byte[] p11, boolean p12)
    {
        try {
            byte[] v1 = p7.createSecretKeyFactory("PBKDF-OpenSSL").generateSecret(new javax.crypto.spec.PBEKeySpec(p8, p11, 1, (p10 * 8))).getEncoded();
        } catch (java.security.GeneralSecurityException v0) {
            throw new org.spongycastle.openssl.PEMException(new StringBuilder().append("Unable to create OpenSSL PBDKF: ").append(v0.getMessage()).toString(), v0);
        }
        if ((p12) && (v1.length >= 24)) {
            System.arraycopy(v1, 0, v1, 16, 8);
        }
        return new javax.crypto.spec.SecretKeySpec(v1, p9);
    }

Method org.spongycastle.openssl.jcajce.PEMUtilities.generateSecretKeyForPKCS5Scheme2() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public static javax.crypto.SecretKey generateSecretKeyForPKCS5Scheme2(org.spongycastle.jcajce.util.JcaJceHelper p4, String p5, char[] p6, byte[] p7, int p8)
    {
        return new javax.crypto.spec.SecretKeySpec(p4.createSecretKeyFactory("PBKDF2with8BIT").generateSecret(new javax.crypto.spec.PBEKeySpec(p6, p7, p8, org.spongycastle.openssl.jcajce.PEMUtilities.getKeySize(p5))).getEncoded(), p5);
    }

Method org.spongycastle.jce.provider.BrokenJCEBlockCipher.engineUnwrap() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.Key engineUnwrap(byte[] p8, String p9, int p10)
    {
        try {
            java.security.InvalidKeyException v4_11;
            byte[] v2 = this.engineDoFinal(p8, 0, p8.length);
        } catch (java.security.NoSuchAlgorithmException v0_0) {
            throw new java.security.InvalidKeyException(v0_0.getMessage());
        } catch (java.security.spec.InvalidKeySpecException v1_1) {
            throw new java.security.InvalidKeyException(v1_1.getMessage());
        }
        if (p10 != 3) {
            try {
                java.security.KeyFactory v3 = java.security.KeyFactory.getInstance(p9, "SC");
            } catch (java.security.NoSuchAlgorithmException v0_2) {
                throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v0_2.getMessage()).toString());
            } catch (java.security.NoSuchAlgorithmException v0_1) {
                throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v0_1.getMessage()).toString());
            } catch (java.security.spec.InvalidKeySpecException v1_0) {
                throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v1_0.getMessage()).toString());
            }
            if (p10 != 1) {
                if (p10 != 2) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(p10).toString());
                } else {
                    v4_11 = v3.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v2));
                }
            } else {
                v4_11 = v3.generatePublic(new java.security.spec.X509EncodedKeySpec(v2));
            }
        } else {
            v4_11 = new javax.crypto.spec.SecretKeySpec(v2, p9);
        }
        return v4_11;
    }

Method org.spongycastle.jcajce.provider.symmetric.OpenSSLPBKDF$PBKDF.engineGenerateSecret() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateSecret(java.security.spec.KeySpec p6)
    {
        if (!(p6 instanceof javax.crypto.spec.PBEKeySpec)) {
            throw new java.security.spec.InvalidKeySpecException("Invalid KeySpec");
        } else {
            if (((javax.crypto.spec.PBEKeySpec) p6).getSalt() != null) {
                if (((javax.crypto.spec.PBEKeySpec) p6).getIterationCount() > 0) {
                    if (((javax.crypto.spec.PBEKeySpec) p6).getKeyLength() > 0) {
                        if (((javax.crypto.spec.PBEKeySpec) p6).getPassword().length != 0) {
                            org.spongycastle.crypto.generators.OpenSSLPBEParametersGenerator v0_1 = new org.spongycastle.crypto.generators.OpenSSLPBEParametersGenerator();
                            v0_1.init(org.spongycastle.util.Strings.toByteArray(((javax.crypto.spec.PBEKeySpec) p6).getPassword()), ((javax.crypto.spec.PBEKeySpec) p6).getSalt());
                            return new javax.crypto.spec.SecretKeySpec(((org.spongycastle.crypto.params.KeyParameter) v0_1.generateDerivedParameters(((javax.crypto.spec.PBEKeySpec) p6).getKeyLength())).getKey(), "OpenSSLPBKDF");
                        } else {
                            throw new IllegalArgumentException("password empty");
                        }
                    } else {
                        throw new java.security.spec.InvalidKeySpecException(new StringBuilder().append("positive key length required: ").append(((javax.crypto.spec.PBEKeySpec) p6).getKeyLength()).toString());
                    }
                } else {
                    throw new java.security.spec.InvalidKeySpecException(new StringBuilder().append("positive iteration count required: ").append(((javax.crypto.spec.PBEKeySpec) p6).getIterationCount()).toString());
                }
            } else {
                throw new java.security.spec.InvalidKeySpecException("missing required salt");
            }
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.DESede$KeyGenerator.engineGenerateKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateKey()
    {
        if (this.uninitialised) {
            this.engine.init(new org.spongycastle.crypto.KeyGenerationParameters(new java.security.SecureRandom(), this.defaultKeySize));
            this.uninitialised = 0;
        }
        javax.crypto.spec.SecretKeySpec v1_3;
        if (this.keySizeSet) {
            v1_3 = new javax.crypto.spec.SecretKeySpec(this.engine.generateKey(), this.algName);
        } else {
            byte[] v0 = this.engine.generateKey();
            System.arraycopy(v0, 0, v0, 16, 8);
            v1_3 = new javax.crypto.spec.SecretKeySpec(v0, this.algName);
        }
        return v1_3;
    }

Method org.spongycastle.jcajce.provider.symmetric.DESede$KeyFactory.engineGetKeySpec() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.spec.KeySpec engineGetKeySpec(javax.crypto.SecretKey p7, Class p8)
    {
        if (p8 != null) {
            if (p7 != null) {
                javax.crypto.spec.DESedeKeySpec v3_4;
                if (!javax.crypto.spec.SecretKeySpec.isAssignableFrom(p8)) {
                    if (!javax.crypto.spec.DESedeKeySpec.isAssignableFrom(p8)) {
                        throw new java.security.spec.InvalidKeySpecException("Invalid KeySpec");
                    } else {
                        byte[] v0 = p7.getEncoded();
                        try {
                            if (v0.length != 16) {
                                v3_4 = new javax.crypto.spec.DESedeKeySpec(v0);
                            } else {
                                byte[] v2 = new byte[24];
                                System.arraycopy(v0, 0, v2, 0, 16);
                                System.arraycopy(v0, 0, v2, 16, 8);
                                v3_4 = new javax.crypto.spec.DESedeKeySpec(v2);
                            }
                        } catch (Exception v1) {
                            throw new java.security.spec.InvalidKeySpecException(v1.toString());
                        }
                    }
                } else {
                    v3_4 = new javax.crypto.spec.SecretKeySpec(p7.getEncoded(), this.algName);
                }
                return v3_4;
            } else {
                throw new java.security.spec.InvalidKeySpecException("key parameter is null");
            }
        } else {
            throw new java.security.spec.InvalidKeySpecException("keySpec parameter is null");
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.DESede$KeyFactory.engineGenerateSecret() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateSecret(java.security.spec.KeySpec p5)
    {
        javax.crypto.SecretKey v1_1;
        if (!(p5 instanceof javax.crypto.spec.DESedeKeySpec)) {
            v1_1 = super.engineGenerateSecret(p5);
        } else {
            v1_1 = new javax.crypto.spec.SecretKeySpec(((javax.crypto.spec.DESedeKeySpec) p5).getKey(), "DESede");
        }
        return v1_1;
    }

Method org.spongycastle.jcajce.provider.symmetric.DES$KeyGenerator.engineGenerateKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateKey()
    {
        if (this.uninitialised) {
            this.engine.init(new org.spongycastle.crypto.KeyGenerationParameters(new java.security.SecureRandom(), this.defaultKeySize));
            this.uninitialised = 0;
        }
        return new javax.crypto.spec.SecretKeySpec(this.engine.generateKey(), this.algName);
    }

Method org.spongycastle.jcajce.provider.symmetric.DES$KeyFactory.engineGetKeySpec() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.spec.KeySpec engineGetKeySpec(javax.crypto.SecretKey p6, Class p7)
    {
        if (p7 != null) {
            if (p6 != null) {
                java.security.spec.InvalidKeySpecException v2_3;
                if (!javax.crypto.spec.SecretKeySpec.isAssignableFrom(p7)) {
                    if (!javax.crypto.spec.DESKeySpec.isAssignableFrom(p7)) {
                        throw new java.security.spec.InvalidKeySpecException("Invalid KeySpec");
                    } else {
                        try {
                            v2_3 = new javax.crypto.spec.DESKeySpec(p6.getEncoded());
                        } catch (Exception v1) {
                            throw new java.security.spec.InvalidKeySpecException(v1.toString());
                        }
                    }
                } else {
                    v2_3 = new javax.crypto.spec.SecretKeySpec(p6.getEncoded(), this.algName);
                }
                return v2_3;
            } else {
                throw new java.security.spec.InvalidKeySpecException("key parameter is null");
            }
        } else {
            throw new java.security.spec.InvalidKeySpecException("keySpec parameter is null");
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.DES$KeyFactory.engineGenerateSecret() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateSecret(java.security.spec.KeySpec p5)
    {
        javax.crypto.SecretKey v1_1;
        if (!(p5 instanceof javax.crypto.spec.DESKeySpec)) {
            v1_1 = super.engineGenerateSecret(p5);
        } else {
            v1_1 = new javax.crypto.spec.SecretKeySpec(((javax.crypto.spec.DESKeySpec) p5).getKey(), "DES");
        }
        return v1_1;
    }

Method org.spongycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineUnwrap() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.Key engineUnwrap(byte[] p11, String p12, int p13)
    {
        try {
            byte[] v2;
            if (this.wrapEngine != null) {
                v2 = this.wrapEngine.unwrap(p11, 0, p11.length);
            } else {
                v2 = this.engineDoFinal(p11, 0, p11.length);
            }
        } catch (Exception v0_1) {
            throw new java.security.InvalidKeyException(v0_1.getMessage());
        } catch (Exception v0_0) {
            throw new java.security.InvalidKeyException(v0_0.getMessage());
        } catch (java.security.spec.InvalidKeySpecException v1_1) {
            throw new java.security.InvalidKeyException(v1_1.getMessage());
        }
        java.security.PrivateKey v5_1;
        if (p13 != 3) {
            if ((!p12.equals("")) || (p13 != 2)) {
                try {
                    java.security.KeyFactory v4 = this.helper.createKeyFactory(p12);
                } catch (Exception v0_2) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v0_2.getMessage()).toString());
                } catch (java.security.spec.InvalidKeySpecException v1_0) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v1_0.getMessage()).toString());
                }
                if (p13 != 1) {
                    if (p13 != 2) {
                        throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(p13).toString());
                    } else {
                        v5_1 = v4.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v2));
                    }
                } else {
                    v5_1 = v4.generatePublic(new java.security.spec.X509EncodedKeySpec(v2));
                }
            } else {
                try {
                    org.spongycastle.asn1.pkcs.PrivateKeyInfo v3 = org.spongycastle.asn1.pkcs.PrivateKeyInfo.getInstance(v2);
                    v5_1 = org.spongycastle.jce.provider.BouncyCastleProvider.getPrivateKey(v3);
                } catch (Exception v0) {
                    throw new java.security.InvalidKeyException("Invalid key encoding.");
                }
                if (v5_1 == null) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("algorithm ").append(v3.getPrivateKeyAlgorithm().getAlgorithm()).append(" not supported").toString());
                }
            }
        } else {
            v5_1 = new javax.crypto.spec.SecretKeySpec(v2, p12);
        }
        return v5_1;
    }

Method org.spongycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi.decodeKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    private java.security.Key decodeKey(java.io.DataInputStream p10)
    {
        java.security.spec.X509EncodedKeySpec v5_1;
        java.io.IOException v6_13;
        int v4 = p10.read();
        String v3 = p10.readUTF();
        String v0 = p10.readUTF();
        byte[] v2 = new byte[p10.readInt()];
        p10.readFully(v2);
        if ((!v3.equals("PKCS#8")) && (!v3.equals("PKCS8"))) {
            if ((!v3.equals("X.509")) && (!v3.equals("X509"))) {
                if (!v3.equals("RAW")) {
                    throw new java.io.IOException(new StringBuilder().append("Key format ").append(v3).append(" not recognised!").toString());
                } else {
                    v6_13 = new javax.crypto.spec.SecretKeySpec(v2, v0);
                }
            } else {
                v5_1 = new java.security.spec.X509EncodedKeySpec(v2);
                try {
                    switch (v4) {
                        case 0:
                            v6_13 = this.helper.createKeyFactory(v0).generatePrivate(v5_1);
                            break;
                        case 1:
                            v6_13 = this.helper.createKeyFactory(v0).generatePublic(v5_1);
                            break;
                        case 2:
                            v6_13 = this.helper.createSecretKeyFactory(v0).generateSecret(v5_1);
                            break;
                        default:
                            throw new java.io.IOException(new StringBuilder().append("Key type ").append(v4).append(" not recognised!").toString());
                    }
                } catch (Exception v1) {
                }
                throw new java.io.IOException(new StringBuilder().append("Exception creating key: ").append(v1.toString()).toString());
            }
        } else {
            v5_1 = new java.security.spec.PKCS8EncodedKeySpec(v2);
        }
        return v6_13;
    }

Method org.spongycastle.jcajce.provider.symmetric.util.BaseSecretKeyFactory.engineTranslateKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineTranslateKey(javax.crypto.SecretKey p4)
    {
        if (p4 != null) {
            if (p4.getAlgorithm().equalsIgnoreCase(this.algName)) {
                return new javax.crypto.spec.SecretKeySpec(p4.getEncoded(), this.algName);
            } else {
                throw new java.security.InvalidKeyException(new StringBuilder().append("Key not of type ").append(this.algName).append(".").toString());
            }
        } else {
            throw new java.security.InvalidKeyException("key parameter is null");
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.util.BaseSecretKeyFactory.engineGetKeySpec() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.spec.KeySpec engineGetKeySpec(javax.crypto.SecretKey p8, Class p9)
    {
        if (p9 != null) {
            if (p8 != null) {
                java.security.spec.InvalidKeySpecException v4_4;
                if (!javax.crypto.spec.SecretKeySpec.isAssignableFrom(p9)) {
                    try {
                        Class[] v3 = new Class[1];
                        v3[0] = byte[];
                        reflect.Constructor v0 = p9.getConstructor(v3);
                        Object[] v2 = new Object[1];
                        v2[0] = p8.getEncoded();
                        v4_4 = ((java.security.spec.KeySpec) v0.newInstance(v2));
                    } catch (Exception v1) {
                        throw new java.security.spec.InvalidKeySpecException(v1.toString());
                    }
                } else {
                    v4_4 = new javax.crypto.spec.SecretKeySpec(p8.getEncoded(), this.algName);
                }
                return v4_4;
            } else {
                throw new java.security.spec.InvalidKeySpecException("key parameter is null");
            }
        } else {
            throw new java.security.spec.InvalidKeySpecException("keySpec parameter is null");
        }
    }

Method org.spongycastle.jcajce.provider.symmetric.util.BaseKeyGenerator.engineGenerateKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateKey()
    {
        if (this.uninitialised) {
            this.engine.init(new org.spongycastle.crypto.KeyGenerationParameters(new java.security.SecureRandom(), this.defaultKeySize));
            this.uninitialised = 0;
        }
        return new javax.crypto.spec.SecretKeySpec(this.engine.generateKey(), this.algName);
    }

Method org.spongycastle.jcajce.provider.asymmetric.util.BaseCipherSpi.engineUnwrap() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.Key engineUnwrap(byte[] p11, String p12, int p13)
    {
        try {
            byte[] v2;
            if (this.wrapEngine != null) {
                v2 = this.wrapEngine.unwrap(p11, 0, p11.length);
            } else {
                v2 = this.engineDoFinal(p11, 0, p11.length);
            }
        } catch (Exception v0_1) {
            throw new java.security.InvalidKeyException(v0_1.getMessage());
        } catch (Exception v0_0) {
            throw new java.security.InvalidKeyException(v0_0.getMessage());
        } catch (javax.crypto.IllegalBlockSizeException v1) {
            throw new java.security.InvalidKeyException(v1.getMessage());
        }
        java.security.PrivateKey v5_0;
        if (p13 != 3) {
            if ((!p12.equals("")) || (p13 != 2)) {
                try {
                    java.security.KeyFactory v4 = this.helper.createKeyFactory(p12);
                } catch (Exception v0_4) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v0_4.getMessage()).toString());
                } catch (Exception v0_3) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v0_3.getMessage()).toString());
                } catch (Exception v0_2) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(v0_2.getMessage()).toString());
                }
                if (p13 != 1) {
                    if (p13 != 2) {
                        throw new java.security.InvalidKeyException(new StringBuilder().append("Unknown key type ").append(p13).toString());
                    } else {
                        v5_0 = v4.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(v2));
                    }
                } else {
                    v5_0 = v4.generatePublic(new java.security.spec.X509EncodedKeySpec(v2));
                }
            } else {
                try {
                    org.spongycastle.asn1.pkcs.PrivateKeyInfo v3 = org.spongycastle.asn1.pkcs.PrivateKeyInfo.getInstance(v2);
                    v5_0 = org.spongycastle.jce.provider.BouncyCastleProvider.getPrivateKey(v3);
                } catch (Exception v0) {
                    throw new java.security.InvalidKeyException("Invalid key encoding.");
                }
                if (v5_0 == null) {
                    throw new java.security.InvalidKeyException(new StringBuilder().append("algorithm ").append(v3.getPrivateKeyAlgorithm().getAlgorithm()).append(" not supported").toString());
                }
            }
        } else {
            v5_0 = new javax.crypto.spec.SecretKeySpec(v2, p12);
        }
        return v5_0;
    }

Method org.spongycastle.jcajce.provider.asymmetric.ec.KeyAgreementSpi.engineGenerateSecret() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateSecret(String p10)
    {
        byte[] v5 = this.bigIntToBytes(this.result);
        String v0 = org.spongycastle.util.Strings.toUpperCase(p10);
        String v3 = p10;
        if (org.spongycastle.jcajce.provider.asymmetric.ec.KeyAgreementSpi.oids.containsKey(v0)) {
            v3 = ((org.spongycastle.asn1.ASN1ObjectIdentifier) org.spongycastle.jcajce.provider.asymmetric.ec.KeyAgreementSpi.oids.get(v0)).getId();
        }
        int v2 = org.spongycastle.jcajce.provider.asymmetric.ec.KeyAgreementSpi.getKeySize(v3);
        if (this.kdf == null) {
            if (v2 > 0) {
                byte[] v1_0 = new byte[(v2 / 8)];
                System.arraycopy(v5, 0, v1_0, 0, v1_0.length);
                v5 = v1_0;
            }
        } else {
            if (v2 >= 0) {
                byte[] v1_1 = new byte[(v2 / 8)];
                this.kdf.init(new org.spongycastle.crypto.params.KDFParameters(v5, this.ukmParameters));
                this.kdf.generateBytes(v1_1, 0, v1_1.length);
                v5 = v1_1;
            } else {
                throw new java.security.NoSuchAlgorithmException(new StringBuilder().append("unknown algorithm encountered: ").append(v3).toString());
            }
        }
        if (org.spongycastle.jcajce.provider.asymmetric.ec.KeyAgreementSpi.des.containsKey(v3)) {
            org.spongycastle.crypto.params.DESParameters.setOddParity(v5);
        }
        return new javax.crypto.spec.SecretKeySpec(v5, org.spongycastle.jcajce.provider.asymmetric.ec.KeyAgreementSpi.getAlgorithm(p10));
    }

Method org.spongycastle.jcajce.provider.asymmetric.dh.KeyAgreementSpi.engineGenerateSecret() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected javax.crypto.SecretKey engineGenerateSecret(String p7)
    {
        if (this.x != null) {
            javax.crypto.spec.SecretKeySpec v4_2;
            String v0 = org.spongycastle.jcajce.provider.asymmetric.dh.KeyAgreementSpi.getAlgorithm(p7);
            byte[] v3 = this.bigIntToBytes(this.result);
            int v2 = org.spongycastle.jcajce.provider.asymmetric.dh.KeyAgreementSpi.getKeySize(p7);
            if (v2 <= 0) {
                v4_2 = new javax.crypto.spec.SecretKeySpec(v3, v0);
            } else {
                byte[] v1 = new byte[(v2 / 8)];
                System.arraycopy(v3, 0, v1, 0, v1.length);
                if (v0.startsWith("DES")) {
                    org.spongycastle.crypto.params.DESParameters.setOddParity(v1);
                }
                v4_2 = new javax.crypto.spec.SecretKeySpec(v1, v0);
            }
            return v4_2;
        } else {
            throw new IllegalStateException("Diffie-Hellman not initialised.");
        }
    }

Method org.spongycastle.cms.jcajce.JcePasswordRecipientInfoGenerator.generateEncryptedBytes() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public byte[] generateEncryptedBytes(org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9, org.spongycastle.operator.GenericKey p10)
    {
        java.security.Key v0 = this.helper.getJceKey(p10);
        javax.crypto.Cipher v3 = this.helper.createRFC3211Wrapper(p8.getAlgorithm());
        try {
            v3.init(3, new javax.crypto.spec.SecretKeySpec(p9, v3.getAlgorithm()), new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(p8.getParameters()).getOctets()));
            return v3.wrap(v0);
        } catch (java.security.GeneralSecurityException v1) {
            throw new org.spongycastle.cms.CMSException(new StringBuilder().append("cannot process content encryption key: ").append(v1.getMessage()).toString(), v1);
        }
    }

Method org.spongycastle.cms.jcajce.JcePasswordRecipient.extractSecretKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    protected java.security.Key extractSecretKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p7, org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9, byte[] p10)
    {
        javax.crypto.Cipher v2 = this.helper.createRFC3211Wrapper(p7.getAlgorithm());
        try {
            v2.init(4, new javax.crypto.spec.SecretKeySpec(p9, v2.getAlgorithm()), new javax.crypto.spec.IvParameterSpec(org.spongycastle.asn1.ASN1OctetString.getInstance(p7.getParameters()).getOctets()));
            return v2.unwrap(p10, p8.getAlgorithm().getId(), 3);
        } catch (java.security.GeneralSecurityException v0) {
            throw new org.spongycastle.cms.CMSException(new StringBuilder().append("cannot process content encryption key: ").append(v0.getMessage()).toString(), v0);
        }
    }

Method org.spongycastle.cms.jcajce.EnvelopedDataHelper.getJceKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    java.security.Key getJceKey(org.spongycastle.operator.GenericKey p4)
    {
        IllegalArgumentException v0_5;
        if (!(p4.getRepresentation() instanceof java.security.Key)) {
            if (!(p4.getRepresentation() instanceof byte[])) {
                throw new IllegalArgumentException("unknown generic key type");
            } else {
                v0_5 = new javax.crypto.spec.SecretKeySpec(((byte[]) ((byte[]) p4.getRepresentation())), "ENC");
            }
        } else {
            v0_5 = ((java.security.Key) p4.getRepresentation());
        }
        return v0_5;
    }

Method org.spongycastle.cms.jcajce.EnvelopedDataHelper.getJceKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public java.security.Key getJceKey(org.spongycastle.asn1.ASN1ObjectIdentifier p4, org.spongycastle.operator.GenericKey p5)
    {
        IllegalArgumentException v0_6;
        if (!(p5.getRepresentation() instanceof java.security.Key)) {
            if (!(p5.getRepresentation() instanceof byte[])) {
                throw new IllegalArgumentException("unknown generic key type");
            } else {
                v0_6 = new javax.crypto.spec.SecretKeySpec(((byte[]) ((byte[]) p5.getRepresentation())), this.getBaseCipherName(p4));
            }
        } else {
            v0_6 = ((java.security.Key) p5.getRepresentation());
        }
        return v0_6;
    }

Method org.spongycastle.cert.crmf.jcajce.JcePKMACValuesCalculator.calculateMac() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public byte[] calculateMac(byte[] p5, byte[] p6)
    {
        try {
            this.mac.init(new javax.crypto.spec.SecretKeySpec(p5, this.mac.getAlgorithm()));
            return this.mac.doFinal(p6);
        } catch (java.security.GeneralSecurityException v0) {
            throw new org.spongycastle.cert.crmf.CRMFException(new StringBuilder().append("failure in setup: ").append(v0.getMessage()).toString(), v0);
        }
    }

Method org.spongycastle.cert.crmf.jcajce.JceAsymmetricValueDecryptorGenerator.extractSecretKey() calling method javax.crypto.spec.SecretKeySpec.<init>()


    private java.security.Key extractSecretKey(org.spongycastle.asn1.x509.AlgorithmIdentifier p7, org.spongycastle.asn1.x509.AlgorithmIdentifier p8, byte[] p9)
    {
        try {
            javax.crypto.Cipher v1 = this.helper.createCipher(p7.getAlgorithm());
            try {
                v1.init(4, this.recipientKey);
                java.security.Key v2_0 = v1.unwrap(p9, p8.getAlgorithm().getId(), 3);
                java.security.Key v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            } catch (byte[] v4) {
                v3 = v2_0;
            }
            java.security.Key v2_1;
            if (v3 != null) {
                v2_1 = v3;
            } else {
                try {
                    v1.init(2, this.recipientKey);
                    v2_1 = new javax.crypto.spec.SecretKeySpec(v1.doFinal(p9), p8.getAlgorithm().getId());
                } catch (javax.crypto.BadPaddingException v0_2) {
                    throw new org.spongycastle.cert.crmf.CRMFException("key invalid in message.", v0_2);
                } catch (javax.crypto.BadPaddingException v0_1) {
                    throw new org.spongycastle.cert.crmf.CRMFException("illegal blocksize in message.", v0_1);
                } catch (javax.crypto.BadPaddingException v0_0) {
                    throw new org.spongycastle.cert.crmf.CRMFException("bad padding in message.", v0_0);
                }
            }
            return v2_1;
        } catch (javax.crypto.BadPaddingException v0_2) {
        } catch (javax.crypto.BadPaddingException v0_1) {
        } catch (javax.crypto.BadPaddingException v0_0) {
        }
    }

Method org.apache.commons.net.smtp.AuthenticatingSMTPClient.auth() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public boolean auth(org.apache.commons.net.smtp.AuthenticatingSMTPClient$AUTH_METHOD p10, String p11, String p12)
    {
        boolean v5_0 = 0;
        if (org.apache.commons.net.smtp.SMTPReply.isPositiveIntermediate(this.sendCommand(14, org.apache.commons.net.smtp.AuthenticatingSMTPClient$AUTH_METHOD.getAuthName(p10)))) {
            if (!p10.equals(org.apache.commons.net.smtp.AuthenticatingSMTPClient$AUTH_METHOD.PLAIN)) {
                if (!p10.equals(org.apache.commons.net.smtp.AuthenticatingSMTPClient$AUTH_METHOD.CRAM_MD5)) {
                    if ((p10.equals(org.apache.commons.net.smtp.AuthenticatingSMTPClient$AUTH_METHOD.LOGIN)) && (org.apache.commons.net.smtp.SMTPReply.isPositiveIntermediate(this.sendCommand(new String(org.apache.commons.net.util.Base64.encodeBase64(p11.getBytes())))))) {
                        v5_0 = org.apache.commons.net.smtp.SMTPReply.isPositiveCompletion(this.sendCommand(new String(org.apache.commons.net.util.Base64.encodeBase64(p12.getBytes()))));
                    }
                } else {
                    byte[] v2 = org.apache.commons.net.util.Base64.decodeBase64(this.getReplyString().substring(4).trim());
                    javax.crypto.Mac v1 = javax.crypto.Mac.getInstance("HmacMD5");
                    v1.init(new javax.crypto.spec.SecretKeySpec(p12.getBytes(), "HmacMD5"));
                    byte[] v0 = this._convertToHexString(v1.doFinal(v2)).getBytes();
                    byte[] v4 = p11.getBytes();
                    byte[] v3 = new byte[((v4.length + 1) + v0.length)];
                    System.arraycopy(v4, 0, v3, 0, v4.length);
                    v3[v4.length] = 32;
                    System.arraycopy(v0, 0, v3, (v4.length + 1), v0.length);
                    v5_0 = org.apache.commons.net.smtp.SMTPReply.isPositiveCompletion(this.sendCommand(new String(org.apache.commons.net.util.Base64.encodeBase64(v3))));
                }
            } else {
                v5_0 = org.apache.commons.net.smtp.SMTPReply.isPositiveCompletion(this.sendCommand(new String(org.apache.commons.net.util.Base64.encodeBase64(new StringBuilder().append("\u0000").append(p11).append("\u0000").append(p12).toString().getBytes()))));
            }
        }
        return v5_0;
    }

Method org.apache.commons.net.pop3.ExtendedPOP3Client.auth() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public boolean auth(org.apache.commons.net.pop3.ExtendedPOP3Client$AUTH_METHOD p11, String p12, String p13)
    {
        int v5 = 1;
        int v6 = 0;
        if (this.sendCommand(13, p11.getAuthName()) == 2) {
            switch (org.apache.commons.net.pop3.ExtendedPOP3Client$1.$SwitchMap$org$apache$commons$net$pop3$ExtendedPOP3Client$AUTH_METHOD[p11.ordinal()]) {
                case 1:
                    if (this.sendCommand(new String(org.apache.commons.net.util.Base64.encodeBase64(new StringBuilder().append("\u0000").append(p12).append("\u0000").append(p13).toString().getBytes()))) != 0) {
                        v5 = 0;
                    }
                    v6 = v5;
                    break;
                case 2:
                    byte[] v2 = org.apache.commons.net.util.Base64.decodeBase64(this.getReplyString().substring(2).trim());
                    javax.crypto.Mac v1 = javax.crypto.Mac.getInstance("HmacMD5");
                    v1.init(new javax.crypto.spec.SecretKeySpec(p13.getBytes(), "HmacMD5"));
                    byte[] v0 = this._convertToHexString(v1.doFinal(v2)).getBytes();
                    byte[] v4 = p12.getBytes();
                    byte[] v3 = new byte[((v4.length + 1) + v0.length)];
                    System.arraycopy(v4, 0, v3, 0, v4.length);
                    v3[v4.length] = 32;
                    System.arraycopy(v0, 0, v3, (v4.length + 1), v0.length);
                    if (this.sendCommand(new String(org.apache.commons.net.util.Base64.encodeBase64(v3))) != 0) {
                        v5 = 0;
                    }
                    v6 = v5;
                    break;
                default:
            }
        }
        return v6;
    }

Method org.apache.commons.net.imap.AuthenticatingIMAPClient.auth() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public boolean auth(org.apache.commons.net.imap.AuthenticatingIMAPClient$AUTH_METHOD p12, String p13, String p14)
    {
        int v6 = 1;
        int v7 = 0;
        if (org.apache.commons.net.imap.IMAPReply.isContinuation(this.sendCommand(org.apache.commons.net.imap.IMAPCommand.AUTHENTICATE, p12.getAuthName()))) {
            switch (org.apache.commons.net.imap.AuthenticatingIMAPClient$1.$SwitchMap$org$apache$commons$net$imap$AuthenticatingIMAPClient$AUTH_METHOD[p12.ordinal()]) {
                case 1:
                    int v2_0 = this.sendData(new String(org.apache.commons.net.util.Base64.encodeBase64(new StringBuilder().append("\u0000").append(p13).append("\u0000").append(p14).toString().getBytes())));
                    if (v2_0 == 0) {
                        this.setState(org.apache.commons.net.imap.IMAP$IMAPState.AUTH_STATE);
                    }
                    if (v2_0 != 0) {
                        v6 = 0;
                    }
                    v7 = v6;
                    break;
                case 2:
                    byte[] v3 = org.apache.commons.net.util.Base64.decodeBase64(this.getReplyString().substring(2).trim());
                    javax.crypto.Mac v1 = javax.crypto.Mac.getInstance("HmacMD5");
                    v1.init(new javax.crypto.spec.SecretKeySpec(p14.getBytes(), "HmacMD5"));
                    byte[] v0 = this._convertToHexString(v1.doFinal(v3)).getBytes();
                    byte[] v5 = p13.getBytes();
                    byte[] v4 = new byte[((v5.length + 1) + v0.length)];
                    System.arraycopy(v5, 0, v4, 0, v5.length);
                    v4[v5.length] = 32;
                    System.arraycopy(v0, 0, v4, (v5.length + 1), v0.length);
                    int v2_2 = this.sendData(new String(org.apache.commons.net.util.Base64.encodeBase64(v4)));
                    if (v2_2 == 0) {
                        this.setState(org.apache.commons.net.imap.IMAP$IMAPState.AUTH_STATE);
                    }
                    if (v2_2 != 0) {
                        v6 = 0;
                    }
                    v7 = v6;
                    break;
                case 3:
                    if (this.sendData(new String(org.apache.commons.net.util.Base64.encodeBase64(p13.getBytes()))) == 3) {
                        int v2_1 = this.sendData(new String(org.apache.commons.net.util.Base64.encodeBase64(p14.getBytes())));
                        if (v2_1 == 0) {
                            this.setState(org.apache.commons.net.imap.IMAP$IMAPState.AUTH_STATE);
                        }
                        if (v2_1 != 0) {
                            v6 = 0;
                        }
                        v7 = v6;
                    }
                    break;
                default:
            }
        }
        return v7;
    }