diff options
Diffstat (limited to 'net/mac80211/aes_ccm.c')
-rw-r--r-- | net/mac80211/aes_ccm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/mac80211/aes_ccm.c b/net/mac80211/aes_ccm.c index e55569bee7d0..bf7ba128b963 100644 --- a/net/mac80211/aes_ccm.c +++ b/net/mac80211/aes_ccm.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/kernel.h> | ||
10 | #include <linux/types.h> | 11 | #include <linux/types.h> |
11 | #include <linux/crypto.h> | 12 | #include <linux/crypto.h> |
12 | #include <linux/err.h> | 13 | #include <linux/err.h> |
@@ -63,7 +64,7 @@ void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch, | |||
63 | s_0 = scratch + AES_BLOCK_LEN; | 64 | s_0 = scratch + AES_BLOCK_LEN; |
64 | e = scratch + 2 * AES_BLOCK_LEN; | 65 | e = scratch + 2 * AES_BLOCK_LEN; |
65 | 66 | ||
66 | num_blocks = (data_len + AES_BLOCK_LEN - 1) / AES_BLOCK_LEN; | 67 | num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN); |
67 | last_len = data_len % AES_BLOCK_LEN; | 68 | last_len = data_len % AES_BLOCK_LEN; |
68 | aes_ccm_prepare(tfm, b_0, aad, b, s_0, b); | 69 | aes_ccm_prepare(tfm, b_0, aad, b, s_0, b); |
69 | 70 | ||
@@ -102,7 +103,7 @@ int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch, | |||
102 | s_0 = scratch + AES_BLOCK_LEN; | 103 | s_0 = scratch + AES_BLOCK_LEN; |
103 | a = scratch + 2 * AES_BLOCK_LEN; | 104 | a = scratch + 2 * AES_BLOCK_LEN; |
104 | 105 | ||
105 | num_blocks = (data_len + AES_BLOCK_LEN - 1) / AES_BLOCK_LEN; | 106 | num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN); |
106 | last_len = data_len % AES_BLOCK_LEN; | 107 | last_len = data_len % AES_BLOCK_LEN; |
107 | aes_ccm_prepare(tfm, b_0, aad, b, s_0, a); | 108 | aes_ccm_prepare(tfm, b_0, aad, b, s_0, a); |
108 | 109 | ||