6
6
/**
7
7
* This class is build to demonstrate the application of the AES-algorithm on a
8
8
* single 128-Bit block of data.
9
- *
10
- * @see khalil2535
9
+ *
11
10
*/
12
11
public class AES {
13
12
@@ -202,8 +201,7 @@ public static BigInteger scheduleCore(BigInteger t, int rconCounter) {
202
201
String rBytes = t .toString (16 );
203
202
204
203
// Add zero padding
205
- int rBytesLength = rBytes .length ();
206
- while (rBytesLength < 8 ) {
204
+ while (rBytes .length () < 8 ) {
207
205
rBytes = "0" + rBytes ;
208
206
}
209
207
@@ -228,8 +226,8 @@ public static BigInteger scheduleCore(BigInteger t, int rconCounter) {
228
226
currentByteBits = Integer .toHexString (currentByte );
229
227
230
228
// Add zero padding
231
- int currentByteBitsLength = currentByteBits . length ();
232
- while (currentByteBitsLength < 2 ) {
229
+
230
+ while (currentByteBits . length () < 2 ) {
233
231
currentByteBits = '0' + currentByteBits ;
234
232
}
235
233
@@ -304,8 +302,7 @@ public static int[] splitBlockIntoCells(BigInteger block) {
304
302
String blockBits = block .toString (2 );
305
303
306
304
// Append leading 0 for full "128-bit" string
307
- int blockBitsLength = blockBits .length ();
308
- while (blockBitsLength < 128 ) {
305
+ while (blockBits .length () < 128 ) {
309
306
blockBits = '0' + blockBits ;
310
307
}
311
308
@@ -333,8 +330,7 @@ public static BigInteger mergeCellsIntoBlock(int[] cells) {
333
330
String cellBits = Integer .toBinaryString (cells [i ]);
334
331
335
332
// Append leading 0 for full "8-bit" strings
336
- int cellBitsLength = cellBits .length ();
337
- while (cellBitsLength < 8 ) {
333
+ while (cellBits .length () < 8 ) {
338
334
cellBits = '0' + cellBits ;
339
335
}
340
336
0 commit comments