MCPcopy Create free account
hub / github.com/TheAlgorithms/Java / subBytes

Method subBytes

src/main/java/com/thealgorithms/ciphers/AES.java:2539–2547  ·  view source on GitHub ↗

substitutes 8-Bit long substrings of the input using the S-Box and returns the result. @return subtraction Output

(BigInteger ciphertext)

Source from the content-addressed store, hash-verified

2537 * @return subtraction Output
2538 */
2539 public static BigInteger subBytes(BigInteger ciphertext) {
2540 int[] cells = splitBlockIntoCells(ciphertext);
2541
2542 for (int i = 0; i < 16; i++) {
2543 cells[i] = SBOX[cells[i]];
2544 }
2545
2546 return mergeCellsIntoBlock(cells);
2547 }
2548
2549 /**
2550 * substitutes 8-Bit long substrings of the input using the inverse S-Box

Callers 1

encryptMethod · 0.95

Calls 2

splitBlockIntoCellsMethod · 0.95
mergeCellsIntoBlockMethod · 0.95

Tested by

no test coverage detected