org.logi.crypto.modes
Class OFBProducer

java.lang.Object
  extended byorg.logi.crypto.Crypto
      extended byorg.logi.crypto.Producer
          extended byorg.logi.crypto.modes.OFBProducer
All Implemented Interfaces:
java.lang.Runnable

public class OFBProducer
extends Producer

This class is used by EncryptOFB and DecryptOFB to precalculate the keystream.

See Also:
EncryptOFB, DecryptOFB

Field Summary
 
Fields inherited from class org.logi.crypto.Crypto
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO
 
Constructor Summary
  OFBProducer(CipherKey key, int bufSize)
          Create new OFB thread with the given key and buffer size, but random IV.
protected OFBProducer(CipherKey key, int bufSize, byte[] IV, int i)
          Create new OFB thread with the given key, buffer size and IV[i..i+key.plainBlockSize()-1].
 
Method Summary
 void calculate(byte[] buf)
          Calculate the next bytes from the key-stream and put in buf.
 
Methods inherited from class org.logi.crypto.Producer
kill, nextBuffer, run, start
 
Methods inherited from class org.logi.crypto.Crypto
binString, binString, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, readBlock, readInt, writeBytes, writeBytes, writeInt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OFBProducer

public OFBProducer(CipherKey key,
                   int bufSize)
Create new OFB thread with the given key and buffer size, but random IV.


OFBProducer

protected OFBProducer(CipherKey key,
                      int bufSize,
                      byte[] IV,
                      int i)
Create new OFB thread with the given key, buffer size and IV[i..i+key.plainBlockSize()-1].

Method Detail

calculate

public void calculate(byte[] buf)
Calculate the next bytes from the key-stream and put in buf. We know that the size of buf is an even multiple of the size of input blocks.

Specified by:
calculate in class Producer