This method returns addition of two hexadecimal numbers passed as parameters and moded with 2^32 @param String a and b are hexadecimal numbers @return String object which is a is addition that is then moded with 2^32 of hex numbers passed as parameters
(String a, String b)
| 1138 | * passed as parameters |
| 1139 | */ |
| 1140 | private String addBin(String a, String b) { |
| 1141 | String ans = ""; |
| 1142 | long n1 = Long.parseUnsignedLong(a, 16); |
| 1143 | long n2 = Long.parseUnsignedLong(b, 16); |
| 1144 | n1 = (n1 + n2) % modVal; |
| 1145 | ans = Long.toHexString(n1); |
| 1146 | ans = "00000000" + ans; |
| 1147 | return ans.substring(ans.length() - 8); |
| 1148 | } |
| 1149 | |
| 1150 | /*F-function splits the 32-bit input into four 8-bit quarters |
| 1151 | and uses the quarters as input to the S-boxes. |