1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
12 #define QCE_MAX_KEY_SIZE 64
14 struct qce_cipher_ctx
{
15 u8 enc_key
[QCE_MAX_KEY_SIZE
];
16 unsigned int enc_keylen
;
17 struct crypto_sync_skcipher
*fallback
;
21 * struct qce_cipher_reqctx - holds private cipher objects per request
22 * @flags: operation flags
23 * @iv: pointer to the IV
25 * @src_nents: source entries
26 * @dst_nents: destination entries
27 * @result_sg: scatterlist used for result buffer
28 * @dst_tbl: destination sg table
29 * @dst_sg: destination sg pointer table beginning
30 * @src_tbl: source sg table
31 * @src_sg: source sg pointer table beginning;
32 * @cryptlen: crypto length
34 struct qce_cipher_reqctx
{
40 struct scatterlist result_sg
;
41 struct sg_table dst_tbl
;
42 struct scatterlist
*dst_sg
;
43 struct sg_table src_tbl
;
44 struct scatterlist
*src_sg
;
45 unsigned int cryptlen
;
48 static inline struct qce_alg_template
*to_cipher_tmpl(struct crypto_skcipher
*tfm
)
50 struct skcipher_alg
*alg
= crypto_skcipher_alg(tfm
);
51 return container_of(alg
, struct qce_alg_template
, alg
.skcipher
);
54 extern const struct qce_algo_ops skcipher_ops
;
56 #endif /* _CIPHER_H_ */