All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.provider.rpk.MixerGenerator

java.lang.Object
   |
   +----cryptix.provider.rpk.MixerGenerator

public class MixerGenerator
extends Object
implements Cloneable, Serializable
Implements a clock-controlled group of three RPK Generators. The first of these acts as a mixer --the register that is used to clock and select output, bit by bit, from one of the two sub-generators.

References:

  1. William M. Raike, The RPK Public-Key Cryptographic System - Technical Summary (available at http://crypto.swdev.co.nz).

  2. William M. Raike, Detailed Supplemental Technical Description of the RPK Public-Key Cryptographic System (available at http://crypto.swdev.co.nz).

Copyright © 1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.4 $

Author:
Raif S. Naffah

Constructor Index

 o MixerGenerator(int[][])
Instantiate a new Mixer Generator given the specifications of each of 3 non-linear feedback shift registers.

Method Index

 o atRandom(SecureRandom)
Load this object with random data generated from a designated source.
 o clone()
Return a reference to a duplicate of this object.
 o contains(Generator)
Return true iff this contains the designated argument, or an object of equal contents.
 o generatorAt(int)
Return a reference to the Generator at the designated index position.
 o getEncoded()
Return a concatenated sequence of the raw-encoded byte representation of each of this object's constituants.
 o getSize()
Return the total number of bits in this Mixer Generator.
 o isSameGroup(MixerGenerator)
Return true iff the argument is composed of polynomials that, one for one, belong to the same Group as those of the argument.
 o isSameValue(MixerGenerator)
Return true if the MixerGenerator x has equal contents to this one, ordered in the same manner; false otherwise.
 o listOfGenerators()
Return an Enumeration object of the Generators in this MixerGenerator.
 o load(byte[])
Copy the bit values from a byte array into this.
 o next(int)
Get the next count bits of output and return them right-aligned in a java long.
 o resetX(int)
For each Generator in this object (including the mixer) set the underlying LFSR's initial state to a value that corresponds to the coefficients of a polynomial of a given degree.
 o toByteArray()
Return a concatenated sequence of the contents of each of this object's constituants.
 o toString()
Return a formatted String representation of the binary contents of this.

Constructors

 o MixerGenerator
 public MixerGenerator(int specs[][])
Instantiate a new Mixer Generator given the specifications of each of 3 non-linear feedback shift registers.

Parameters:
specs - An array of 3 pairs of values defining the characteristics of 3 objects to be combined by this, the first of which will be used as the mixer/selector.
Throws: InvalidParameterException
If the argument is invalid.

Methods

 o clone
 public Object clone()
Return a reference to a duplicate of this object.

Overrides:
clone in class Object
 o next
 public long next(int count)
Get the next count bits of output and return them right-aligned in a java long.

The choice of which Generator will provide the next bit of oputput is selected based on the output value of the mixer --Generator at index 0. If its output is 0, the first sub-generator is used, otherwise it's the second.

Parameters:
count - Number of bits to output.
Returns:
Last 64 bits of the count output sequence, if argument is greater than 64, otherwise the value of count bits.
 o resetX
 public void resetX(int degree)
For each Generator in this object (including the mixer) set the underlying LFSR's initial state to a value that corresponds to the coefficients of a polynomial of a given degree.

Parameters:
n - Resets the register's contents to all zeroes except for a 1 at the index position corresponding to the term xn.
Throws: IllegalArgumentException
If the argument value is negative or greater than or equal to one of the underlying LFSR's trinomial degree.
See Also:
resetX
 o atRandom
 public void atRandom(SecureRandom source)
Load this object with random data generated from a designated source.

Parameters:
source - A source of randomness.
 o contains
 public boolean contains(Generator x)
Return true iff this contains the designated argument, or an object of equal contents.

Returns:
true iff this contains the designated argument, or an object of equal contents.
 o isSameValue
 public boolean isSameValue(MixerGenerator x)
Return true if the MixerGenerator x has equal contents to this one, ordered in the same manner; false otherwise.

NOTE: the equals method is not used, because this is a mutable object (see the requirements for equals in the Java Language Spec).

Returns:
true iff the argument is a MixerGenerator of equal contents, ordered in the same manner.
 o isSameGroup
 public boolean isSameGroup(MixerGenerator x)
Return true iff the argument is composed of polynomials that, one for one, belong to the same Group as those of the argument.

Returns:
true iff the argument is composed of polynomials that, one for one, belong to the same Group.
 o getSize
 public int getSize()
Return the total number of bits in this Mixer Generator.

Returns:
The total number of bits in this Mixer Generator.
 o getEncoded
 public byte[] getEncoded()
Return a concatenated sequence of the raw-encoded byte representation of each of this object's constituants.

Returns:
An encoding of this object as a byte array or null if an error occured.
See Also:
getEncoded
 o toByteArray
 public byte[] toByteArray()
Return a concatenated sequence of the contents of each of this object's constituants.

Returns:
The total contents of this object as a byte array or null if an error occured.
See Also:
getEncoded
 o load
 public void load(byte source[])
Copy the bit values from a byte array into this. This format mirrors that of the output returned by the toByteArray() method.

Parameters:
source - The source bits organised in a byte array.
See Also:
toByteArray
 o generatorAt
 public Generator generatorAt(int index)
Return a reference to the Generator at the designated index position.

Returns:
A reference to the Generator at the designated index position.
 o listOfGenerators
 public synchronized Enumeration listOfGenerators()
Return an Enumeration object of the Generators in this MixerGenerator.

Use the java.util.Enumeration methods on the returned object to fetch the generators sequentially. Note however that no guarrantees are given with regard to the order of the returned sequence. If the order is important, use the generatorAt() method.

Returns:
An enumeration of the Generators in this object.
See Also:
Enumeration, generatorAt
 o toString
 public String toString()
Return a formatted String representation of the binary contents of this.

Returns:
A formatted string representation of the binary contents of this.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index