X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fbouncycastle%2Fcrypto%2Fdigests%2FGeneralDigest.java;fp=src%2Forg%2Fbouncycastle%2Fcrypto%2Fdigests%2FGeneralDigest.java;h=2ae1417b68f821d199592a0d431176029f4fc735;hb=b32cea3f3e272ab00899d134d75a8bd7bcf6c8c0;hp=2d319b741a7a7ce60c2e01f5ee0acb22ab701326;hpb=6d2f9fba912164ddc3024078aab83258a9d9e522;p=org.ibex.core.git diff --git a/src/org/bouncycastle/crypto/digests/GeneralDigest.java b/src/org/bouncycastle/crypto/digests/GeneralDigest.java index 2d319b7..2ae1417 100644 --- a/src/org/bouncycastle/crypto/digests/GeneralDigest.java +++ b/src/org/bouncycastle/crypto/digests/GeneralDigest.java @@ -14,28 +14,28 @@ public abstract class GeneralDigest private long byteCount; - /** - * Standard constructor - */ - protected GeneralDigest() - { - xBuf = new byte[4]; - xBufOff = 0; - } - - /** - * Copy constructor. We are using copy constructors in place - * of the Object.clone() interface as this interface is not - * supported by J2ME. - */ - protected GeneralDigest(GeneralDigest t) - { + /** + * Standard constructor + */ + protected GeneralDigest() + { + xBuf = new byte[4]; + xBufOff = 0; + } + + /** + * Copy constructor. We are using copy constructors in place + * of the Object.clone() interface as this interface is not + * supported by J2ME. + */ + protected GeneralDigest(GeneralDigest t) + { xBuf = new byte[t.xBuf.length]; - System.arraycopy(t.xBuf, 0, xBuf, 0, t.xBuf.length); + System.arraycopy(t.xBuf, 0, xBuf, 0, t.xBuf.length); - xBufOff = t.xBufOff; - byteCount = t.byteCount; - } + xBufOff = t.xBufOff; + byteCount = t.byteCount; + } public void update( byte in) @@ -115,9 +115,9 @@ public abstract class GeneralDigest byteCount = 0; xBufOff = 0; - for ( int i = 0; i < xBuf.length; i++ ) { - xBuf[i] = 0; - } + for ( int i = 0; i < xBuf.length; i++ ) { + xBuf[i] = 0; + } } protected abstract void processWord(byte[] in, int inOff);