Skip to content

Commit

Permalink
crypto: Prepare to move crypto_tfm_ctx
Browse files Browse the repository at this point in the history
The helper crypto_tfm_ctx is only used by the Crypto API algorithm
code and should really be in algapi.h.  However, for historical
reasons many files relied on it to be in crypto.h.  This patch
changes those files to use algapi.h instead in prepartion for a
move.

Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Dec 2, 2022
1 parent 7bcceb4 commit 14386d4
Show file tree
Hide file tree
Showing 26 changed files with 30 additions and 25 deletions.
2 changes: 1 addition & 1 deletion arch/arm/crypto/aes-cipher-glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

#include <crypto/aes.h>
#include <linux/crypto.h>
#include <crypto/algapi.h>
#include <linux/module.h>

asmlinkage void __aes_arm_encrypt(u32 *rk, int rounds, const u8 *in, u8 *out);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/crypto/aes-ce-glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include <asm/simd.h>
#include <asm/unaligned.h>
#include <crypto/aes.h>
#include <crypto/algapi.h>
#include <crypto/internal/simd.h>
#include <linux/cpufeature.h>
#include <linux/crypto.h>
#include <linux/module.h>

#include "aes-ce-setkey.h"
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/crypto/aes-cipher-glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include <crypto/aes.h>
#include <linux/crypto.h>
#include <crypto/algapi.h>
#include <linux/module.h>

asmlinkage void __aes_arm64_encrypt(u32 *rk, u8 *out, const u8 *in, int rounds);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/crypto/sm4-ce-cipher-glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

#include <asm/neon.h>
#include <asm/simd.h>
#include <crypto/algapi.h>
#include <crypto/sm4.h>
#include <crypto/internal/simd.h>
#include <linux/module.h>
#include <linux/cpufeature.h>
#include <linux/crypto.h>
#include <linux/types.h>

MODULE_ALIAS_CRYPTO("sm4");
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/crypto/twofish_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
* Third Edition.
*/

#include <crypto/algapi.h>
#include <crypto/twofish.h>
#include <linux/crypto.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/types.h>
Expand Down
2 changes: 1 addition & 1 deletion crypto/aes_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
*/

#include <crypto/aes.h>
#include <crypto/algapi.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/crypto.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>

Expand Down
2 changes: 1 addition & 1 deletion crypto/aes_ti.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include <crypto/aes.h>
#include <linux/crypto.h>
#include <crypto/algapi.h>
#include <linux/module.h>

static int aesti_set_key(struct crypto_tfm *tfm, const u8 *in_key,
Expand Down
2 changes: 1 addition & 1 deletion crypto/anubis.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
*
*/

#include <crypto/algapi.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <asm/byteorder.h>
#include <linux/crypto.h>
#include <linux/types.h>

#define ANUBIS_MIN_KEY_SIZE 16
Expand Down
3 changes: 2 additions & 1 deletion crypto/blowfish_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
* Copyright (c) Kyle McMartin <[email protected]>
* Copyright (c) 2002 James Morris <[email protected]>
*/

#include <crypto/algapi.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <asm/byteorder.h>
#include <linux/crypto.h>
#include <linux/types.h>
#include <crypto/blowfish.h>

Expand Down
3 changes: 2 additions & 1 deletion crypto/blowfish_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
* Copyright (c) Kyle McMartin <[email protected]>
* Copyright (c) 2002 James Morris <[email protected]>
*/

#include <crypto/algapi.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <asm/unaligned.h>
#include <linux/crypto.h>
#include <linux/types.h>
#include <crypto/blowfish.h>

Expand Down
2 changes: 1 addition & 1 deletion crypto/camellia_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* https://info.isl.ntt.co.jp/crypt/eng/camellia/specifications.html
*/

#include <linux/crypto.h>
#include <crypto/algapi.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/kernel.h>
Expand Down
2 changes: 1 addition & 1 deletion crypto/cast5_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@


#include <asm/unaligned.h>
#include <crypto/algapi.h>
#include <linux/init.h>
#include <linux/crypto.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/string.h>
Expand Down
2 changes: 1 addition & 1 deletion crypto/cast6_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@


#include <asm/unaligned.h>
#include <crypto/algapi.h>
#include <linux/init.h>
#include <linux/crypto.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/string.h>
Expand Down
2 changes: 1 addition & 1 deletion crypto/des_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
*/

#include <asm/byteorder.h>
#include <crypto/algapi.h>
#include <linux/bitops.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/crypto.h>

#include <crypto/internal/des.h>

Expand Down
2 changes: 1 addition & 1 deletion crypto/fcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
*/

#include <asm/byteorder.h>
#include <crypto/algapi.h>
#include <linux/bitops.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/crypto.h>

#define ROUNDS 16

Expand Down
2 changes: 1 addition & 1 deletion crypto/khazad.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
*
*/

#include <crypto/algapi.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <asm/byteorder.h>
#include <linux/crypto.h>
#include <linux/types.h>

#define KHAZAD_KEY_SIZE 16
Expand Down
2 changes: 1 addition & 1 deletion crypto/seed.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* Copyright (C) 2007 Korea Information Security Agency (KISA).
*/

#include <crypto/algapi.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/crypto.h>
#include <asm/byteorder.h>

#define SEED_NUM_KCONSTANTS 16
Expand Down
2 changes: 1 addition & 1 deletion crypto/serpent_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
* Copyright (C) 2002 Dag Arne Osvik <[email protected]>
*/

#include <crypto/algapi.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <asm/unaligned.h>
#include <linux/crypto.h>
#include <linux/types.h>
#include <crypto/serpent.h>

Expand Down
2 changes: 1 addition & 1 deletion crypto/sm4_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
* All rights reserved.
*/

#include <crypto/algapi.h>
#include <crypto/sm4.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/crypto.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>

Expand Down
2 changes: 1 addition & 1 deletion crypto/tea.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* Copyright (c) 2004 Aaron Grothe [email protected]
*/

#include <crypto/algapi.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <asm/byteorder.h>
#include <linux/crypto.h>
#include <linux/types.h>

#define TEA_KEY_SIZE 16
Expand Down
2 changes: 1 addition & 1 deletion crypto/twofish_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
* Third Edition.
*/

#include <crypto/algapi.h>
#include <crypto/twofish.h>
#include <linux/bitops.h>
#include <linux/crypto.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/kernel.h>
Expand Down
2 changes: 1 addition & 1 deletion crypto/twofish_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
*/

#include <asm/unaligned.h>
#include <crypto/algapi.h>
#include <crypto/twofish.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/crypto.h>
#include <linux/bitops.h>

/* Macros to compute the g() function in the encryption and decryption
Expand Down
2 changes: 1 addition & 1 deletion drivers/crypto/nx/nx-842.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#ifndef __NX_842_H__
#define __NX_842_H__

#include <crypto/algapi.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/crypto.h>
#include <linux/of.h>
#include <linux/slab.h>
#include <linux/io.h>
Expand Down
2 changes: 1 addition & 1 deletion include/crypto/aria.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
#ifndef _CRYPTO_ARIA_H
#define _CRYPTO_ARIA_H

#include <crypto/algapi.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/crypto.h>
#include <asm/byteorder.h>

#define ARIA_MIN_KEY_SIZE 16
Expand Down
2 changes: 2 additions & 0 deletions include/crypto/internal/acompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
*/
#ifndef _CRYPTO_ACOMP_INT_H
#define _CRYPTO_ACOMP_INT_H

#include <crypto/acompress.h>
#include <crypto/algapi.h>

/*
* Transform internal helpers.
Expand Down
3 changes: 2 additions & 1 deletion include/crypto/internal/scompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
*/
#ifndef _CRYPTO_SCOMP_INT_H
#define _CRYPTO_SCOMP_INT_H
#include <linux/crypto.h>

#include <crypto/algapi.h>

#define SCOMP_SCRATCH_SIZE 131072

Expand Down

0 comments on commit 14386d4

Please sign in to comment.