< prev index next >
src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java
Print this page
rev 13928 : 8152172: PPC64: Support AES intrinsics
Reviewed-by: ascarpino, simonis
Contributed-by: Hiroshi H Horii <HORII@jp.ibm.com>
*** 54,64 ****
{
private boolean ROUNDS_12 = false;
private boolean ROUNDS_14 = false;
/** Session and Sub keys */
! private Object[] sessionK = null;
private int[] K = null;
/** Cipher encryption/decryption key */
// skip re-generating Session and Sub keys if the cipher key is
// the same
--- 54,64 ----
{
private boolean ROUNDS_12 = false;
private boolean ROUNDS_14 = false;
/** Session and Sub keys */
! private int[][] sessionK = null;
private int[] K = null;
/** Cipher encryption/decryption key */
// skip re-generating Session and Sub keys if the cipher key is
// the same
*** 97,107 ****
makeSessionKey(key);
lastKey = key.clone(); // save cipher key
}
// set sub key to the corresponding session Key
! this.K = (int[]) sessionK[(decrypting? 1:0)];
}
/**
* Expand an int[(ROUNDS+1)][4] into int[(ROUNDS+1)*4].
* For decryption round keys, need to rotate right by 4 ints.
--- 97,107 ----
makeSessionKey(key);
lastKey = key.clone(); // save cipher key
}
// set sub key to the corresponding session Key
! this.K = sessionK[(decrypting? 1:0)];
}
/**
* Expand an int[(ROUNDS+1)][4] into int[(ROUNDS+1)*4].
* For decryption round keys, need to rotate right by 4 ints.
*** 678,688 ****
ROUNDS_12 = (ROUNDS>=12);
ROUNDS_14 = (ROUNDS==14);
limit = ROUNDS*4;
// store the expanded sub keys into 'sessionK'
! sessionK = new Object[] { expandedKe, expandedKd };
}
/**
* Return The number of rounds for a given Rijndael keysize.
--- 678,688 ----
ROUNDS_12 = (ROUNDS>=12);
ROUNDS_14 = (ROUNDS==14);
limit = ROUNDS*4;
// store the expanded sub keys into 'sessionK'
! sessionK = new int[][] { expandedKe, expandedKd };
}
/**
* Return The number of rounds for a given Rijndael keysize.
< prev index next >