hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/crypto/twofish_common.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Common Twofish algorithm parts shared between the c and assembler
34 * implementations
....@@ -12,20 +13,6 @@
1213 * The original author has disclaimed all copyright interest in this
1314 * code and thus put it in the public domain. The subsequent authors
1415 * have put this under the GNU General Public License.
15
- *
16
- * This program is free software; you can redistribute it and/or modify
17
- * it under the terms of the GNU General Public License as published by
18
- * the Free Software Foundation; either version 2 of the License, or
19
- * (at your option) any later version.
20
- *
21
- * This program is distributed in the hope that it will be useful,
22
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
- * GNU General Public License for more details.
25
- *
26
- * You should have received a copy of the GNU General Public License
27
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
28
- *
2916 *
3017 * This code is a "clean room" implementation, written from the paper
3118 * _Twofish: A 128-Bit Block Cipher_ by Bruce Schneier, John Kelsey,
....@@ -580,7 +567,7 @@
580567
581568 /* Perform the key setup. */
582569 int __twofish_setkey(struct twofish_ctx *ctx, const u8 *key,
583
- unsigned int key_len, u32 *flags)
570
+ unsigned int key_len)
584571 {
585572 int i, j, k;
586573
....@@ -597,10 +584,7 @@
597584
598585 /* Check key length. */
599586 if (key_len % 8)
600
- {
601
- *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
602587 return -EINVAL; /* unsupported key length */
603
- }
604588
605589 /* Compute the first two words of the S vector. The magic numbers are
606590 * the entries of the RS matrix, preprocessed through poly_to_exp. The
....@@ -701,8 +685,7 @@
701685
702686 int twofish_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int key_len)
703687 {
704
- return __twofish_setkey(crypto_tfm_ctx(tfm), key, key_len,
705
- &tfm->crt_flags);
688
+ return __twofish_setkey(crypto_tfm_ctx(tfm), key, key_len);
706689 }
707690 EXPORT_SYMBOL_GPL(twofish_setkey);
708691