0001
0002
0003
0004
0005
0006 #ifndef _CIPHER_H_
0007 #define _CIPHER_H_
0008
0009 #include "common.h"
0010 #include "core.h"
0011
0012 #define QCE_MAX_KEY_SIZE 64
0013
0014 struct qce_cipher_ctx {
0015 u8 enc_key[QCE_MAX_KEY_SIZE];
0016 unsigned int enc_keylen;
0017 struct crypto_skcipher *fallback;
0018 };
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 struct qce_cipher_reqctx {
0035 unsigned long flags;
0036 u8 *iv;
0037 unsigned int ivsize;
0038 int src_nents;
0039 int dst_nents;
0040 struct scatterlist result_sg;
0041 struct sg_table dst_tbl;
0042 struct scatterlist *dst_sg;
0043 struct scatterlist *src_sg;
0044 unsigned int cryptlen;
0045 struct skcipher_request fallback_req;
0046 };
0047
0048 static inline struct qce_alg_template *to_cipher_tmpl(struct crypto_skcipher *tfm)
0049 {
0050 struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
0051 return container_of(alg, struct qce_alg_template, alg.skcipher);
0052 }
0053
0054 extern const struct qce_algo_ops skcipher_ops;
0055
0056 #endif