public class HashCreatorImplMultipleRounds extends HashCreatorImplDigest
HashCreator that calculates hashes in multiple
rounds. Therefore, the actual data is hashed once and then for the number of rounds given at
construction time the initial hash is hashed again with the same hash algorithm.| Modifier and Type | Field and Description |
|---|---|
private int |
iterationCount |
private MessageDigest |
roundDigest |
provider| Constructor and Description |
|---|
HashCreatorImplMultipleRounds(String hashAlgorithm,
SecurityProvider provider,
int iterationCount)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
hash(boolean reset) |
getOrCloneMessageDigest, reset, update, wrapStreamgetAlgorithmgetProvidercreationFailedException, creationFailedException, creationFailedException, creationFailedException, getAlgorithm, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithash, hash, hash, hash, process, wrapStreamupdate, updateprocess, process, processgetAlgorithmprivate final MessageDigest roundDigest
private final int iterationCount
public HashCreatorImplMultipleRounds(String hashAlgorithm, SecurityProvider provider, int iterationCount)
hashAlgorithm - the name of the hash algorithm to use (e.g. "SHA-256").iterationCount - AbstractGetIterationCount. Has to be greater than 1.provider - the SecurityProvider to use.public byte[] hash(boolean reset)
hash in interface HashCreatorhash in class HashCreatorImplDigestreset - - true if this HashCreator shall be reset after the hash
calculation, false otherwise. A design problem of MessageDigest is that it
automatically resets itself on
hashing what prevents calculating intermediate hashes but also
continue the hash calculation. This API allows to workaround this limitation.MessageDigest.digest()Copyright © 2001–2019 mmm-Team. All rights reserved.