protected void doPadding(byte[] output, int outputOffset)
	{
		int ptr = flush();
		int bitLen = ptr << 3;
		int th = t1;
		int tl = t0 + bitLen;
		tmpBuf[ptr] = (byte)0x80;
		if (ptr == 0) {
			t0 = (int)0xFFFFFE00;
			t1 = (int)0xFFFFFFFF;
		} else if (t0 == 0) {
			t0 = (int)0xFFFFFE00 + bitLen;
			t1 --;
		} else {
			t0 -= 512 - bitLen;
		}
		if (ptr < 56) {
			for (int i = ptr + 1; i < 56; i ++)
				tmpBuf[i] = 0x00;
			if (getDigestLength() == 32)
				tmpBuf[55] |= 0x01;
			encodeBEInt(th, tmpBuf, 56);
			encodeBEInt(tl, tmpBuf, 60);
			update(tmpBuf, ptr, 64 - ptr);
		} else {
			for (int i = ptr + 1; i < 64; i ++)
				tmpBuf[i] = 0;
			update(tmpBuf, ptr, 64 - ptr);
			t0 = (int)0xFFFFFE00;
			t1 = (int)0xFFFFFFFF;
			for (int i = 0; i < 56; i ++)
				tmpBuf[i] = 0x00;
			if (getDigestLength() == 32)
				tmpBuf[55] = 0x01;
			encodeBEInt(th, tmpBuf, 56);
			encodeBEInt(tl, tmpBuf, 60);
			update(tmpBuf, 0, 64);
		}
		encodeBEInt(h0, output, outputOffset +  0);
		encodeBEInt(h1, output, outputOffset +  4);
		encodeBEInt(h2, output, outputOffset +  8);
		encodeBEInt(h3, output, outputOffset + 12);
		encodeBEInt(h4, output, outputOffset + 16);
		encodeBEInt(h5, output, outputOffset + 20);
		encodeBEInt(h6, output, outputOffset + 24);
		if (getDigestLength() == 32)
			encodeBEInt(h7, output, outputOffset + 28);
	}