org.logi.crypto.sign
Class SHA1State
java.lang.Object
|
+--org.logi.crypto.Crypto
|
+--org.logi.crypto.sign.HashState
|
+--org.logi.crypto.sign.SHA1State
- All Implemented Interfaces:
- PrettyPrintable
- public class SHA1State
- extends HashState
An object of this class holds the state of a SHA-1 fingerprint still
being calculated.
This class actually uses java.security.MessageDigest to do all the work.
- Author:
- Logi Ragnarsson
(logir@logi.org)
Fields inherited from class org.logi.crypto.Crypto |
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO |
Constructor Summary |
SHA1State()
Create a new clear SHA1State. |
Method Summary |
int |
blockSize()
Return the size of input-blocks for this hash function in bytes. |
Fingerprint |
calculate()
Return a Fingerprint for the curret state, without
destroying the state. |
java.lang.String |
getName()
The name of the algorithm is "SHA1". |
int |
hashSize()
Returns the size of a fingerprint in bytes. |
void |
reset()
Reset the internal state of the object. |
void |
update(byte[] buffer,
int offset,
int length)
Update the hash state with the bytes from
buf[offset, offset+length-1] . |
Methods inherited from class org.logi.crypto.Crypto |
binString, binString, ensureArrayLength, ensureArrayLength, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, prettyPrint, prettyPrint, readBlock, readInt, trimArrayLength, trimArrayLength, trimLeadingZeroes, writeBytes, writeBytes, writeInt |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SHA1State
public SHA1State()
- Create a new clear SHA1State.
getName
public java.lang.String getName()
- The name of the algorithm is "SHA1".
- Overrides:
getName
in class HashState
reset
public void reset()
- Reset the internal state of the object.
- Overrides:
reset
in class HashState
update
public void update(byte[] buffer,
int offset,
int length)
- Update the hash state with the bytes from
buf[offset, offset+length-1]
.
- Overrides:
update
in class HashState
calculate
public Fingerprint calculate()
- Return a Fingerprint for the curret state, without
destroying the state.
- Overrides:
calculate
in class HashState
blockSize
public int blockSize()
- Return the size of input-blocks for this hash function in bytes.
- Overrides:
blockSize
in class HashState
hashSize
public int hashSize()
- Returns the size of a fingerprint in bytes.
- Overrides:
hashSize
in class HashState
Copyright 1997-2000 Logi Ragnarsson