/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.3*/45#ifndef _CIPHER_H_6#define _CIPHER_H_78#include "common.h"9#include "core.h"1011#define QCE_MAX_KEY_SIZE 641213struct qce_cipher_ctx {14u8 enc_key[QCE_MAX_KEY_SIZE];15unsigned int enc_keylen;16struct crypto_skcipher *fallback;17};1819/**20* struct qce_cipher_reqctx - holds private cipher objects per request21* @flags: operation flags22* @iv: pointer to the IV23* @ivsize: IV size24* @src_nents: source entries25* @dst_nents: destination entries26* @result_sg: scatterlist used for result buffer27* @dst_tbl: destination sg table28* @dst_sg: destination sg pointer table beginning29* @src_tbl: source sg table30* @src_sg: source sg pointer table beginning;31* @cryptlen: crypto length32*/33struct qce_cipher_reqctx {34unsigned long flags;35u8 *iv;36unsigned int ivsize;37int src_nents;38int dst_nents;39struct scatterlist result_sg;40struct sg_table dst_tbl;41struct scatterlist *dst_sg;42struct scatterlist *src_sg;43unsigned int cryptlen;44struct skcipher_request fallback_req; // keep at the end45};4647static inline struct qce_alg_template *to_cipher_tmpl(struct crypto_skcipher *tfm)48{49struct skcipher_alg *alg = crypto_skcipher_alg(tfm);50return container_of(alg, struct qce_alg_template, alg.skcipher);51}5253extern const struct qce_algo_ops skcipher_ops;5455#endif /* _CIPHER_H_ */565758