Lines Matching refs:req
1439 static int hifn_cipher_walk(struct skcipher_request *req,
1443 unsigned int nbytes = req->cryptlen, offset, copy, diff;
1452 dst = &req->dst[idx];
1502 dst = &req->dst[idx];
1524 static int hifn_setup_session(struct skcipher_request *req)
1526 struct hifn_context *ctx = crypto_tfm_ctx(req->base.tfm);
1527 struct hifn_request_context *rctx = skcipher_request_ctx(req);
1530 unsigned int nbytes = req->cryptlen, idx = 0;
1540 dst = &req->dst[idx];
1557 sg_num = hifn_cipher_walk(req, &rctx->walk);
1569 err = hifn_setup_dma(dev, ctx, rctx, req->src, req->dst, req->cryptlen, req);
1666 static void hifn_process_ready(struct skcipher_request *req, int error)
1668 struct hifn_request_context *rctx = skcipher_request_ctx(req);
1671 unsigned int nbytes = req->cryptlen;
1678 dst = &req->dst[idx];
1708 req->base.complete(&req->base, error);
1916 struct skcipher_request *req;
1932 req = skcipher_request_cast(async_req);
1935 hifn_process_ready(req, -ENODEV);
1980 static int hifn_handle_req(struct skcipher_request *req)
1982 struct hifn_context *ctx = crypto_tfm_ctx(req->base.tfm);
1986 if (dev->started + DIV_ROUND_UP(req->cryptlen, PAGE_SIZE) <= HIFN_QUEUE_LENGTH)
1987 err = hifn_setup_session(req);
1993 err = crypto_enqueue_request(&dev->queue, &req->base);
2000 static int hifn_setup_crypto_req(struct skcipher_request *req, u8 op,
2003 struct hifn_context *ctx = crypto_tfm_ctx(req->base.tfm);
2004 struct hifn_request_context *rctx = skcipher_request_ctx(req);
2007 ivsize = crypto_skcipher_ivsize(crypto_skcipher_reqtfm(req));
2009 if (req->iv && mode != ACRYPTO_MODE_ECB) {
2028 rctx->iv = req->iv;
2037 return hifn_handle_req(req);
2043 struct skcipher_request *req;
2059 req = skcipher_request_cast(async_req);
2061 err = hifn_handle_req(req);
2069 static int hifn_setup_crypto(struct skcipher_request *req, u8 op,
2073 struct hifn_context *ctx = crypto_tfm_ctx(req->base.tfm);
2076 err = hifn_setup_crypto_req(req, op, type, mode);
2089 static inline int hifn_encrypt_aes_ecb(struct skcipher_request *req)
2091 return hifn_setup_crypto(req, ACRYPTO_OP_ENCRYPT,
2094 static inline int hifn_encrypt_aes_cbc(struct skcipher_request *req)
2096 return hifn_setup_crypto(req, ACRYPTO_OP_ENCRYPT,
2099 static inline int hifn_encrypt_aes_cfb(struct skcipher_request *req)
2101 return hifn_setup_crypto(req, ACRYPTO_OP_ENCRYPT,
2104 static inline int hifn_encrypt_aes_ofb(struct skcipher_request *req)
2106 return hifn_setup_crypto(req, ACRYPTO_OP_ENCRYPT,
2113 static inline int hifn_decrypt_aes_ecb(struct skcipher_request *req)
2115 return hifn_setup_crypto(req, ACRYPTO_OP_DECRYPT,
2118 static inline int hifn_decrypt_aes_cbc(struct skcipher_request *req)
2120 return hifn_setup_crypto(req, ACRYPTO_OP_DECRYPT,
2123 static inline int hifn_decrypt_aes_cfb(struct skcipher_request *req)
2125 return hifn_setup_crypto(req, ACRYPTO_OP_DECRYPT,
2128 static inline int hifn_decrypt_aes_ofb(struct skcipher_request *req)
2130 return hifn_setup_crypto(req, ACRYPTO_OP_DECRYPT,
2137 static inline int hifn_encrypt_des_ecb(struct skcipher_request *req)
2139 return hifn_setup_crypto(req, ACRYPTO_OP_ENCRYPT,
2142 static inline int hifn_encrypt_des_cbc(struct skcipher_request *req)
2144 return hifn_setup_crypto(req, ACRYPTO_OP_ENCRYPT,
2147 static inline int hifn_encrypt_des_cfb(struct skcipher_request *req)
2149 return hifn_setup_crypto(req, ACRYPTO_OP_ENCRYPT,
2152 static inline int hifn_encrypt_des_ofb(struct skcipher_request *req)
2154 return hifn_setup_crypto(req, ACRYPTO_OP_ENCRYPT,
2161 static inline int hifn_decrypt_des_ecb(struct skcipher_request *req)
2163 return hifn_setup_crypto(req, ACRYPTO_OP_DECRYPT,
2166 static inline int hifn_decrypt_des_cbc(struct skcipher_request *req)
2168 return hifn_setup_crypto(req, ACRYPTO_OP_DECRYPT,
2171 static inline int hifn_decrypt_des_cfb(struct skcipher_request *req)
2173 return hifn_setup_crypto(req, ACRYPTO_OP_DECRYPT,
2176 static inline int hifn_decrypt_des_ofb(struct skcipher_request *req)
2178 return hifn_setup_crypto(req, ACRYPTO_OP_DECRYPT,
2185 static inline int hifn_encrypt_3des_ecb(struct skcipher_request *req)
2187 return hifn_setup_crypto(req, ACRYPTO_OP_ENCRYPT,
2190 static inline int hifn_encrypt_3des_cbc(struct skcipher_request *req)
2192 return hifn_setup_crypto(req, ACRYPTO_OP_ENCRYPT,
2195 static inline int hifn_encrypt_3des_cfb(struct skcipher_request *req)
2197 return hifn_setup_crypto(req, ACRYPTO_OP_ENCRYPT,
2200 static inline int hifn_encrypt_3des_ofb(struct skcipher_request *req)
2202 return hifn_setup_crypto(req, ACRYPTO_OP_ENCRYPT,
2207 static inline int hifn_decrypt_3des_ecb(struct skcipher_request *req)
2209 return hifn_setup_crypto(req, ACRYPTO_OP_DECRYPT,
2212 static inline int hifn_decrypt_3des_cbc(struct skcipher_request *req)
2214 return hifn_setup_crypto(req, ACRYPTO_OP_DECRYPT,
2217 static inline int hifn_decrypt_3des_cfb(struct skcipher_request *req)
2219 return hifn_setup_crypto(req, ACRYPTO_OP_DECRYPT,
2222 static inline int hifn_decrypt_3des_ofb(struct skcipher_request *req)
2224 return hifn_setup_crypto(req, ACRYPTO_OP_DECRYPT,