package defpackage;

import java.security.InvalidKeyException;

/* JADX INFO: renamed from: ᵤʾᵮ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C3402 extends AbstractC2638 {

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final /* synthetic */ int f13106;

    public C3402(byte[] bArr, int i, int i2) throws InvalidKeyException {
        this.f13106 = i2;
        if (bArr.length != 32) {
            throw new InvalidKeyException("The key length in bytes must be 32.");
        }
        this.f10241 = AbstractC1400.m4018(bArr);
        this.f10242 = i;
    }

    @Override // defpackage.AbstractC2638
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final int[] mo6410(int[] iArr, int i) {
        switch (this.f13106) {
            case 0:
                if (iArr.length != 3) {
                    throw new IllegalArgumentException(String.format("ChaCha20 uses 96-bit nonces, but got a %d-bit nonce", Integer.valueOf(iArr.length * 32)));
                }
                int[] iArr2 = new int[16];
                int[] iArr3 = (int[]) this.f10241;
                int[] iArr4 = AbstractC1400.f5781;
                System.arraycopy(iArr4, 0, iArr2, 0, iArr4.length);
                System.arraycopy(iArr3, 0, iArr2, iArr4.length, 8);
                iArr2[12] = i;
                System.arraycopy(iArr, 0, iArr2, 13, iArr.length);
                return iArr2;
            default:
                if (iArr.length != 6) {
                    throw new IllegalArgumentException(String.format("XChaCha20 uses 192-bit nonces, but got a %d-bit nonce", Integer.valueOf(iArr.length * 32)));
                }
                int[] iArr5 = new int[16];
                int[] iArrM4016 = AbstractC1400.m4016((int[]) this.f10241, iArr);
                int[] iArr6 = AbstractC1400.f5781;
                System.arraycopy(iArr6, 0, iArr5, 0, iArr6.length);
                System.arraycopy(iArrM4016, 0, iArr5, iArr6.length, 8);
                iArr5[12] = i;
                iArr5[13] = 0;
                iArr5[14] = iArr[4];
                iArr5[15] = iArr[5];
                return iArr5;
        }
    }

    @Override // defpackage.AbstractC2638
    /* JADX INFO: renamed from: ᵻʽᵯ */
    public final int mo6414() {
        switch (this.f13106) {
            case 0:
                return 12;
            default:
                return 24;
        }
    }
}
