Package org.apache.sshd.common.digest
Class BaseDigest
java.lang.Object
org.apache.sshd.common.digest.BaseDigest
- All Implemented Interfaces:
Comparable<Digest>
,AlgorithmNameProvider
,Digest
,DigestInformation
Base class for Digest algorithms based on the JCE provider.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBaseDigest
(String algorithm, int bsize) Create a new digest using the given algorithm and block size. -
Method Summary
-
Field Details
-
algorithm
-
bsize
private final int bsize -
h
private int h -
s
-
md
-
-
Constructor Details
-
BaseDigest
Create a new digest using the given algorithm and block size. The initialization and creation of the underlyingMessageDigest
object will be done in theinit()
method.- Parameters:
algorithm
- the JCE algorithm to use for this digestbsize
- the block size of this digest
-
-
Method Details
-
getAlgorithm
- Specified by:
getAlgorithm
in interfaceAlgorithmNameProvider
-
getBlockSize
public int getBlockSize()- Specified by:
getBlockSize
in interfaceDigestInformation
- Returns:
- The number of bytes in the digest's output
-
init
-
update
-
update
-
getMessageDigest
- Returns:
- The current
MessageDigest
- may benull
ifinit()
not called
-
digest
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<Digest>
-
equals
-
toString
-