michael_mic.c (0898782247ae533d1f4e47a06bc5d4870931b284) michael_mic.c (674f368a952c48ede71784935a799a5205b92b6c)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Cryptographic API
4 *
5 * Michael MIC (IEEE 802.11i/TKIP) keyed digest
6 *
7 * Copyright (c) 2004 Jouni Malinen <j@w1.fi>
8 */

--- 123 unchanged lines hidden (view full) ---

132
133static int michael_setkey(struct crypto_shash *tfm, const u8 *key,
134 unsigned int keylen)
135{
136 struct michael_mic_ctx *mctx = crypto_shash_ctx(tfm);
137
138 const __le32 *data = (const __le32 *)key;
139
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Cryptographic API
4 *
5 * Michael MIC (IEEE 802.11i/TKIP) keyed digest
6 *
7 * Copyright (c) 2004 Jouni Malinen <j@w1.fi>
8 */

--- 123 unchanged lines hidden (view full) ---

132
133static int michael_setkey(struct crypto_shash *tfm, const u8 *key,
134 unsigned int keylen)
135{
136 struct michael_mic_ctx *mctx = crypto_shash_ctx(tfm);
137
138 const __le32 *data = (const __le32 *)key;
139
140 if (keylen != 8) {
141 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
140 if (keylen != 8)
142 return -EINVAL;
141 return -EINVAL;
143 }
144
145 mctx->l = le32_to_cpu(data[0]);
146 mctx->r = le32_to_cpu(data[1]);
147 return 0;
148}
149
150static struct shash_alg alg = {
151 .digestsize = 8,

--- 34 unchanged lines hidden ---
142
143 mctx->l = le32_to_cpu(data[0]);
144 mctx->r = le32_to_cpu(data[1]);
145 return 0;
146}
147
148static struct shash_alg alg = {
149 .digestsize = 8,

--- 34 unchanged lines hidden ---