| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Cryptographic API. |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 9 | 10 | * Added tnepres support: |
|---|
| 10 | 11 | * Ruben Jesus Garcia Hernandez <ruben@ugr.es>, 18.10.2004 |
|---|
| 11 | 12 | * 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. |
|---|
| 17 | 13 | */ |
|---|
| 18 | 14 | |
|---|
| 19 | 15 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 453 | 449 | } |
|---|
| 454 | 450 | EXPORT_SYMBOL_GPL(serpent_setkey); |
|---|
| 455 | 451 | |
|---|
| 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) |
|---|
| 457 | 453 | { |
|---|
| 454 | + const struct serpent_ctx *ctx = c; |
|---|
| 458 | 455 | const u32 *k = ctx->expkey; |
|---|
| 459 | 456 | const __le32 *s = (const __le32 *)src; |
|---|
| 460 | 457 | __le32 *d = (__le32 *)dst; |
|---|
| .. | .. |
|---|
| 518 | 515 | __serpent_encrypt(ctx, dst, src); |
|---|
| 519 | 516 | } |
|---|
| 520 | 517 | |
|---|
| 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) |
|---|
| 522 | 519 | { |
|---|
| 520 | + const struct serpent_ctx *ctx = c; |
|---|
| 523 | 521 | const u32 *k = ctx->expkey; |
|---|
| 524 | 522 | const __le32 *s = (const __le32 *)src; |
|---|
| 525 | 523 | __le32 *d = (__le32 *)dst; |
|---|
| .. | .. |
|---|
| 647 | 645 | .cia_decrypt = serpent_decrypt } } |
|---|
| 648 | 646 | }, { |
|---|
| 649 | 647 | .cra_name = "tnepres", |
|---|
| 648 | + .cra_driver_name = "tnepres-generic", |
|---|
| 650 | 649 | .cra_flags = CRYPTO_ALG_TYPE_CIPHER, |
|---|
| 651 | 650 | .cra_blocksize = SERPENT_BLOCK_SIZE, |
|---|
| 652 | 651 | .cra_ctxsize = sizeof(struct serpent_ctx), |
|---|
| .. | .. |
|---|
| 670 | 669 | crypto_unregister_algs(srp_algs, ARRAY_SIZE(srp_algs)); |
|---|
| 671 | 670 | } |
|---|
| 672 | 671 | |
|---|
| 673 | | -module_init(serpent_mod_init); |
|---|
| 672 | +subsys_initcall(serpent_mod_init); |
|---|
| 674 | 673 | module_exit(serpent_mod_fini); |
|---|
| 675 | 674 | |
|---|
| 676 | 675 | MODULE_LICENSE("GPL"); |
|---|