diff options
| -rw-r--r-- | drivers/staging/rtl8723au/core/rtw_security.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/staging/rtl8723au/core/rtw_security.c b/drivers/staging/rtl8723au/core/rtw_security.c index 8e0e9fa0efdc..bcb5ea68acbe 100644 --- a/drivers/staging/rtl8723au/core/rtw_security.c +++ b/drivers/staging/rtl8723au/core/rtw_security.c | |||
| @@ -929,9 +929,9 @@ static void mix_column(u8 *in, u8 *out) | |||
| 929 | 929 | ||
| 930 | for (i = 0; i < 4; i++) { | 930 | for (i = 0; i < 4; i++) { |
| 931 | if ((in[i] & 0x80) == 0x80) | 931 | if ((in[i] & 0x80) == 0x80) |
| 932 | add1b[i] = 0x1b; | 932 | add1b[i] = 0x1b; |
| 933 | else | 933 | else |
| 934 | add1b[i] = 0x00; | 934 | add1b[i] = 0x00; |
| 935 | } | 935 | } |
| 936 | 936 | ||
| 937 | swap_halfs[0] = in[2]; /* Swap halfs */ | 937 | swap_halfs[0] = in[2]; /* Swap halfs */ |
| @@ -986,21 +986,21 @@ static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext) | |||
| 986 | 986 | ||
| 987 | for (round = 0; round < 11; round++) { | 987 | for (round = 0; round < 11; round++) { |
| 988 | if (round == 0) { | 988 | if (round == 0) { |
| 989 | xor_128(round_key, data, ciphertext); | 989 | xor_128(round_key, data, ciphertext); |
| 990 | next_key(round_key, round); | 990 | next_key(round_key, round); |
| 991 | } else if (round == 10) { | 991 | } else if (round == 10) { |
| 992 | byte_sub(ciphertext, intermediatea); | 992 | byte_sub(ciphertext, intermediatea); |
| 993 | shift_row(intermediatea, intermediateb); | 993 | shift_row(intermediatea, intermediateb); |
| 994 | xor_128(intermediateb, round_key, ciphertext); | 994 | xor_128(intermediateb, round_key, ciphertext); |
| 995 | } else { /* 1 - 9 */ | 995 | } else { /* 1 - 9 */ |
| 996 | byte_sub(ciphertext, intermediatea); | 996 | byte_sub(ciphertext, intermediatea); |
| 997 | shift_row(intermediatea, intermediateb); | 997 | shift_row(intermediatea, intermediateb); |
| 998 | mix_column(&intermediateb[0], &intermediatea[0]); | 998 | mix_column(&intermediateb[0], &intermediatea[0]); |
| 999 | mix_column(&intermediateb[4], &intermediatea[4]); | 999 | mix_column(&intermediateb[4], &intermediatea[4]); |
| 1000 | mix_column(&intermediateb[8], &intermediatea[8]); | 1000 | mix_column(&intermediateb[8], &intermediatea[8]); |
| 1001 | mix_column(&intermediateb[12], &intermediatea[12]); | 1001 | mix_column(&intermediateb[12], &intermediatea[12]); |
| 1002 | xor_128(intermediatea, round_key, ciphertext); | 1002 | xor_128(intermediatea, round_key, ciphertext); |
| 1003 | next_key(round_key, round); | 1003 | next_key(round_key, round); |
| 1004 | } | 1004 | } |
| 1005 | } | 1005 | } |
| 1006 | 1006 | ||
| @@ -1501,7 +1501,7 @@ static int aes_decipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) | |||
| 1501 | for (j = 0; j < 16; j++) | 1501 | for (j = 0; j < 16; j++) |
| 1502 | padded_buffer[j] = 0x00; | 1502 | padded_buffer[j] = 0x00; |
| 1503 | for (j = 0; j < payload_remainder; j++) | 1503 | for (j = 0; j < payload_remainder; j++) |
| 1504 | padded_buffer[j] = message[payload_index++]; | 1504 | padded_buffer[j] = message[payload_index++]; |
| 1505 | bitwise_xor(aes_out, padded_buffer, chain_buffer); | 1505 | bitwise_xor(aes_out, padded_buffer, chain_buffer); |
| 1506 | aes128k128d(key, chain_buffer, aes_out); | 1506 | aes128k128d(key, chain_buffer, aes_out); |
| 1507 | } | 1507 | } |
| @@ -1531,7 +1531,7 @@ static int aes_decipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) | |||
| 1531 | message, pn_vector, num_blocks + 1); | 1531 | message, pn_vector, num_blocks + 1); |
| 1532 | 1532 | ||
| 1533 | for (j = 0; j < 16; j++) | 1533 | for (j = 0; j < 16; j++) |
| 1534 | padded_buffer[j] = 0x00; | 1534 | padded_buffer[j] = 0x00; |
| 1535 | for (j = 0; j < payload_remainder; j++) | 1535 | for (j = 0; j < payload_remainder; j++) |
| 1536 | padded_buffer[j] = message[payload_index + j]; | 1536 | padded_buffer[j] = message[payload_index + j]; |
| 1537 | aes128k128d(key, ctr_preload, aes_out); | 1537 | aes128k128d(key, ctr_preload, aes_out); |
