package p138.p329.p357.p359.p360;

import java.security.DigestException;
import java.security.MessageDigest;
import p138.p139.p143.p144.C2803;

/* JADX INFO: renamed from: ދ.ށ.އ.ރ.ނ.֏, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C6331 extends MessageDigest {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public int f17669;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public int f17670;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public int f17671;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public int f17672;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public long f17673;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final byte[] f17674;

    public C6331() {
        super("MD4");
        this.f17669 = 1732584193;
        this.f17670 = -271733879;
        this.f17671 = -1732584194;
        this.f17672 = 271733878;
        this.f17674 = new byte[64];
    }

    @Override // java.security.MessageDigestSpi
    public int engineDigest(byte[] bArr, int i, int i2) throws DigestException {
        if (i < 0 || i + i2 >= bArr.length) {
            throw new DigestException("Wrong offset or not enough space to store the digest");
        }
        int iMin = Math.min(i2, 16);
        System.arraycopy(engineDigest(), 0, bArr, i, iMin);
        return iMin;
    }

    @Override // java.security.MessageDigestSpi
    public byte[] engineDigest() {
        int i = (int) (this.f17673 % 64);
        int i2 = i < 56 ? 64 - i : 128 - i;
        byte[] bArr = new byte[i2];
        bArr[0] = -128;
        long j = this.f17673 << 3;
        int i3 = i2 - 8;
        int i4 = 0;
        while (i4 < 8) {
            bArr[i3] = (byte) (j >>> (i4 << 3));
            i4++;
            i3++;
        }
        engineUpdate(bArr, 0, i2);
        int i5 = this.f17669;
        int i6 = this.f17670;
        int i7 = this.f17671;
        int i8 = this.f17672;
        byte[] bArr2 = {(byte) i5, (byte) (i5 >>> 8), (byte) (i5 >>> 16), (byte) (i5 >>> 24), (byte) i6, (byte) (i6 >>> 8), (byte) (i6 >>> 16), (byte) (i6 >>> 24), (byte) i7, (byte) (i7 >>> 8), (byte) (i7 >>> 16), (byte) (i7 >>> 24), (byte) i8, (byte) (i8 >>> 8), (byte) (i8 >>> 16), (byte) (i8 >>> 24)};
        engineReset();
        return bArr2;
    }

    @Override // java.security.MessageDigestSpi
    public int engineGetDigestLength() {
        return 16;
    }

    @Override // java.security.MessageDigestSpi
    public void engineReset() {
        this.f17669 = 1732584193;
        this.f17670 = -271733879;
        this.f17671 = -1732584194;
        this.f17672 = 271733878;
        this.f17673 = 0L;
    }

    @Override // java.security.MessageDigestSpi
    public void engineUpdate(byte b) {
        long j = this.f17673;
        int i = (int) (j % 64);
        byte[] bArr = this.f17674;
        bArr[i] = b;
        this.f17673 = j + 1;
        if (i == 63) {
            m9554(bArr, 0);
        }
    }

    @Override // java.security.MessageDigestSpi
    public void engineUpdate(byte[] bArr, int i, int i2) {
        long j = this.f17673;
        int i3 = (int) (j % 64);
        int i4 = 64 - i3;
        this.f17673 = j + ((long) i2);
        int i5 = 0;
        if (i2 >= i4) {
            System.arraycopy(bArr, i, this.f17674, i3, i4);
            m9554(this.f17674, 0);
            while (true) {
                int i6 = i4 + 64;
                if (i6 - 1 >= i2) {
                    break;
                }
                m9554(bArr, i4 + i);
                i4 = i6;
            }
            i5 = i4;
            i3 = 0;
        }
        if (i5 < i2) {
            System.arraycopy(bArr, i + i5, this.f17674, i3, i2 - i5);
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m9554(byte[] bArr, int i) {
        int i2 = this.f17669;
        int i3 = this.f17670;
        int i4 = this.f17671;
        int i5 = this.f17672;
        int[] iArr = new int[16];
        int i6 = i;
        int i7 = 0;
        while (i7 < 16) {
            int i8 = i6 + 1;
            int i9 = i8 + 1;
            int i10 = (bArr[i6] & 255) | ((bArr[i8] & 255) << 8);
            int i11 = i9 + 1;
            int i12 = i10 | ((bArr[i9] & 255) << 16);
            iArr[i7] = i12 | ((bArr[i11] & 255) << 24);
            i7++;
            i6 = i11 + 1;
        }
        int i13 = this.f17669;
        int i14 = this.f17670;
        int i15 = this.f17671;
        int i16 = ~i14;
        int i17 = this.f17672;
        int i18 = ((i14 & i15) | (i16 & i17)) + iArr[0] + i13;
        this.f17669 = i18;
        int i19 = (i18 << 3) | (i18 >>> 29);
        this.f17669 = i19;
        int i20 = ((i19 & i14) | ((~i19) & i15)) + iArr[1] + i17;
        this.f17672 = i20;
        int i21 = (i20 >>> 25) | (i20 << 7);
        this.f17672 = i21;
        int i22 = ((i21 & i19) | ((~i21) & i14)) + iArr[2] + i15;
        this.f17671 = i22;
        int i23 = (i22 << 11) | (i22 >>> 21);
        this.f17671 = i23;
        int i24 = ((i23 & i21) | ((~i23) & i19)) + iArr[3] + i14;
        this.f17670 = i24;
        int i25 = (i24 << 19) | (i24 >>> 13);
        this.f17670 = i25;
        int i26 = ((i25 & i23) | ((~i25) & i21)) + iArr[4] + i19;
        this.f17669 = i26;
        int i27 = (i26 << 3) | (i26 >>> 29);
        this.f17669 = i27;
        int i28 = ((i27 & i25) | ((~i27) & i23)) + iArr[5] + i21;
        this.f17672 = i28;
        int i29 = (i28 << 7) | (i28 >>> 25);
        this.f17672 = i29;
        int i30 = ((i29 & i27) | ((~i29) & i25)) + iArr[6] + i23;
        this.f17671 = i30;
        int i31 = (i30 << 11) | (i30 >>> 21);
        this.f17671 = i31;
        int i32 = ((i31 & i29) | ((~i31) & i27)) + iArr[7] + i25;
        this.f17670 = i32;
        int i33 = (i32 << 19) | (i32 >>> 13);
        this.f17670 = i33;
        int i34 = ((i33 & i31) | ((~i33) & i29)) + iArr[8] + i27;
        this.f17669 = i34;
        int i35 = (i34 << 3) | (i34 >>> 29);
        this.f17669 = i35;
        int i36 = ((i35 & i33) | ((~i35) & i31)) + iArr[9] + i29;
        this.f17672 = i36;
        int i37 = (i36 << 7) | (i36 >>> 25);
        this.f17672 = i37;
        int i38 = ((i37 & i35) | ((~i37) & i33)) + iArr[10] + i31;
        this.f17671 = i38;
        int i39 = (i38 << 11) | (i38 >>> 21);
        this.f17671 = i39;
        int i40 = ((i39 & i37) | ((~i39) & i35)) + iArr[11] + i33;
        this.f17670 = i40;
        int i41 = (i40 << 19) | (i40 >>> 13);
        this.f17670 = i41;
        int i42 = ((i41 & i39) | ((~i41) & i37)) + iArr[12] + i35;
        this.f17669 = i42;
        int i43 = (i42 << 3) | (i42 >>> 29);
        this.f17669 = i43;
        int i44 = ((i43 & i41) | ((~i43) & i39)) + iArr[13] + i37;
        this.f17672 = i44;
        int i45 = (i44 << 7) | (i44 >>> 25);
        this.f17672 = i45;
        int i46 = ((i45 & i43) | ((~i45) & i41)) + iArr[14] + i39;
        this.f17671 = i46;
        int i47 = (i46 << 11) | (i46 >>> 21);
        this.f17671 = i47;
        int i48 = ((i47 & i45) | ((~i47) & i43)) + iArr[15] + i41;
        this.f17670 = i48;
        int i49 = (i48 << 19) | (i48 >>> 13);
        this.f17670 = i49;
        int iM4861 = C2803.m4861(((i47 | i45) & i49) | (i47 & i45), iArr[0], 1518500249, i43);
        this.f17669 = iM4861;
        int i50 = (iM4861 >>> 29) | (iM4861 << 3);
        this.f17669 = i50;
        int iM48612 = C2803.m4861(((i49 | i47) & i50) | (i49 & i47), iArr[4], 1518500249, i45);
        this.f17672 = iM48612;
        int i51 = (iM48612 >>> 27) | (iM48612 << 5);
        this.f17672 = i51;
        int iM48613 = C2803.m4861(((i50 | i49) & i51) | (i50 & i49), iArr[8], 1518500249, i47);
        this.f17671 = iM48613;
        int i52 = (iM48613 >>> 23) | (iM48613 << 9);
        this.f17671 = i52;
        int iM48614 = C2803.m4861(((i51 | i50) & i52) | (i51 & i50), iArr[12], 1518500249, i49);
        this.f17670 = iM48614;
        int i53 = (iM48614 >>> 19) | (iM48614 << 13);
        this.f17670 = i53;
        int iM48615 = C2803.m4861(((i52 | i51) & i53) | (i52 & i51), iArr[1], 1518500249, i50);
        this.f17669 = iM48615;
        int i54 = (iM48615 >>> 29) | (iM48615 << 3);
        this.f17669 = i54;
        int iM48616 = C2803.m4861(((i53 | i52) & i54) | (i53 & i52), iArr[5], 1518500249, i51);
        this.f17672 = iM48616;
        int i55 = (iM48616 >>> 27) | (iM48616 << 5);
        this.f17672 = i55;
        int iM48617 = C2803.m4861(((i54 | i53) & i55) | (i54 & i53), iArr[9], 1518500249, i52);
        this.f17671 = iM48617;
        int i56 = (iM48617 >>> 23) | (iM48617 << 9);
        this.f17671 = i56;
        int iM48618 = C2803.m4861(((i55 | i54) & i56) | (i55 & i54), iArr[13], 1518500249, i53);
        this.f17670 = iM48618;
        int i57 = (iM48618 >>> 19) | (iM48618 << 13);
        this.f17670 = i57;
        int iM48619 = C2803.m4861(((i56 | i55) & i57) | (i56 & i55), iArr[2], 1518500249, i54);
        this.f17669 = iM48619;
        int i58 = (iM48619 >>> 29) | (iM48619 << 3);
        this.f17669 = i58;
        int iM486110 = C2803.m4861(((i57 | i56) & i58) | (i57 & i56), iArr[6], 1518500249, i55);
        this.f17672 = iM486110;
        int i59 = (iM486110 >>> 27) | (iM486110 << 5);
        this.f17672 = i59;
        int iM486111 = C2803.m4861(((i58 | i57) & i59) | (i58 & i57), iArr[10], 1518500249, i56);
        this.f17671 = iM486111;
        int i60 = (iM486111 >>> 23) | (iM486111 << 9);
        this.f17671 = i60;
        int iM486112 = C2803.m4861(((i59 | i58) & i60) | (i59 & i58), iArr[14], 1518500249, i57);
        this.f17670 = iM486112;
        int i61 = (iM486112 >>> 19) | (iM486112 << 13);
        this.f17670 = i61;
        int iM486113 = C2803.m4861(((i60 | i59) & i61) | (i60 & i59), iArr[3], 1518500249, i58);
        this.f17669 = iM486113;
        int i62 = (iM486113 >>> 29) | (iM486113 << 3);
        this.f17669 = i62;
        int iM486114 = C2803.m4861(((i61 | i60) & i62) | (i61 & i60), iArr[7], 1518500249, i59);
        this.f17672 = iM486114;
        int i63 = (iM486114 >>> 27) | (iM486114 << 5);
        this.f17672 = i63;
        int iM486115 = C2803.m4861(((i62 | i61) & i63) | (i62 & i61), iArr[11], 1518500249, i60);
        this.f17671 = iM486115;
        int i64 = (iM486115 >>> 23) | (iM486115 << 9);
        this.f17671 = i64;
        int iM486116 = C2803.m4861(((i63 | i62) & i64) | (i63 & i62), iArr[15], 1518500249, i61);
        this.f17670 = iM486116;
        int i65 = (iM486116 >>> 19) | (iM486116 << 13);
        this.f17670 = i65;
        int iM486117 = C2803.m4861((i65 ^ i64) ^ i63, iArr[0], 1859775393, i62);
        this.f17669 = iM486117;
        int i66 = (iM486117 >>> 29) | (iM486117 << 3);
        this.f17669 = i66;
        int iM486118 = C2803.m4861((i66 ^ i65) ^ i64, iArr[8], 1859775393, i63);
        this.f17672 = iM486118;
        int i67 = (iM486118 >>> 23) | (iM486118 << 9);
        this.f17672 = i67;
        int iM486119 = C2803.m4861((i67 ^ i66) ^ i65, iArr[4], 1859775393, i64);
        this.f17671 = iM486119;
        int i68 = (iM486119 >>> 21) | (iM486119 << 11);
        this.f17671 = i68;
        int iM486120 = C2803.m4861((i68 ^ i67) ^ i66, iArr[12], 1859775393, i65);
        this.f17670 = iM486120;
        int i69 = (iM486120 >>> 17) | (iM486120 << 15);
        this.f17670 = i69;
        int iM486121 = C2803.m4861((i69 ^ i68) ^ i67, iArr[2], 1859775393, i66);
        this.f17669 = iM486121;
        int i70 = (iM486121 >>> 29) | (iM486121 << 3);
        this.f17669 = i70;
        int iM486122 = C2803.m4861((i70 ^ i69) ^ i68, iArr[10], 1859775393, i67);
        this.f17672 = iM486122;
        int i71 = (iM486122 >>> 23) | (iM486122 << 9);
        this.f17672 = i71;
        int iM486123 = C2803.m4861((i71 ^ i70) ^ i69, iArr[6], 1859775393, i68);
        this.f17671 = iM486123;
        int i72 = (iM486123 >>> 21) | (iM486123 << 11);
        this.f17671 = i72;
        int iM486124 = C2803.m4861((i72 ^ i71) ^ i70, iArr[14], 1859775393, i69);
        this.f17670 = iM486124;
        int i73 = (iM486124 >>> 17) | (iM486124 << 15);
        this.f17670 = i73;
        int iM486125 = C2803.m4861((i73 ^ i72) ^ i71, iArr[1], 1859775393, i70);
        this.f17669 = iM486125;
        int i74 = (iM486125 >>> 29) | (iM486125 << 3);
        this.f17669 = i74;
        int iM486126 = C2803.m4861((i74 ^ i73) ^ i72, iArr[9], 1859775393, i71);
        this.f17672 = iM486126;
        int i75 = (iM486126 >>> 23) | (iM486126 << 9);
        this.f17672 = i75;
        int iM486127 = C2803.m4861((i75 ^ i74) ^ i73, iArr[5], 1859775393, i72);
        this.f17671 = iM486127;
        int i76 = (iM486127 >>> 21) | (iM486127 << 11);
        this.f17671 = i76;
        int iM486128 = C2803.m4861((i76 ^ i75) ^ i74, iArr[13], 1859775393, i73);
        this.f17670 = iM486128;
        int i77 = (iM486128 >>> 17) | (iM486128 << 15);
        this.f17670 = i77;
        int iM486129 = C2803.m4861((i77 ^ i76) ^ i75, iArr[3], 1859775393, i74);
        this.f17669 = iM486129;
        int i78 = (iM486129 >>> 29) | (iM486129 << 3);
        this.f17669 = i78;
        int iM486130 = C2803.m4861((i78 ^ i77) ^ i76, iArr[11], 1859775393, i75);
        this.f17672 = iM486130;
        int i79 = (iM486130 >>> 23) | (iM486130 << 9);
        this.f17672 = i79;
        int iM486131 = C2803.m4861((i79 ^ i78) ^ i77, iArr[7], 1859775393, i76);
        this.f17671 = iM486131;
        int i80 = (iM486131 >>> 21) | (iM486131 << 11);
        this.f17671 = i80;
        int iM486132 = C2803.m4861((i80 ^ i79) ^ i78, iArr[15], 1859775393, i77);
        this.f17670 = iM486132;
        int i81 = (iM486132 >>> 17) | (iM486132 << 15);
        this.f17670 = i81;
        this.f17669 = i78 + i2;
        this.f17670 = i81 + i3;
        this.f17671 = i80 + i4;
        this.f17672 = i79 + i5;
    }
}
