|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.cryptohash.DigestEngine
fr.cryptohash.Luffa384
public class Luffa384
This class implements Luffa-384 digest algorithm under the
Digest
API.
==========================(LICENSE BEGIN)============================ Copyright (c) 2007-2010 Projet RNRT SAPHIR Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ===========================(LICENSE END)=============================
Constructor Summary | |
---|---|
Luffa384()
Create the engine. |
Method Summary | |
---|---|
Digest |
copy()
Clone the current state. |
protected Digest |
copyState(Luffa384 dst)
|
protected void |
doInit()
This function is called at object creation time; the implementation should use it to perform initialization tasks. |
protected void |
doPadding(byte[] output,
int outputOffset)
Perform the final padding and store the result in the provided buffer. |
protected void |
engineReset()
Reset the hash algorithm state. |
int |
getBlockLength()
Return the "block length" for the hash function. |
int |
getDigestLength()
Get the natural hash function output length (in bytes). |
int |
getInternalBlockLength()
Get the internal block length. |
protected void |
processBlock(byte[] data)
Process one block of data. |
java.lang.String |
toString()
Get the display name for this function (e.g. |
Methods inherited from class fr.cryptohash.DigestEngine |
---|
copyState, digest, digest, digest, flush, getBlockBuffer, getBlockCount, reset, update, update, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Luffa384()
Method Detail |
---|
public int getInternalBlockLength()
DigestEngine
DigestEngine.processBlock(byte[])
. The default implementation of this
method calls Digest.getBlockLength()
and returns the same
value. Overriding this method is useful when the advertised
block length (which is used, for instance, by HMAC) is
suboptimal with regards to internal buffering needs.
getInternalBlockLength
in class DigestEngine
DigestEngine
public int getBlockLength()
Digest
Return the "block length" for the hash function. This
value is naturally defined for iterated hash functions
(Merkle-Damgard). It is used in HMAC (that's what the
HMAC specification
names the "B
" parameter).
If the function is "block-less" then this function may
return -n
where n
is an integer such that the
block length for HMAC ("B
") will be inferred from the
key length, by selecting the smallest multiple of n
which is no smaller than the key length. For instance, for
the Fugue-xxx hash functions, this function returns -4: the
virtual block length B is the HMAC key length, rounded up to
the next multiple of 4.
-n
Digest
public int getDigestLength()
Digest
Digest
public Digest copy()
Digest
Digest
protected Digest copyState(Luffa384 dst)
DigestEngine
protected void engineReset()
DigestEngine
engineReset
in class DigestEngine
DigestEngine
protected void doPadding(byte[] output, int outputOffset)
DigestEngine
DigestEngine.flush()
and then DigestEngine.update(byte)
with the appropriate padding
data in order to get the full input data.
doPadding
in class DigestEngine
output
- the output bufferoutputOffset
- the output offsetDigestEngine
protected void doInit()
DigestEngine
Digest.getDigestLength()
.
doInit
in class DigestEngine
DigestEngine
protected void processBlock(byte[] data)
DigestEngine
processBlock
in class DigestEngine
data
- the data blockDigestEngine
public java.lang.String toString()
Digest
Get the display name for this function (e.g. "SHA-1"
for SHA-1).
toString
in interface Digest
toString
in class java.lang.Object
Digest
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |