Skip to content

Commit c1a8449

Browse files
committed
Refactor
1 parent 2b74e42 commit c1a8449

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

aes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,12 @@ static uint8_t invnorm(uint8_t in) {
213213
if (x == 0) {
214214
return 0;
215215
} else {
216-
bf8_t bf_x_17 = bf8_inv(x);
216+
const bf8_t bf_x_inv = bf8_inv(x);
217+
bf8_t bf_x_17 = bf_x_inv;
217218
for (unsigned int i = 0; i < 4; i++) {
218219
bf_x_17 = bf8_mul(bf_x_17, bf_x_17);
219220
}
220-
bf_x_17 = bf8_mul(bf_x_17, bf8_inv(x));
221+
bf_x_17 = bf8_mul(bf_x_17, bf_x_inv);
221222
uint8_t y_prime = 0;
222223
bf8_store(&y_prime, bf_x_17);
223224
uint8_t y = 0;
@@ -230,7 +231,6 @@ static uint8_t invnorm(uint8_t in) {
230231
}
231232

232233
static void store_invnorm_state(uint8_t* dst, aes_block_t state, unsigned int block_words) {
233-
234234
for (unsigned int i = 0; i != block_words * 4; ++i) { // going thorugh each block
235235
uint8_t normstate = invnorm(state[i / 4][i % 4]);
236236
bf8_store(&dst[i], normstate);

0 commit comments

Comments
 (0)