Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

cryptix.jce.provider.cipher
Class SKIPJACK  view SKIPJACK download SKIPJACK.java

java.lang.Object
  extended byjavax.crypto.CipherSpi
      extended bycryptix.jce.provider.cipher.BlockCipher
          extended bycryptix.jce.provider.cipher.SKIPJACK

public final class SKIPJACK
extends BlockCipher

SKIPJACK

Version:
$Revision: 1.5 $

Field Summary
private static int BLOCK_SIZE
           
private  boolean decrypt
          We are in decrypt mode
private static int[] F
           
private  int[] K
          Twelf-byte array of subkeys.
private static int KEY_LENGTH
           
 
Fields inherited from class cryptix.jce.provider.cipher.BlockCipher
 
Constructor Summary
SKIPJACK()
           
 
Method Summary
private  void blockDecrypt(byte[] in, int inOffset, byte[] out, int outOffset)
          Decrypt a single block.
private  void blockEncrypt(byte[] in, int inOffset, byte[] out, int outOffset)
          Encrypt a single, 8-byte block.
protected  void coreCrypt(byte[] in, int inOffset, byte[] out, int outOffset)
          Encrypt a given buffer.
protected  void coreInit(java.security.Key key, boolean decrypt)
           
private  int G(int in, int counter)
          G-function used by blockEncrypt
private  int GINV(int in, int counter)
          G-inverse function used by blockDecrypt
 
Methods inherited from class cryptix.jce.provider.cipher.BlockCipher
clone, coreGetBlockSize, engineDoFinal, engineDoFinal, engineGetBlockSize, engineGetIV, engineGetKeySize, engineGetOutputSize, engineGetParameters, engineInit, engineInit, engineInit, engineSetMode, engineSetPadding, engineUpdate, engineUpdate
 
Methods inherited from class javax.crypto.CipherSpi
engineDoFinal, engineUnwrap, engineUpdate, engineWrap
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLOCK_SIZE

private static final int BLOCK_SIZE
See Also:
Constant Field Values

KEY_LENGTH

private static final int KEY_LENGTH
See Also:
Constant Field Values

F

private static final int[] F

K

private final int[] K
Twelf-byte array of subkeys. It's 12 to save on modulus operations. The last 2 bytes must be equal to the first two bytes.


decrypt

private boolean decrypt
We are in decrypt mode

Constructor Detail

SKIPJACK

public SKIPJACK()
Method Detail

coreInit

protected void coreInit(java.security.Key key,
                        boolean decrypt)
                 throws java.security.InvalidKeyException
Specified by:
coreInit in class BlockCipher

coreCrypt

protected void coreCrypt(byte[] in,
                         int inOffset,
                         byte[] out,
                         int outOffset)
Description copied from class: BlockCipher
Encrypt a given buffer. in and out can point to the same buffer if (outOffset == inOffset) || (outOffset >= (inOffset+coreGetBlockSize)) That is: the buffers may not partially overlap...

Specified by:
coreCrypt in class BlockCipher

blockEncrypt

private final void blockEncrypt(byte[] in,
                                int inOffset,
                                byte[] out,
                                int outOffset)
Encrypt a single, 8-byte block. Input and output may overlap.


G

private final int G(int in,
                    int counter)
G-function used by blockEncrypt


blockDecrypt

private final void blockDecrypt(byte[] in,
                                int inOffset,
                                byte[] out,
                                int outOffset)
Decrypt a single block. Input and output may overlap.


GINV

private final int GINV(int in,
                       int counter)
G-inverse function used by blockDecrypt