de.flexiprovider.pqc.hbc.ots
Class MessageDigestWrapper

java.lang.Object
  |
  +--java.security.MessageDigestSpi
        |
        +--de.flexiprovider.api.MessageDigest
              |
              +--de.flexiprovider.pqc.hbc.ots.MessageDigestWrapper

public class MessageDigestWrapper
extends MessageDigest

Wraps the given message digest to realize a given output length

Author:
Sarah

Constructor Summary
MessageDigestWrapper(MessageDigest md, int length)
           
 
Method Summary
 byte[] digest()
          returns the message digest output cut to the desired byte-length
 int getDigestLength()
           
 int getLength()
           
 void reset()
          Reset the digest for further use.
 void setLength(int length)
           
 void update(byte input)
          Update the digest using the specified byte.
 void update(byte[] input, int offset, int len)
          Update the digest using the specified array of bytes, starting at the specified offset.
 
Methods inherited from class de.flexiprovider.api.MessageDigest
digest, digest, engineDigest, engineGetDigestLength, engineReset, engineUpdate, engineUpdate, update
 
Methods inherited from class java.security.MessageDigestSpi
clone, engineDigest
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageDigestWrapper

public MessageDigestWrapper(MessageDigest md,
                            int length)
Method Detail

setLength

public void setLength(int length)

getLength

public int getLength()

digest

public byte[] digest()
returns the message digest output cut to the desired byte-length
Overrides:
digest in class MessageDigest
Following copied from class: de.flexiprovider.api.MessageDigest
Returns:
the array of bytes for the resulting hash value.

getDigestLength

public int getDigestLength()
Overrides:
getDigestLength in class MessageDigest
Following copied from class: de.flexiprovider.api.MessageDigest
Returns:
the digest length in bytes

reset

public void reset()
Description copied from class: MessageDigest
Reset the digest for further use.
Overrides:
reset in class MessageDigest

update

public void update(byte input)
Description copied from class: MessageDigest
Update the digest using the specified byte.
Overrides:
update in class MessageDigest
Following copied from class: de.flexiprovider.api.MessageDigest
Parameters:
input - the byte to use for the update

update

public void update(byte[] input,
                   int offset,
                   int len)
Description copied from class: MessageDigest
Update the digest using the specified array of bytes, starting at the specified offset.
Overrides:
update in class MessageDigest
Following copied from class: de.flexiprovider.api.MessageDigest
Parameters:
input - the array of bytes to use for the update
offset - the offset to start from in the array of bytes
len - the number of bytes to use, starting at offset