public void update(byte[] in, int inOff, int len) { while (bOff != 64 && len > 0) { update(in[inOff++]); len--; } while (len >= 64) { System.arraycopy(in, inOff, tmp, 0, 64); reverse(tmp, block); g_N(h, N, block); addMod512(N, 512); addMod512(Sigma, block); len -= 64; inOff += 64; } while (len > 0) { update(in[inOff++]); len--; } }
public int doFinal(byte[] out, int outOff) { int lenM = 64 - bOff; // At this point it is certain that lenM is smaller than 64 for (int i = 0; i != 64 - lenM; i++) { m[i] = 0; } m[63 - lenM] = 1; if (bOff != 64) { System.arraycopy(block, bOff, m, 64 - lenM, lenM); } g_N(h, N, m); addMod512(N, lenM * 8); addMod512(Sigma, m); g_N(h, Zero, N); g_N(h, Zero, Sigma); reverse(h, tmp); System.arraycopy(tmp, 0, out, outOff, 64); reset(); return 64; }
public int doFinal(byte[] out, int outOff) { byte[] result = new byte[64]; super.doFinal(result, 0); System.arraycopy(result, 32, out, outOff, 32); return 32; }