hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/crypto/serpent_generic.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Cryptographic API.
34 *
....@@ -9,11 +10,6 @@
910 * Added tnepres support:
1011 * Ruben Jesus Garcia Hernandez <ruben@ugr.es>, 18.10.2004
1112 * Based on code by hvr
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License as published by
15
- * the Free Software Foundation; either version 2 of the License, or
16
- * (at your option) any later version.
1713 */
1814
1915 #include <linux/init.h>
....@@ -453,8 +449,9 @@
453449 }
454450 EXPORT_SYMBOL_GPL(serpent_setkey);
455451
456
-void __serpent_encrypt(struct serpent_ctx *ctx, u8 *dst, const u8 *src)
452
+void __serpent_encrypt(const void *c, u8 *dst, const u8 *src)
457453 {
454
+ const struct serpent_ctx *ctx = c;
458455 const u32 *k = ctx->expkey;
459456 const __le32 *s = (const __le32 *)src;
460457 __le32 *d = (__le32 *)dst;
....@@ -518,8 +515,9 @@
518515 __serpent_encrypt(ctx, dst, src);
519516 }
520517
521
-void __serpent_decrypt(struct serpent_ctx *ctx, u8 *dst, const u8 *src)
518
+void __serpent_decrypt(const void *c, u8 *dst, const u8 *src)
522519 {
520
+ const struct serpent_ctx *ctx = c;
523521 const u32 *k = ctx->expkey;
524522 const __le32 *s = (const __le32 *)src;
525523 __le32 *d = (__le32 *)dst;
....@@ -647,6 +645,7 @@
647645 .cia_decrypt = serpent_decrypt } }
648646 }, {
649647 .cra_name = "tnepres",
648
+ .cra_driver_name = "tnepres-generic",
650649 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
651650 .cra_blocksize = SERPENT_BLOCK_SIZE,
652651 .cra_ctxsize = sizeof(struct serpent_ctx),
....@@ -670,7 +669,7 @@
670669 crypto_unregister_algs(srp_algs, ARRAY_SIZE(srp_algs));
671670 }
672671
673
-module_init(serpent_mod_init);
672
+subsys_initcall(serpent_mod_init);
674673 module_exit(serpent_mod_fini);
675674
676675 MODULE_LICENSE("GPL");