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 com.google.android.gms.internal.zzdje.zzb() calling method javax.crypto.Cipher.getInstance()


    public final synthetic Object zzb(String p2, java.security.Provider p3)
    {
        javax.crypto.Cipher v0;
        if (p3 != null) {
            v0 = javax.crypto.Cipher.getInstance(p2, p3);
        } else {
            v0 = javax.crypto.Cipher.getInstance(p2);
        }
        return v0;
    }

Method com.google.android.gms.internal.zzcu.zzb() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public final byte[] zzb(byte[] p8, String p9)
    {
        if (p8.length == 16) {
            try {
                Throwable v0_12 = com.google.android.gms.internal.zzbr.zza(p9, 0);
            } catch (Throwable v0_16) {
                throw new com.google.android.gms.internal.zzcv(this, v0_16);
            } catch (Throwable v0_15) {
                throw new com.google.android.gms.internal.zzcv(this, v0_15);
            } catch (Throwable v0_14) {
                throw new com.google.android.gms.internal.zzcv(this, v0_14);
            } catch (Throwable v0_13) {
                throw new com.google.android.gms.internal.zzcv(this, v0_13);
            } catch (Throwable v0_11) {
                throw new com.google.android.gms.internal.zzcv(this, v0_11);
            } catch (Throwable v0_10) {
                throw new com.google.android.gms.internal.zzcv(this, v0_10);
            } catch (Throwable v0_9) {
                throw new com.google.android.gms.internal.zzcv(this, v0_9);
            }
            if (v0_12.length > 16) {
                javax.crypto.Cipher v1_0 = java.nio.ByteBuffer.allocate(v0_12.length);
                v1_0.put(v0_12);
                v1_0.flip();
                byte[] v2_2 = new byte[16];
                Throwable v0_3 = new byte[(v0_12.length - 16)];
                v1_0.get(v2_2);
                v1_0.get(v0_3);
                com.google.android.gms.internal.zzcu.getCipher().init(2, new javax.crypto.spec.SecretKeySpec(p8, "AES"), new javax.crypto.spec.IvParameterSpec(v2_2));
                return com.google.android.gms.internal.zzcu.getCipher().doFinal(v0_3);
            } else {
                throw new com.google.android.gms.internal.zzcv(this);
            }
        } else {
            throw new com.google.android.gms.internal.zzcv(this);
        }
    }

Method com.google.android.gms.internal.zzcu.zzc() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public final String zzc(byte[] p6, byte[] p7)
    {
        if (p6.length == 16) {
            try {
            } catch (String v0_12) {
                throw new com.google.android.gms.internal.zzcv(this, v0_12);
            } catch (String v0_10) {
                throw new com.google.android.gms.internal.zzcv(this, v0_10);
            } catch (String v0_9) {
                throw new com.google.android.gms.internal.zzcv(this, v0_9);
            } catch (String v0_8) {
                throw new com.google.android.gms.internal.zzcv(this, v0_8);
            } catch (String v0_7) {
                throw new com.google.android.gms.internal.zzcv(this, v0_7);
            }
            com.google.android.gms.internal.zzcu.getCipher().init(1, new javax.crypto.spec.SecretKeySpec(p6, "AES"), 0);
            String v0_2 = com.google.android.gms.internal.zzcu.getCipher().doFinal(p7);
            java.nio.ByteBuffer v2_1 = com.google.android.gms.internal.zzcu.getCipher().getIV();
            int v1_2 = (v0_2.length + v2_1.length);
            java.nio.ByteBuffer v3_1 = java.nio.ByteBuffer.allocate(v1_2);
            v3_1.put(v2_1).put(v0_2);
            v3_1.flip();
            String v0_5 = new byte[v1_2];
            v3_1.get(v0_5);
            return com.google.android.gms.internal.zzbr.zza(v0_5, 0);
        } else {
            throw new com.google.android.gms.internal.zzcv(this);
        }
    }

Method com.google.android.gms.internal.zzdiq.zzaa() calling method javax.crypto.spec.SecretKeySpec.<init>()


    private final com.google.android.gms.internal.zzdho zzaa(com.google.android.gms.internal.zzeuk p6)
    {
        try {
            com.google.android.gms.internal.zzdho v0_0 = com.google.android.gms.internal.zzdhh$zza.zzn(p6);
        } catch (com.google.android.gms.internal.zzdho v0_16) {
            throw new java.security.GeneralSecurityException("expected serialized HmacKey proto", v0_16);
        }
        if ((v0_0 instanceof com.google.android.gms.internal.zzdhh$zza)) {
            com.google.android.gms.internal.zzdho v0_5 = ((com.google.android.gms.internal.zzdhh$zza) v0_0);
            com.google.android.gms.internal.zzdjp.zzq(v0_5.getVersion(), 0);
            if (v0_5.zzbkf().size() >= 16) {
                com.google.android.gms.internal.zzdho v0_6;
                com.google.android.gms.internal.zzdiq.zzc(v0_5.zzblr());
                String v1_5 = v0_5.zzblr().zzblx();
                javax.crypto.spec.SecretKeySpec v3_1 = new javax.crypto.spec.SecretKeySpec(v0_5.zzbkf().toByteArray(), "HMAC");
                int v2_3 = v0_5.zzblr().zzbly();
                switch (com.google.android.gms.internal.zzdir.zzlfw[v1_5.ordinal()]) {
                    case 1:
                        v0_6 = new com.google.android.gms.internal.zzdjn("HMACSHA1", v3_1, v2_3);
                        break;
                    case 2:
                        v0_6 = new com.google.android.gms.internal.zzdjn("HMACSHA256", v3_1, v2_3);
                        break;
                    case 3:
                        v0_6 = new com.google.android.gms.internal.zzdjn("HMACSHA512", v3_1, v2_3);
                        break;
                    default:
                        throw new java.security.GeneralSecurityException("unknown hash");
                }
                return ((com.google.android.gms.internal.zzdho) v0_6);
            } else {
                throw new java.security.GeneralSecurityException("key too short");
            }
        } else {
            throw new java.security.GeneralSecurityException("expected HmacKey proto");
        }
    }

Method com.google.android.gms.internal.zzdiq.zza() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public final synthetic Object zza(com.google.android.gms.internal.zzewl p5)
    {
        if ((p5 instanceof com.google.android.gms.internal.zzdhh$zza)) {
            com.google.android.gms.internal.zzdjp.zzq(((com.google.android.gms.internal.zzdhh$zza) p5).getVersion(), 0);
            if (((com.google.android.gms.internal.zzdhh$zza) p5).zzbkf().size() >= 16) {
                com.google.android.gms.internal.zzdjn v0_8;
                com.google.android.gms.internal.zzdiq.zzc(((com.google.android.gms.internal.zzdhh$zza) p5).zzblr());
                com.google.android.gms.internal.zzdjn v0_4 = ((com.google.android.gms.internal.zzdhh$zza) p5).zzblr().zzblx();
                javax.crypto.spec.SecretKeySpec v2_1 = new javax.crypto.spec.SecretKeySpec(((com.google.android.gms.internal.zzdhh$zza) p5).zzbkf().toByteArray(), "HMAC");
                String v1_4 = ((com.google.android.gms.internal.zzdhh$zza) p5).zzblr().zzbly();
                switch (com.google.android.gms.internal.zzdir.zzlfw[v0_4.ordinal()]) {
                    case 1:
                        v0_8 = new com.google.android.gms.internal.zzdjn("HMACSHA1", v2_1, v1_4);
                        break;
                    case 2:
                        v0_8 = new com.google.android.gms.internal.zzdjn("HMACSHA256", v2_1, v1_4);
                        break;
                    case 3:
                        v0_8 = new com.google.android.gms.internal.zzdjn("HMACSHA512", v2_1, v1_4);
                        break;
                    default:
                        throw new java.security.GeneralSecurityException("unknown hash");
                }
                return v0_8;
            } else {
                throw new java.security.GeneralSecurityException("key too short");
            }
        } else {
            throw new java.security.GeneralSecurityException("expected HmacKey proto");
        }
    }

Method com.google.android.gms.internal.zzdit.<init>() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public zzdit(byte[] p3, int p4)
    {
        this.zzlgp = new javax.crypto.spec.SecretKeySpec(p3, "AES");
        this.zzlgr = ((javax.crypto.Cipher) com.google.android.gms.internal.zzdjc.zzlhg.zzoj("AES/CTR/NoPadding")).getBlockSize();
        if ((p4 >= 12) && (p4 <= this.zzlgr)) {
            this.zzlgq = p4;
            return;
        } else {
            throw new java.security.GeneralSecurityException("invalid IV size");
        }
    }

Method com.google.android.gms.internal.zzdiu.<init>() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public zzdiu(byte[] p5, int p6)
    {
        if ((p6 == 12) || (p6 == 16)) {
            this.zzlgu = p6;
            this.zzlgp = new javax.crypto.spec.SecretKeySpec(p5, "AES");
            IllegalArgumentException v0_1 = javax.crypto.Cipher.getInstance("AES/ECB/NOPADDING");
            v0_1.init(1, this.zzlgp);
            String v1_1 = new byte[16];
            this.zzlgs = com.google.android.gms.internal.zzdiu.zzaj(v0_1.doFinal(v1_1));
            this.zzlgt = com.google.android.gms.internal.zzdiu.zzaj(this.zzlgs);
            return;
        } else {
            throw new IllegalArgumentException("IV size should be either 12 or 16 bytes");
        }
    }

Method com.google.android.gms.internal.zzdiv.<init>() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public zzdiv(byte[] p3)
    {
        this.zzlgp = new javax.crypto.spec.SecretKeySpec(p3, "AES");
        return;
    }

Method com.google.android.gms.internal.zzdiz.zza() calling method javax.crypto.spec.SecretKeySpec.<init>()


    public final com.google.android.gms.internal.zzdja zza(String p9, byte[] p10, byte[] p11, int p12, com.google.android.gms.internal.zzdiy p13)
    {
        int v4 = 1;
        com.google.android.gms.internal.zzdja v0_13 = ((java.security.KeyPairGenerator) com.google.android.gms.internal.zzdjc.zzlhl.zzoj("EC"));
        v0_13.initialize(this.zzlgz.getParams());
        byte[] v1_1 = v0_13.generateKeyPair();
        com.google.android.gms.internal.zzdja v0_2 = ((java.security.interfaces.ECPublicKey) v1_1.getPublic());
        byte[] v1_3 = ((java.security.interfaces.ECPrivateKey) v1_1.getPrivate());
        com.google.android.gms.internal.zzdiw.zza(this.zzlgz.getW(), this.zzlgz.getParams().getCurve());
        int v2_4 = ((javax.crypto.KeyAgreement) com.google.android.gms.internal.zzdjc.zzlhk.zzoj("ECDH"));
        v2_4.init(v1_3);
        v2_4.doPhase(this.zzlgz, 1);
        byte[] v1_5 = v2_4.generateSecret();
        byte[] v5_4 = com.google.android.gms.internal.zzdiw.zza(v0_2.getParams().getCurve(), p13, v0_2.getW());
        com.google.android.gms.internal.zzdja v0_6 = new byte[][2];
        v0_6[0] = v5_4;
        v0_6[1] = v1_5;
        byte[] v1_7 = com.google.android.gms.internal.zzdjp.zzc(v0_6);
        com.google.android.gms.internal.zzdja v0_10 = ((javax.crypto.Mac) com.google.android.gms.internal.zzdjc.zzlhh.zzoj(p9));
        if (p12 <= (v0_10.getMacLength() * 255)) {
            if ((p10 != null) && (p10.length != 0)) {
                v0_10.init(new javax.crypto.spec.SecretKeySpec(p10, p9));
            } else {
                byte[] v6_1 = new byte[v0_10.getMacLength()];
                v0_10.init(new javax.crypto.spec.SecretKeySpec(v6_1, p9));
            }
            byte[] v6_2 = new byte[p12];
            v0_10.init(new javax.crypto.spec.SecretKeySpec(v0_10.doFinal(v1_7), p9));
            byte[] v1_9 = new byte[0];
            int v2_17 = 0;
            while(true) {
                v0_10.update(v1_9);
                v0_10.update(p11);
                v0_10.update(((byte) v4));
                v1_9 = v0_10.doFinal();
                if ((v1_9.length + v2_17) >= p12) {
                    break;
                }
                System.arraycopy(v1_9, 0, v6_2, v2_17, v1_9.length);
                v2_17 += v1_9.length;
                v4++;
            }
            System.arraycopy(v1_9, 0, v6_2, v2_17, (p12 - v2_17));
            return new com.google.android.gms.internal.zzdja(v5_4, v6_2);
        } else {
            throw new java.security.GeneralSecurityException("size too large");
        }
    }

Method com.google.android.gms.internal.zzcu.zzb() calling method javax.crypto.Cipher.doFinal()


    public final byte[] zzb(byte[] p8, String p9)
    {
        if (p8.length == 16) {
            try {
                Throwable v0_12 = com.google.android.gms.internal.zzbr.zza(p9, 0);
            } catch (Throwable v0_16) {
                throw new com.google.android.gms.internal.zzcv(this, v0_16);
            } catch (Throwable v0_15) {
                throw new com.google.android.gms.internal.zzcv(this, v0_15);
            } catch (Throwable v0_14) {
                throw new com.google.android.gms.internal.zzcv(this, v0_14);
            } catch (Throwable v0_13) {
                throw new com.google.android.gms.internal.zzcv(this, v0_13);
            } catch (Throwable v0_11) {
                throw new com.google.android.gms.internal.zzcv(this, v0_11);
            } catch (Throwable v0_10) {
                throw new com.google.android.gms.internal.zzcv(this, v0_10);
            } catch (Throwable v0_9) {
                throw new com.google.android.gms.internal.zzcv(this, v0_9);
            }
            if (v0_12.length > 16) {
                javax.crypto.Cipher v1_0 = java.nio.ByteBuffer.allocate(v0_12.length);
                v1_0.put(v0_12);
                v1_0.flip();
                byte[] v2_2 = new byte[16];
                Throwable v0_3 = new byte[(v0_12.length - 16)];
                v1_0.get(v2_2);
                v1_0.get(v0_3);
                com.google.android.gms.internal.zzcu.getCipher().init(2, new javax.crypto.spec.SecretKeySpec(p8, "AES"), new javax.crypto.spec.IvParameterSpec(v2_2));
                return com.google.android.gms.internal.zzcu.getCipher().doFinal(v0_3);
            } else {
                throw new com.google.android.gms.internal.zzcv(this);
            }
        } else {
            throw new com.google.android.gms.internal.zzcv(this);
        }
    }

Method com.google.android.gms.internal.zzcu.zzc() calling method javax.crypto.Cipher.doFinal()


    public final String zzc(byte[] p6, byte[] p7)
    {
        if (p6.length == 16) {
            try {
            } catch (String v0_12) {
                throw new com.google.android.gms.internal.zzcv(this, v0_12);
            } catch (String v0_10) {
                throw new com.google.android.gms.internal.zzcv(this, v0_10);
            } catch (String v0_9) {
                throw new com.google.android.gms.internal.zzcv(this, v0_9);
            } catch (String v0_8) {
                throw new com.google.android.gms.internal.zzcv(this, v0_8);
            } catch (String v0_7) {
                throw new com.google.android.gms.internal.zzcv(this, v0_7);
            }
            com.google.android.gms.internal.zzcu.getCipher().init(1, new javax.crypto.spec.SecretKeySpec(p6, "AES"), 0);
            String v0_2 = com.google.android.gms.internal.zzcu.getCipher().doFinal(p7);
            java.nio.ByteBuffer v2_1 = com.google.android.gms.internal.zzcu.getCipher().getIV();
            int v1_2 = (v0_2.length + v2_1.length);
            java.nio.ByteBuffer v3_1 = java.nio.ByteBuffer.allocate(v1_2);
            v3_1.put(v2_1).put(v0_2);
            v3_1.flip();
            String v0_5 = new byte[v1_2];
            v3_1.get(v0_5);
            return com.google.android.gms.internal.zzbr.zza(v0_5, 0);
        } else {
            throw new com.google.android.gms.internal.zzcv(this);
        }
    }

Method com.google.android.gms.internal.zzdit.zzai() calling method javax.crypto.Cipher.doFinal()


    public final byte[] zzai(byte[] p9)
    {
        if (p9.length <= (2147483647 - this.zzlgq)) {
            byte[] v4 = new byte[(this.zzlgq + p9.length)];
            String v1_0 = com.google.android.gms.internal.zzdjo.zzft(this.zzlgq);
            System.arraycopy(v1_0, 0, v4, 0, this.zzlgq);
            int v3_1 = p9.length;
            int v5 = this.zzlgq;
            java.security.GeneralSecurityException v0_5 = ((javax.crypto.Cipher) com.google.android.gms.internal.zzdjc.zzlhg.zzoj("AES/CTR/NoPadding"));
            int v6_2 = new byte[this.zzlgr];
            System.arraycopy(v1_0, 0, v6_2, 0, this.zzlgq);
            v0_5.init(1, this.zzlgp, new javax.crypto.spec.IvParameterSpec(v6_2));
            if (v0_5.doFinal(p9, 0, v3_1, v4, v5) == v3_1) {
                return v4;
            } else {
                throw new java.security.GeneralSecurityException("stored output\'s length does not match input\'s length");
            }
        } else {
            throw new java.security.GeneralSecurityException(new StringBuilder(43).append("plaintext length can not exceed ").append((2147483647 - this.zzlgq)).toString());
        }
    }

Method com.google.android.gms.internal.zzdiu.<init>() calling method javax.crypto.Cipher.doFinal()


    public zzdiu(byte[] p5, int p6)
    {
        if ((p6 == 12) || (p6 == 16)) {
            this.zzlgu = p6;
            this.zzlgp = new javax.crypto.spec.SecretKeySpec(p5, "AES");
            IllegalArgumentException v0_1 = javax.crypto.Cipher.getInstance("AES/ECB/NOPADDING");
            v0_1.init(1, this.zzlgp);
            String v1_1 = new byte[16];
            this.zzlgs = com.google.android.gms.internal.zzdiu.zzaj(v0_1.doFinal(v1_1));
            this.zzlgt = com.google.android.gms.internal.zzdiu.zzaj(this.zzlgs);
            return;
        } else {
            throw new IllegalArgumentException("IV size should be either 12 or 16 bytes");
        }
    }

Method com.google.android.gms.internal.zzdiu.zza() calling method javax.crypto.Cipher.doFinal()


    private final byte[] zza(javax.crypto.Cipher p8, int p9, byte[] p10, int p11, int p12)
    {
        int v0_5;
        int v0_0 = 0;
        int v1_4 = new byte[16];
        v1_4[15] = ((byte) p9);
        if (p12 != 0) {
            byte v2_7 = 0;
            byte[] v3_0 = p8.doFinal(v1_4);
            while ((p12 - v2_7) > 16) {
                int v1_6 = 0;
                while (v1_6 < 16) {
                    v3_0[v1_6] = ((byte) (v3_0[v1_6] ^ p10[((p11 + v2_7) + v1_6)]));
                    v1_6++;
                }
                v3_0 = p8.doFinal(v3_0);
                v2_7 += 16;
            }
            int v0_2;
            byte v2_1 = java.util.Arrays.copyOfRange(p10, (p11 + v2_7), (p11 + p12));
            if (v2_1.length != 16) {
                int v1_5 = java.util.Arrays.copyOf(this.zzlgt, 16);
                while (v0_0 < v2_1.length) {
                    v1_5[v0_0] = ((byte) (v1_5[v0_0] ^ v2_1[v0_0]));
                    v0_0++;
                }
                v1_5[v2_1.length] = ((byte) (v1_5[v2_1.length] ^ 128));
                v0_2 = v1_5;
            } else {
                v0_2 = com.google.android.gms.internal.zzdiu.zze(v2_1, this.zzlgs);
            }
            v0_5 = p8.doFinal(com.google.android.gms.internal.zzdiu.zze(v3_0, v0_2));
        } else {
            v0_5 = p8.doFinal(com.google.android.gms.internal.zzdiu.zze(v1_4, this.zzlgs));
        }
        return v0_5;
    }

Method com.google.android.gms.internal.zzdiu.zzd() calling method javax.crypto.Cipher.doFinal()


    public final byte[] zzd(byte[] p13, byte[] p14)
    {
        int v2 = 0;
        if (p13.length <= ((2147483647 - this.zzlgu) - 16)) {
            byte[] v9 = new byte[((this.zzlgu + p13.length) + 16)];
            int v3_0 = com.google.android.gms.internal.zzdjo.zzft(this.zzlgu);
            System.arraycopy(v3_0, 0, v9, 0, this.zzlgu);
            byte[] v1_0 = javax.crypto.Cipher.getInstance("AES/ECB/NOPADDING");
            v1_0.init(1, this.zzlgp);
            byte[] v0_8 = this.zza(v1_0, 0, v3_0, 0, v3_0.length);
            byte[] v10 = this.zza(v1_0, 1, p14, 0, p14.length);
            int v3_3 = javax.crypto.Cipher.getInstance("AES/CTR/NOPADDING");
            v3_3.init(1, this.zzlgp, new javax.crypto.spec.IvParameterSpec(v0_8));
            v3_3.doFinal(p13, 0, p13.length, v9, this.zzlgu);
            byte[] v1_3 = this.zza(v1_0, 2, v9, this.zzlgu, p13.length);
            while (v2 < 16) {
                v9[((p13.length + this.zzlgu) + v2)] = ((byte) ((v10[v2] ^ v0_8[v2]) ^ v1_3[v2]));
                v2++;
            }
            return v9;
        } else {
            throw new java.security.GeneralSecurityException("plaintext too long");
        }
    }

Method com.google.android.gms.internal.zzdiv.zzd() calling method javax.crypto.Cipher.doFinal()


    public final byte[] zzd(byte[] p8, byte[] p9)
    {
        if (p8.length <= 2147483619) {
            byte[] v4 = new byte[((p8.length + 12) + 16)];
            byte[] v1_0 = com.google.android.gms.internal.zzdjo.zzft(12);
            System.arraycopy(v1_0, 0, v4, 0, 12);
            javax.crypto.Cipher v0_2 = ((javax.crypto.Cipher) com.google.android.gms.internal.zzdjc.zzlhg.zzoj("AES/GCM/NoPadding"));
            v0_2.init(1, this.zzlgp, new javax.crypto.spec.GCMParameterSpec(128, v1_0));
            v0_2.updateAAD(p9);
            v0_2.doFinal(p8, 0, p8.length, v4, 12);
            return v4;
        } else {
            throw new java.security.GeneralSecurityException("plaintext too long");
        }
    }

Method com.google.android.gms.internal.zzcu.zzc() calling method javax.crypto.Cipher.getIV()


    public final String zzc(byte[] p6, byte[] p7)
    {
        if (p6.length == 16) {
            try {
            } catch (String v0_12) {
                throw new com.google.android.gms.internal.zzcv(this, v0_12);
            } catch (String v0_10) {
                throw new com.google.android.gms.internal.zzcv(this, v0_10);
            } catch (String v0_9) {
                throw new com.google.android.gms.internal.zzcv(this, v0_9);
            } catch (String v0_8) {
                throw new com.google.android.gms.internal.zzcv(this, v0_8);
            } catch (String v0_7) {
                throw new com.google.android.gms.internal.zzcv(this, v0_7);
            }
            com.google.android.gms.internal.zzcu.getCipher().init(1, new javax.crypto.spec.SecretKeySpec(p6, "AES"), 0);
            String v0_2 = com.google.android.gms.internal.zzcu.getCipher().doFinal(p7);
            java.nio.ByteBuffer v2_1 = com.google.android.gms.internal.zzcu.getCipher().getIV();
            int v1_2 = (v0_2.length + v2_1.length);
            java.nio.ByteBuffer v3_1 = java.nio.ByteBuffer.allocate(v1_2);
            v3_1.put(v2_1).put(v0_2);
            v3_1.flip();
            String v0_5 = new byte[v1_2];
            v3_1.get(v0_5);
            return com.google.android.gms.internal.zzbr.zza(v0_5, 0);
        } else {
            throw new com.google.android.gms.internal.zzcv(this);
        }
    }

Method com.google.android.gms.internal.zzcu.getCipher() calling method javax.crypto.Cipher.getInstance()


    private static javax.crypto.Cipher getCipher()
    {
        try {
            if (com.google.android.gms.internal.zzcu.zzahr == null) {
                com.google.android.gms.internal.zzcu.zzahr = javax.crypto.Cipher.getInstance("AES/CBC/PKCS5Padding");
            }
        } catch (javax.crypto.Cipher v0_4) {
            throw v0_4;
        }
        return com.google.android.gms.internal.zzcu.zzahr;
    }

Method com.google.android.gms.internal.zzdiu.<init>() calling method javax.crypto.Cipher.getInstance()


    public zzdiu(byte[] p5, int p6)
    {
        if ((p6 == 12) || (p6 == 16)) {
            this.zzlgu = p6;
            this.zzlgp = new javax.crypto.spec.SecretKeySpec(p5, "AES");
            IllegalArgumentException v0_1 = javax.crypto.Cipher.getInstance("AES/ECB/NOPADDING");
            v0_1.init(1, this.zzlgp);
            String v1_1 = new byte[16];
            this.zzlgs = com.google.android.gms.internal.zzdiu.zzaj(v0_1.doFinal(v1_1));
            this.zzlgt = com.google.android.gms.internal.zzdiu.zzaj(this.zzlgs);
            return;
        } else {
            throw new IllegalArgumentException("IV size should be either 12 or 16 bytes");
        }
    }

Method com.google.android.gms.internal.zzdiu.zzd() calling method javax.crypto.Cipher.getInstance()


    public final byte[] zzd(byte[] p13, byte[] p14)
    {
        int v2 = 0;
        if (p13.length <= ((2147483647 - this.zzlgu) - 16)) {
            byte[] v9 = new byte[((this.zzlgu + p13.length) + 16)];
            int v3_0 = com.google.android.gms.internal.zzdjo.zzft(this.zzlgu);
            System.arraycopy(v3_0, 0, v9, 0, this.zzlgu);
            byte[] v1_0 = javax.crypto.Cipher.getInstance("AES/ECB/NOPADDING");
            v1_0.init(1, this.zzlgp);
            byte[] v0_8 = this.zza(v1_0, 0, v3_0, 0, v3_0.length);
            byte[] v10 = this.zza(v1_0, 1, p14, 0, p14.length);
            int v3_3 = javax.crypto.Cipher.getInstance("AES/CTR/NOPADDING");
            v3_3.init(1, this.zzlgp, new javax.crypto.spec.IvParameterSpec(v0_8));
            v3_3.doFinal(p13, 0, p13.length, v9, this.zzlgu);
            byte[] v1_3 = this.zza(v1_0, 2, v9, this.zzlgu, p13.length);
            while (v2 < 16) {
                v9[((p13.length + this.zzlgu) + v2)] = ((byte) ((v10[v2] ^ v0_8[v2]) ^ v1_3[v2]));
                v2++;
            }
            return v9;
        } else {
            throw new java.security.GeneralSecurityException("plaintext too long");
        }
    }

Method com.google.android.gms.internal.zzcu.zzb() calling method javax.crypto.spec.IvParameterSpec.<init>()


    public final byte[] zzb(byte[] p8, String p9)
    {
        if (p8.length == 16) {
            try {
                Throwable v0_12 = com.google.android.gms.internal.zzbr.zza(p9, 0);
            } catch (Throwable v0_16) {
                throw new com.google.android.gms.internal.zzcv(this, v0_16);
            } catch (Throwable v0_15) {
                throw new com.google.android.gms.internal.zzcv(this, v0_15);
            } catch (Throwable v0_14) {
                throw new com.google.android.gms.internal.zzcv(this, v0_14);
            } catch (Throwable v0_13) {
                throw new com.google.android.gms.internal.zzcv(this, v0_13);
            } catch (Throwable v0_11) {
                throw new com.google.android.gms.internal.zzcv(this, v0_11);
            } catch (Throwable v0_10) {
                throw new com.google.android.gms.internal.zzcv(this, v0_10);
            } catch (Throwable v0_9) {
                throw new com.google.android.gms.internal.zzcv(this, v0_9);
            }
            if (v0_12.length > 16) {
                javax.crypto.Cipher v1_0 = java.nio.ByteBuffer.allocate(v0_12.length);
                v1_0.put(v0_12);
                v1_0.flip();
                byte[] v2_2 = new byte[16];
                Throwable v0_3 = new byte[(v0_12.length - 16)];
                v1_0.get(v2_2);
                v1_0.get(v0_3);
                com.google.android.gms.internal.zzcu.getCipher().init(2, new javax.crypto.spec.SecretKeySpec(p8, "AES"), new javax.crypto.spec.IvParameterSpec(v2_2));
                return com.google.android.gms.internal.zzcu.getCipher().doFinal(v0_3);
            } else {
                throw new com.google.android.gms.internal.zzcv(this);
            }
        } else {
            throw new com.google.android.gms.internal.zzcv(this);
        }
    }

Method com.google.android.gms.internal.zzdit.zzai() calling method javax.crypto.spec.IvParameterSpec.<init>()


    public final byte[] zzai(byte[] p9)
    {
        if (p9.length <= (2147483647 - this.zzlgq)) {
            byte[] v4 = new byte[(this.zzlgq + p9.length)];
            String v1_0 = com.google.android.gms.internal.zzdjo.zzft(this.zzlgq);
            System.arraycopy(v1_0, 0, v4, 0, this.zzlgq);
            int v3_1 = p9.length;
            int v5 = this.zzlgq;
            java.security.GeneralSecurityException v0_5 = ((javax.crypto.Cipher) com.google.android.gms.internal.zzdjc.zzlhg.zzoj("AES/CTR/NoPadding"));
            int v6_2 = new byte[this.zzlgr];
            System.arraycopy(v1_0, 0, v6_2, 0, this.zzlgq);
            v0_5.init(1, this.zzlgp, new javax.crypto.spec.IvParameterSpec(v6_2));
            if (v0_5.doFinal(p9, 0, v3_1, v4, v5) == v3_1) {
                return v4;
            } else {
                throw new java.security.GeneralSecurityException("stored output\'s length does not match input\'s length");
            }
        } else {
            throw new java.security.GeneralSecurityException(new StringBuilder(43).append("plaintext length can not exceed ").append((2147483647 - this.zzlgq)).toString());
        }
    }

Method com.google.android.gms.internal.zzdiu.zzd() calling method javax.crypto.spec.IvParameterSpec.<init>()


    public final byte[] zzd(byte[] p13, byte[] p14)
    {
        int v2 = 0;
        if (p13.length <= ((2147483647 - this.zzlgu) - 16)) {
            byte[] v9 = new byte[((this.zzlgu + p13.length) + 16)];
            int v3_0 = com.google.android.gms.internal.zzdjo.zzft(this.zzlgu);
            System.arraycopy(v3_0, 0, v9, 0, this.zzlgu);
            byte[] v1_0 = javax.crypto.Cipher.getInstance("AES/ECB/NOPADDING");
            v1_0.init(1, this.zzlgp);
            byte[] v0_8 = this.zza(v1_0, 0, v3_0, 0, v3_0.length);
            byte[] v10 = this.zza(v1_0, 1, p14, 0, p14.length);
            int v3_3 = javax.crypto.Cipher.getInstance("AES/CTR/NOPADDING");
            v3_3.init(1, this.zzlgp, new javax.crypto.spec.IvParameterSpec(v0_8));
            v3_3.doFinal(p13, 0, p13.length, v9, this.zzlgu);
            byte[] v1_3 = this.zza(v1_0, 2, v9, this.zzlgu, p13.length);
            while (v2 < 16) {
                v9[((p13.length + this.zzlgu) + v2)] = ((byte) ((v10[v2] ^ v0_8[v2]) ^ v1_3[v2]));
                v2++;
            }
            return v9;
        } else {
            throw new java.security.GeneralSecurityException("plaintext too long");
        }
    }