hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/x86/include/asm/crypto/glue_helper.h
....@@ -11,17 +11,12 @@
1111 #include <asm/fpu/api.h>
1212 #include <crypto/b128ops.h>
1313
14
-typedef void (*common_glue_func_t)(void *ctx, u8 *dst, const u8 *src);
15
-typedef void (*common_glue_cbc_func_t)(void *ctx, u128 *dst, const u128 *src);
16
-typedef void (*common_glue_ctr_func_t)(void *ctx, u128 *dst, const u128 *src,
14
+typedef void (*common_glue_func_t)(const void *ctx, u8 *dst, const u8 *src);
15
+typedef void (*common_glue_cbc_func_t)(const void *ctx, u8 *dst, const u8 *src);
16
+typedef void (*common_glue_ctr_func_t)(const void *ctx, u8 *dst, const u8 *src,
1717 le128 *iv);
18
-typedef void (*common_glue_xts_func_t)(void *ctx, u128 *dst, const u128 *src,
18
+typedef void (*common_glue_xts_func_t)(const void *ctx, u8 *dst, const u8 *src,
1919 le128 *iv);
20
-
21
-#define GLUE_FUNC_CAST(fn) ((common_glue_func_t)(fn))
22
-#define GLUE_CBC_FUNC_CAST(fn) ((common_glue_cbc_func_t)(fn))
23
-#define GLUE_CTR_FUNC_CAST(fn) ((common_glue_ctr_func_t)(fn))
24
-#define GLUE_XTS_FUNC_CAST(fn) ((common_glue_xts_func_t)(fn))
2520
2621 struct common_glue_func_entry {
2722 unsigned int num_blocks; /* number of blocks that @fn will process */
....@@ -114,9 +109,10 @@
114109 extern int glue_xts_req_128bit(const struct common_glue_ctx *gctx,
115110 struct skcipher_request *req,
116111 common_glue_func_t tweak_fn, void *tweak_ctx,
117
- void *crypt_ctx);
112
+ void *crypt_ctx, bool decrypt);
118113
119
-extern void glue_xts_crypt_128bit_one(void *ctx, u128 *dst, const u128 *src,
120
- le128 *iv, common_glue_func_t fn);
114
+extern void glue_xts_crypt_128bit_one(const void *ctx, u8 *dst,
115
+ const u8 *src, le128 *iv,
116
+ common_glue_func_t fn);
121117
122118 #endif /* _CRYPTO_GLUE_HELPER_H */