diff options
Diffstat (limited to 'pg/src/main/java/org/bouncycastle/openpgp/operator/bc/SHA1PGPDigestCalculator.java')
-rw-r--r-- | pg/src/main/java/org/bouncycastle/openpgp/operator/bc/SHA1PGPDigestCalculator.java | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/pg/src/main/java/org/bouncycastle/openpgp/operator/bc/SHA1PGPDigestCalculator.java b/pg/src/main/java/org/bouncycastle/openpgp/operator/bc/SHA1PGPDigestCalculator.java deleted file mode 100644 index 979de84f..00000000 --- a/pg/src/main/java/org/bouncycastle/openpgp/operator/bc/SHA1PGPDigestCalculator.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.bouncycastle.openpgp.operator.bc; - -import java.io.IOException; -import java.io.OutputStream; - -import org.bouncycastle.bcpg.HashAlgorithmTags; -import org.bouncycastle.crypto.Digest; -import org.bouncycastle.crypto.digests.SHA1Digest; -import org.bouncycastle.openpgp.operator.PGPDigestCalculator; - -class SHA1PGPDigestCalculator - implements PGPDigestCalculator -{ - private Digest digest = new SHA1Digest(); - - public int getAlgorithm() - { - return HashAlgorithmTags.SHA1; - } - - public OutputStream getOutputStream() - { - return new DigestOutputStream(digest); - } - - public byte[] getDigest() - { - byte[] d = new byte[digest.getDigestSize()]; - - digest.doFinal(d, 0); - - return d; - } - - public void reset() - { - digest.reset(); - } - - private class DigestOutputStream - extends OutputStream - { - private Digest dig; - - DigestOutputStream(Digest dig) - { - this.dig = dig; - } - - public void write(byte[] bytes, int off, int len) - throws IOException - { - dig.update(bytes, off, len); - } - - public void write(byte[] bytes) - throws IOException - { - dig.update(bytes, 0, bytes.length); - } - - public void write(int b) - throws IOException - { - dig.update((byte)b); - } - } -} |