|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.crypto.CryptixRijndael_Algorithm
public final class CryptixRijndael_Algorithm
Rijndael --pronounced Reindaal-- is a variable block-size (128-, 192- and 256-bit), variable key-size (128-, 192- and 256-bit) symmetric cipher.
Rijndael was written by Vincent Rijmen and Joan Daemen.
Portions of this code are Copyright © 1997, 1998
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
Field Summary | |
---|---|
(package private) static int[] |
_alog
|
(package private) static int |
_BLOCK_SIZE
|
(package private) static int |
_debuglevel
|
(package private) static java.io.PrintWriter |
_err
|
(package private) static boolean |
_IN
|
(package private) static int[] |
_log
|
(package private) static java.lang.String |
_NAME
|
(package private) static boolean |
_OUT
|
(package private) static byte[] |
_rcon
|
(package private) static boolean |
_RDEBUG
|
(package private) static byte[] |
_S
|
(package private) static int[][][] |
_shifts
|
(package private) static byte[] |
_Si
|
(package private) static int[] |
_T1
|
(package private) static int[] |
_T2
|
(package private) static int[] |
_T3
|
(package private) static int[] |
_T4
|
(package private) static int[] |
_T5
|
(package private) static int[] |
_T6
|
(package private) static int[] |
_T7
|
(package private) static int[] |
_T8
|
(package private) static boolean |
_TRACE
|
(package private) static int[] |
_U1
|
(package private) static int[] |
_U2
|
(package private) static int[] |
_U3
|
(package private) static int[] |
_U4
|
Constructor Summary | |
---|---|
CryptixRijndael_Algorithm()
|
Method Summary | |
---|---|
static void |
blockDecrypt(byte[] in,
byte[] result,
int inOffset,
int outOffset,
java.lang.Object sessionKey)
Convenience method to decrypt exactly one block of plaintext, assuming Rijndael's default block size (128-bit). |
static void |
blockDecrypt(byte[] in,
byte[] result,
int inOffset,
int outOffset,
java.lang.Object sessionKey,
int blockSize)
Decrypt exactly one block of ciphertext. |
static void |
blockEncrypt(byte[] in,
byte[] result,
int inOffset,
int outOffset,
java.lang.Object sessionKey)
Convenience method to encrypt exactly one block of plaintext, assuming Rijndael's default block size (128-bit). |
static void |
blockEncrypt(byte[] in,
byte[] result,
int inOffset,
int outOffset,
java.lang.Object sessionKey,
int blockSize)
Encrypt exactly one block of plaintext. |
static int |
blockSize()
|
(package private) static void |
debug(java.lang.String s)
|
static int |
getRounds(int keySize,
int blockSize)
Return The number of rounds for a given Rijndael's key and block sizes. |
static void |
main(java.lang.String[] args)
|
static java.lang.Object |
makeKey(byte[] k)
Convenience method to expand a user-supplied key material into a session key, assuming Rijndael's default block size (128-bit). |
static java.lang.Object |
makeKey(byte[] k,
int blockSize)
Expand a user-supplied key material into a session key. |
static java.lang.Object |
makeKey(byte[] k,
int blockSize,
CryptixAESKeyCache.KeyCacheEntry keyData)
|
(package private) static int |
mul(int a,
int b)
|
(package private) static int |
mul4(int a,
byte[] b)
|
static boolean |
self_test()
A basic symmetric encryption/decryption test. |
(package private) static void |
trace(boolean in,
java.lang.String s)
|
(package private) static void |
trace(java.lang.String s)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final java.lang.String _NAME
static final boolean _IN
static final boolean _OUT
static final boolean _RDEBUG
static final int _debuglevel
static final java.io.PrintWriter _err
static final boolean _TRACE
static final int _BLOCK_SIZE
static final int[] _alog
static final int[] _log
static final byte[] _S
static final byte[] _Si
static final int[] _T1
static final int[] _T2
static final int[] _T3
static final int[] _T4
static final int[] _T5
static final int[] _T6
static final int[] _T7
static final int[] _T8
static final int[] _U1
static final int[] _U2
static final int[] _U3
static final int[] _U4
static final byte[] _rcon
static final int[][][] _shifts
Constructor Detail |
---|
public CryptixRijndael_Algorithm()
Method Detail |
---|
static void debug(java.lang.String s)
static void trace(boolean in, java.lang.String s)
static void trace(java.lang.String s)
static final int mul(int a, int b)
static final int mul4(int a, byte[] b)
public static final java.lang.Object makeKey(byte[] k) throws java.security.InvalidKeyException
k
- The 128/192/256-bit user-key to use.
java.security.InvalidKeyException
- If the key is invalid.public static final void blockEncrypt(byte[] in, byte[] result, int inOffset, int outOffset, java.lang.Object sessionKey)
in
- The plaintext.result
- The resulting ciphertext.inOffset
- Index of in from which to start considering data.sessionKey
- The session key to use for encryption.public static final void blockDecrypt(byte[] in, byte[] result, int inOffset, int outOffset, java.lang.Object sessionKey)
in
- The ciphertext.result
- The resulting ciphertextinOffset
- Index of in from which to start considering data.sessionKey
- The session key to use for decryption.public static boolean self_test()
public static final int blockSize()
public static final java.lang.Object makeKey(byte[] k, int blockSize) throws java.security.InvalidKeyException
k
- The 128/192/256-bit user-key to use.blockSize
- The block size in bytes of this Rijndael.
java.security.InvalidKeyException
- If the key is invalid.public static final java.lang.Object makeKey(byte[] k, int blockSize, CryptixAESKeyCache.KeyCacheEntry keyData) throws java.security.InvalidKeyException
java.security.InvalidKeyException
public static final void blockEncrypt(byte[] in, byte[] result, int inOffset, int outOffset, java.lang.Object sessionKey, int blockSize)
in
- The plaintext.result
- The resulting ciphertext.inOffset
- Index of in from which to start considering data.sessionKey
- The session key to use for encryption.blockSize
- The block size in bytes of this Rijndael.public static final void blockDecrypt(byte[] in, byte[] result, int inOffset, int outOffset, java.lang.Object sessionKey, int blockSize)
in
- The ciphertext.result
- The resulting ciphertext.inOffset
- Index of in from which to start considering data.sessionKey
- The session key to use for decryption.blockSize
- The block size in bytes of this Rijndael.public static final int getRounds(int keySize, int blockSize)
keySize
- The size of the user key material in bytes.blockSize
- The desired block size in bytes.
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |