📄 generaldigest.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: GeneralDigest.java
package jit.crypto.digests;
import jit.crypto.Digest;
public abstract class GeneralDigest
implements Digest
{
private byte xBuf[];
private int xBufOff;
private long byteCount;
protected GeneralDigest()
{
xBuf = new byte[4];
xBufOff = 0;
}
protected GeneralDigest(GeneralDigest t)
{
xBuf = new byte[t.xBuf.length];
System.arraycopy(t.xBuf, 0, xBuf, 0, t.xBuf.length);
xBufOff = t.xBufOff;
byteCount = t.byteCount;
}
public void update(byte in)
{
xBuf[xBufOff++] = in;
if(xBufOff == xBuf.length)
{
processWord(xBuf, 0);
xBufOff = 0;
}
byteCount++;
}
public void update(byte in[], int inOff, int len)
{
for(; xBufOff != 0 && len > 0; len--)
{
update(in[inOff]);
inOff++;
}
while(len > xBuf.length)
{
processWord(in, inOff);
inOff += xBuf.length;
len -= xBuf.length;
byteCount += xBuf.length;
}
for(; len > 0; len--)
{
update(in[inOff]);
inOff++;
}
}
public void finish()
{
long bitLength = byteCount << 3;
update((byte)-128);
while(xBufOff != 0)
update((byte)0);
processLength(bitLength);
processBlock();
}
public void reset()
{
byteCount = 0L;
xBufOff = 0;
for(int i = 0; i < xBuf.length; i++)
xBuf[i] = 0;
}
protected abstract void processWord(byte abyte0[], int i);
protected abstract void processLength(long l);
protected abstract void processBlock();
public abstract int doFinal(byte abyte0[], int i);
public abstract int getDigestSize();
public abstract String getAlgorithmName();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -