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

Quick Search    Search Deep

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

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

public final class Rijndael
extends BlockCipher

Rijndael --pronounced Reindaal-- is a symmetric cipher with a 128-bit block size and variable key-size (128-, 192- and 256-bit).

Rijndael was designed by Vincent Rijmen and Joan Daemen.

Version:
$Revision: 1.8 $

Field Summary
private static int BLOCK_SIZE
           
private  boolean decrypt
          True if in decrypt mode
private  int[] K
          Subkeys
private  int limit
          (ROUNDS-1) * 4
private static byte[] rcon
           
private  boolean ROUNDS_12
           
private  boolean ROUNDS_14
           
private static byte[] S
           
private static byte[] Si
           
private static java.lang.String SS
           
private static int[] T1
           
private static int[] T2
           
private static int[] T3
           
private static int[] T4
           
private static int[] T5
           
private static int[] T6
           
private static int[] T7
           
private static int[] T8
           
private static int[] U1
           
private static int[] U2
           
private static int[] U3
           
private static int[] U4
           
 
Fields inherited from class cryptix.jce.provider.cipher.BlockCipher
 
Constructor Summary
Rijndael()
           
 
Method Summary
private  void blockDecrypt(byte[] in, int inOffset, byte[] out, int outOffset)
          Decrypt exactly one block of plaintext.
private  void blockEncrypt(byte[] in, int inOffset, byte[] out, int outOffset)
          Encrypt exactly one block of plaintext.
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 static int getRounds(int keySize)
          Return The number of rounds for a given Rijndael keysize.
private static void invertKey(int[] K)
           
private static int[] makeKey(byte[] keyBytes, boolean decrypt)
          Expand a user-supplied key material into a session key.
 
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

ROUNDS_12

private boolean ROUNDS_12

ROUNDS_14

private boolean ROUNDS_14

decrypt

private boolean decrypt
True if in decrypt mode


K

private int[] K
Subkeys


limit

private int limit
(ROUNDS-1) * 4


BLOCK_SIZE

private static final int BLOCK_SIZE
See Also:
Constant Field Values

SS

private static final java.lang.String SS
See Also:
Constant Field Values

S

private static final byte[] S

Si

private static final byte[] Si

T1

private static final int[] T1

T2

private static final int[] T2

T3

private static final int[] T3

T4

private static final int[] T4

T5

private static final int[] T5

T6

private static final int[] T6

T7

private static final int[] T7

T8

private static final int[] T8

U1

private static final int[] U1

U2

private static final int[] U2

U3

private static final int[] U3

U4

private static final int[] U4

rcon

private static final byte[] rcon
Constructor Detail

Rijndael

public Rijndael()
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 void blockEncrypt(byte[] in,
                          int inOffset,
                          byte[] out,
                          int outOffset)
Encrypt exactly one block of plaintext.


blockDecrypt

private void blockDecrypt(byte[] in,
                          int inOffset,
                          byte[] out,
                          int outOffset)
Decrypt exactly one block of plaintext.


makeKey

private static int[] makeKey(byte[] keyBytes,
                             boolean decrypt)
                      throws java.security.InvalidKeyException
Expand a user-supplied key material into a session key.


invertKey

private static void invertKey(int[] K)

getRounds

private static int getRounds(int keySize)
Return The number of rounds for a given Rijndael keysize.