For the latest news and information visit The GNU Crypto project

## gnu.crypto.prng
Class UMacGenerator

    java.lang.Object
      |
      +--gnu.crypto.prng.BasePRNG
            |
            +--gnu.crypto.prng.UMacGenerator

All Implemented Interfaces:
  java.lang.Cloneable, IRandom

public class UMacGenerator
extends BasePRNG

KDFs (Key Derivation Functions) are used to stretch user-supplied key material to specific size(s) required by high level cryptographic primitives. Described in the UMAC paper, this function basically operates an underlying symmetric key block cipher instance in output feedback mode (OFB), as a strong pseudo-random number generator.

`UMacGenerator` requires an index parameter (initialisation parameter `gnu.crypto.prng.umac.kdf.index` taken to be an instance of `Integer` with a value between `0` and `255`). Using the same key, but different indices, generates different pseudorandom outputs.

This implementation generalises the definition of the `UmacGenerator` algorithm to allow for other than the AES symetric key block cipher algorithm (initialisation parameter `gnu.crypto.prng.umac.cipher.name` taken to be an instance of `String`). If such a parameter is not defined/included in the initialisation `Map`, then the "Rijndael" algorithm is used. Furthermore, if the initialisation parameter `gnu.crypto.cipher.block.size` (taken to be a instance of `Integer`) is missing or undefined in the initialisation `Map` , then the cipher's default block size is used.

NOTE: Rijndael is used as the default symmetric key block cipher algorithm because, with its default block and key sizes, it is the AES. Yet being Rijndael, the algorithm offers more versatile block and key sizes which may prove to be useful for generating "longer" key streams.

References:

1. UMAC: Message Authentication Code using Universal Hashing.
   T. Krovetz, J. Black, S. Halevi, A. Hevia, H. Krawczyk, and P. Rogaway.

Field Summary
`static java.lang.String` `CIPHER` The name of the underlying symmetric key block cipher algorithm.
`static java.lang.String` `INDEX` Property name of the KDF `index` value to use in this instance.

Fields inherited from class gnu.crypto.prng.BasePRNG
`buffer, initialised, name, ndx`

Constructor Summary
`UMacGenerator()` Trivial 0-arguments constructor.

Method Summary
`java.lang.Object` `clone()` Returns a clone copy of this instance.
`void` `fillBlock()`
`void` `setup(java.util.Map attributes)`

Methods inherited from class gnu.crypto.prng.BasePRNG
`init, isInitialised, name, nextByte, nextBytes`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### INDEX

    public static final java.lang.String INDEX

  Property name of the KDF `index` value to use in this instance. The value is taken to be an `Integer` less than `256`.

  See Also:
    Constant Field Values

### CIPHER

    public static final java.lang.String CIPHER

  The name of the underlying symmetric key block cipher algorithm.

  See Also:
    Constant Field Values

Constructor Detail

### UMacGenerator

    public UMacGenerator()

  Trivial 0-arguments constructor.

Method Detail

### clone

    public java.lang.Object clone()

  Description copied from interface: `IRandom`

  Returns a clone copy of this instance.

  Specified by:
    `clone` in interface `IRandom`
  Specified by:
    `clone` in class `BasePRNG`
  Returns:
    a clone copy of this instance.

### setup

    public void setup(java.util.Map attributes)

  Specified by:
    `setup` in class `BasePRNG`

### fillBlock

    public void fillBlock()
                   throws LimitReachedException

  Specified by:
    `fillBlock` in class `BasePRNG`
    `LimitReachedException`

For the latest news and information visit The GNU Crypto project

Copyright © 2001, 2002, 2003, 2004 Free Software Foundation, Inc.