All Packages Class Hierarchy This Package Previous Next Index
Class cryptix.provider.rpk.Generator
java.lang.Object
|
+----cryptix.util.math.BigRegister
|
+----cryptix.util.math.TrinomialLFSR
|
+----cryptix.provider.rpk.Generator
- public class Generator
- extends TrinomialLFSR
- implements RPKParams, Cloneable, Serializable
A Generator
in the RPK scheme is an LFSR with
a connection trinomial (TrinomialLFSR
) modified
to make its clocking state-dependent.
When such a generator is clocked, and its state bits
matching a specified mask are all zeroes, the next
stutter bits are discarded. This effectively provides
a non-linear output bit stream.
References:
- William M. Raike,
The RPK Public-Key Cryptographic System - Technical Summary
(available at
http://crypto.swdev.co.nz).
- 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.6 $
- Author:
- Raif S. Naffah
-
Generator(int, int)
- Instantiate a
Generator
object using default
values for stuttering and stutter mask.
-
Generator(int, int, int, int)
- Instantiate a
Generator
object given all
its characteristics.
-
clone()
- Return a reference to a duplicate of
this
.
-
engineClock(int)
- Clock this generator with stutter if applicable.
-
getEncoded()
- Return a byte representation of
this
object.
-
next(int)
- Return the value of the leftmost
count
bits of
this LFSR and clock it by as many ticks.
Generator
public Generator(int l,
int k,
int m,
int s)
- Instantiate a
Generator
object given all
its characteristics.
- Parameters:
- l - Number of stages/delay elements of the LFSR.
- k - Value of the mid-tap element completing the
trinomial definition.
- m - Mask value to govern the frequency of stuttering,
ie. non-linearity, of this generator. No checks are
done on this value. If it is zero, then this generator
will stutter every time it is clocked.
- s - Number of bits to discard if the generator's output,
at the masked positions, is all zeroes.
- Throws: InvalidParameterException
- If the (l, k) value pair
is not supported by this class.
- See Also:
- TrinomialLFSR
Generator
public Generator(int l,
int k)
- Instantiate a
Generator
object using default
values for stuttering and stutter mask.
- Parameters:
- l - Number of stages/delay elements of the LFSR.
- k - Value of the mid-tap element completing the
trinomial definition.
- See Also:
- TrinomialLFSR, DEFAULT_STUTTER_MASK, DEFAULT_STUTTER
clone
public Object clone()
- Return a reference to a duplicate of
this
.
- Overrides:
- clone in class TrinomialLFSR
engineClock
protected void engineClock(int ticks)
- Clock this generator with stutter if applicable.
The bits tested against the mask
are the 32
leftmost ones in the FSR.
- Parameters:
- ticks - number of steps to clock the FSR by. The
condition that this value never exceeds the FSR's
slice
is guaranteed by:
- choosing appropriately the value of
stutter
at instantiation time, and
- calling the superclass method in 2 steps rather
than combining
ticks
and stutter
together.
- Overrides:
- engineClock in class TrinomialLFSR
next
public long next(int count)
- Return the value of the leftmost
count
bits of
this LFSR and clock it by as many ticks.
- Overrides:
- next in class TrinomialLFSR
getEncoded
public byte[] getEncoded()
- Return a byte representation of
this
object. The
semantics of the return byte sequence is as follows:
Byte Length
offset (bytes) Meaning
0 2 The value of the Generator's size, MSB first;
2 2 The value of the Generator's mid-tap, MSB first;
4 2 The length of the byte array containing this
Generator's register/state, MSB first;
6 ?? The Generator's register contents.
- Returns:
- An encoding of
this
object as a byte array
or null if an error occured.
All Packages Class Hierarchy This Package Previous Next Index