66/**
77 * This class is build to demonstrate the application of the AES-algorithm on a
88 * single 128-Bit block of data.
9- *
10- * @see khalil2535
9+ *
1110 */
1211public class AES {
1312
@@ -202,8 +201,7 @@ public static BigInteger scheduleCore(BigInteger t, int rconCounter) {
202201 String rBytes = t .toString (16 );
203202
204203 // Add zero padding
205- int rBytesLength = rBytes .length ();
206- while (rBytesLength < 8 ) {
204+ while (rBytes .length () < 8 ) {
207205 rBytes = "0" + rBytes ;
208206 }
209207
@@ -228,8 +226,8 @@ public static BigInteger scheduleCore(BigInteger t, int rconCounter) {
228226 currentByteBits = Integer .toHexString (currentByte );
229227
230228 // Add zero padding
231- int currentByteBitsLength = currentByteBits . length ();
232- while (currentByteBitsLength < 2 ) {
229+
230+ while (currentByteBits . length () < 2 ) {
233231 currentByteBits = '0' + currentByteBits ;
234232 }
235233
@@ -304,8 +302,7 @@ public static int[] splitBlockIntoCells(BigInteger block) {
304302 String blockBits = block .toString (2 );
305303
306304 // Append leading 0 for full "128-bit" string
307- int blockBitsLength = blockBits .length ();
308- while (blockBitsLength < 128 ) {
305+ while (blockBits .length () < 128 ) {
309306 blockBits = '0' + blockBits ;
310307 }
311308
@@ -333,8 +330,7 @@ public static BigInteger mergeCellsIntoBlock(int[] cells) {
333330 String cellBits = Integer .toBinaryString (cells [i ]);
334331
335332 // Append leading 0 for full "8-bit" strings
336- int cellBitsLength = cellBits .length ();
337- while (cellBitsLength < 8 ) {
333+ while (cellBits .length () < 8 ) {
338334 cellBits = '0' + cellBits ;
339335 }
340336
0 commit comments