stm32-crc32.c (976e3645923bdd2fe7893aae33fd7a21098bfb28) stm32-crc32.c (674f368a952c48ede71784935a799a5205b92b6c)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) STMicroelectronics SA 2017
4 * Author: Fabien Dessenne <fabien.dessenne@st.com>
5 */
6
7#include <linux/bitrev.h>
8#include <linux/clk.h>

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

80 return 0;
81}
82
83static int stm32_crc_setkey(struct crypto_shash *tfm, const u8 *key,
84 unsigned int keylen)
85{
86 struct stm32_crc_ctx *mctx = crypto_shash_ctx(tfm);
87
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) STMicroelectronics SA 2017
4 * Author: Fabien Dessenne <fabien.dessenne@st.com>
5 */
6
7#include <linux/bitrev.h>
8#include <linux/clk.h>

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

80 return 0;
81}
82
83static int stm32_crc_setkey(struct crypto_shash *tfm, const u8 *key,
84 unsigned int keylen)
85{
86 struct stm32_crc_ctx *mctx = crypto_shash_ctx(tfm);
87
88 if (keylen != sizeof(u32)) {
89 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
88 if (keylen != sizeof(u32))
90 return -EINVAL;
89 return -EINVAL;
91 }
92
93 mctx->key = get_unaligned_le32(key);
94 return 0;
95}
96
97static int stm32_crc_init(struct shash_desc *desc)
98{
99 struct stm32_crc_desc_ctx *ctx = shash_desc_ctx(desc);

--- 286 unchanged lines hidden ---
90
91 mctx->key = get_unaligned_le32(key);
92 return 0;
93}
94
95static int stm32_crc_init(struct shash_desc *desc)
96{
97 struct stm32_crc_desc_ctx *ctx = shash_desc_ctx(desc);

--- 286 unchanged lines hidden ---