| Modifier and Type | Field and Description |
|---|---|
protected int |
blockSize
The hash (inner) block size in bytes.
|
protected byte[] |
buffer
Temporary input buffer.
|
protected long |
count
Number of bytes processed so far.
|
protected int |
hashSize
The hash (output) size in bytes.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BaseHash(String name,
int hashSize,
int blockSize)
Trivial constructor for use by concrete subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
abstract Object |
clone() |
byte[] |
engineDigest() |
int |
engineGetDigestLength() |
void |
engineReset() |
void |
engineUpdate(byte b) |
void |
engineUpdate(byte[] b,
int offset,
int len) |
protected abstract byte[] |
getResult()
Constructs the result from the contents of the current context.
|
protected abstract byte[] |
padBuffer()
Returns the byte array to use as padding before completing a hash
operation.
|
protected abstract void |
resetContext()
Resets the instance for future re-use.
|
protected abstract void |
transform(byte[] in,
int offset)
The block digest transformation per se.
|
digest, digest, digest, getAlgorithm, getDigestLength, getInstance, getInstance, getInstance, getProvider, isEqual, reset, toString, update, update, update, updateengineDigest, engineUpdateprotected int hashSize
protected int blockSize
protected long count
protected byte[] buffer
protected BaseHash(String name, int hashSize, int blockSize)
Trivial constructor for use by concrete subclasses.
name - the canonical name prefix of this instance.hashSize - the block size of the output in bytes.blockSize - the block size of the internal transform.public int engineGetDigestLength()
engineGetDigestLength in class MessageDigestSpipublic void engineUpdate(byte b)
engineUpdate in class MessageDigestSpipublic void engineUpdate(byte[] b,
int offset,
int len)
engineUpdate in class MessageDigestSpipublic byte[] engineDigest()
engineDigest in class MessageDigestSpipublic void engineReset()
engineReset in class MessageDigestSpipublic abstract Object clone()
clone in class MessageDigestprotected abstract byte[] padBuffer()
Returns the byte array to use as padding before completing a hash operation.
protected abstract byte[] getResult()
Constructs the result from the contents of the current context.
protected abstract void resetContext()
protected abstract void transform(byte[] in,
int offset)
The block digest transformation per se.
in - the blockSize long block, as an array of bytes to digest.offset - the index where the data to digest is located within the
input buffer.Copyright 2014-2016 SafeNet Inc