Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Copyright (c) 2002 David S. Miller (davem@redhat.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (c) 2005 Herbert Xu <herbert@gondor.apana.org.au>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * Portions derived from Cryptoapi, by Alexander Kjeldaas <astor@fast.no>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * and Nettle, by Niels Möller.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #ifndef _CRYPTO_INTERNAL_CIPHER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #define _CRYPTO_INTERNAL_CIPHER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <crypto/algapi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) struct crypto_cipher {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 	struct crypto_tfm base;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * DOC: Single Block Cipher API
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  * The single block cipher API is used with the ciphers of type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  * CRYPTO_ALG_TYPE_CIPHER (listed as type "cipher" in /proc/crypto).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * Using the single block cipher API calls, operations with the basic cipher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  * primitive can be implemented. These cipher primitives exclude any block
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  * chaining operations including IV handling.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  * The purpose of this single block cipher API is to support the implementation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  * of templates or other concepts that only need to perform the cipher operation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  * on one block at a time. Templates invoke the underlying cipher primitive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  * block-wise and process either the input or the output data of these cipher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  * operations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) static inline struct crypto_cipher *__crypto_cipher_cast(struct crypto_tfm *tfm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	return (struct crypto_cipher *)tfm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  * crypto_alloc_cipher() - allocate single block cipher handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  * @alg_name: is the cra_name / name or cra_driver_name / driver name of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  *	     single block cipher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)  * @type: specifies the type of the cipher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)  * @mask: specifies the mask for the cipher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)  * Allocate a cipher handle for a single block cipher. The returned struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50)  * crypto_cipher is the cipher handle that is required for any subsequent API
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51)  * invocation for that single block cipher.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)  * Return: allocated cipher handle in case of success; IS_ERR() is true in case
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)  *	   of an error, PTR_ERR() returns the error code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) static inline struct crypto_cipher *crypto_alloc_cipher(const char *alg_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 							u32 type, u32 mask)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	type &= ~CRYPTO_ALG_TYPE_MASK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	type |= CRYPTO_ALG_TYPE_CIPHER;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	mask |= CRYPTO_ALG_TYPE_MASK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	return __crypto_cipher_cast(crypto_alloc_base(alg_name, type, mask));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) static inline struct crypto_tfm *crypto_cipher_tfm(struct crypto_cipher *tfm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	return &tfm->base;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72)  * crypto_free_cipher() - zeroize and free the single block cipher handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)  * @tfm: cipher handle to be freed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) static inline void crypto_free_cipher(struct crypto_cipher *tfm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	crypto_free_tfm(crypto_cipher_tfm(tfm));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)  * crypto_has_cipher() - Search for the availability of a single block cipher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)  * @alg_name: is the cra_name / name or cra_driver_name / driver name of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)  *	     single block cipher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)  * @type: specifies the type of the cipher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)  * @mask: specifies the mask for the cipher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)  * Return: true when the single block cipher is known to the kernel crypto API;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)  *	   false otherwise
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) static inline int crypto_has_cipher(const char *alg_name, u32 type, u32 mask)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	type &= ~CRYPTO_ALG_TYPE_MASK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	type |= CRYPTO_ALG_TYPE_CIPHER;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	mask |= CRYPTO_ALG_TYPE_MASK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	return crypto_has_alg(alg_name, type, mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)  * crypto_cipher_blocksize() - obtain block size for cipher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)  * @tfm: cipher handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)  * The block size for the single block cipher referenced with the cipher handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)  * tfm is returned. The caller may use that information to allocate appropriate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)  * memory for the data returned by the encryption or decryption operation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)  * Return: block size of cipher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) static inline unsigned int crypto_cipher_blocksize(struct crypto_cipher *tfm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	return crypto_tfm_alg_blocksize(crypto_cipher_tfm(tfm));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) static inline unsigned int crypto_cipher_alignmask(struct crypto_cipher *tfm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	return crypto_tfm_alg_alignmask(crypto_cipher_tfm(tfm));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) static inline u32 crypto_cipher_get_flags(struct crypto_cipher *tfm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	return crypto_tfm_get_flags(crypto_cipher_tfm(tfm));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) static inline void crypto_cipher_set_flags(struct crypto_cipher *tfm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 					   u32 flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	crypto_tfm_set_flags(crypto_cipher_tfm(tfm), flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) static inline void crypto_cipher_clear_flags(struct crypto_cipher *tfm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 					     u32 flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	crypto_tfm_clear_flags(crypto_cipher_tfm(tfm), flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)  * crypto_cipher_setkey() - set key for cipher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)  * @tfm: cipher handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)  * @key: buffer holding the key
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)  * @keylen: length of the key in bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)  * The caller provided key is set for the single block cipher referenced by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)  * cipher handle.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)  * Note, the key length determines the cipher type. Many block ciphers implement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)  * different cipher modes depending on the key size, such as AES-128 vs AES-192
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)  * vs. AES-256. When providing a 16 byte key for an AES cipher handle, AES-128
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)  * is performed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)  * Return: 0 if the setting of the key was successful; < 0 if an error occurred
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) int crypto_cipher_setkey(struct crypto_cipher *tfm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 			 const u8 *key, unsigned int keylen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)  * crypto_cipher_encrypt_one() - encrypt one block of plaintext
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)  * @tfm: cipher handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)  * @dst: points to the buffer that will be filled with the ciphertext
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)  * @src: buffer holding the plaintext to be encrypted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)  * Invoke the encryption operation of one block. The caller must ensure that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)  * the plaintext and ciphertext buffers are at least one block in size.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) void crypto_cipher_encrypt_one(struct crypto_cipher *tfm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 			       u8 *dst, const u8 *src);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)  * crypto_cipher_decrypt_one() - decrypt one block of ciphertext
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)  * @tfm: cipher handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)  * @dst: points to the buffer that will be filled with the plaintext
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)  * @src: buffer holding the ciphertext to be decrypted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)  * Invoke the decryption operation of one block. The caller must ensure that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)  * the plaintext and ciphertext buffers are at least one block in size.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) void crypto_cipher_decrypt_one(struct crypto_cipher *tfm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 			       u8 *dst, const u8 *src);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) struct crypto_cipher_spawn {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	struct crypto_spawn base;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) static inline int crypto_grab_cipher(struct crypto_cipher_spawn *spawn,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 				     struct crypto_instance *inst,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 				     const char *name, u32 type, u32 mask)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	type &= ~CRYPTO_ALG_TYPE_MASK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	type |= CRYPTO_ALG_TYPE_CIPHER;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	mask |= CRYPTO_ALG_TYPE_MASK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	return crypto_grab_spawn(&spawn->base, inst, name, type, mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) static inline void crypto_drop_cipher(struct crypto_cipher_spawn *spawn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	crypto_drop_spawn(&spawn->base);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) static inline struct crypto_alg *crypto_spawn_cipher_alg(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)        struct crypto_cipher_spawn *spawn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	return spawn->base.alg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) static inline struct crypto_cipher *crypto_spawn_cipher(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	struct crypto_cipher_spawn *spawn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	u32 type = CRYPTO_ALG_TYPE_CIPHER;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	u32 mask = CRYPTO_ALG_TYPE_MASK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	return __crypto_cipher_cast(crypto_spawn_tfm(&spawn->base, type, mask));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) static inline struct cipher_alg *crypto_cipher_alg(struct crypto_cipher *tfm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	return &crypto_cipher_tfm(tfm)->__crt_alg->cra_cipher;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) #endif