Lines Matching refs:rctx
72 struct rk_cipher_rctx *rctx = skcipher_request_ctx(areq); in rk_cipher_fallback() local
79 skcipher_request_set_tfm(&rctx->fallback_req, op->fallback_tfm); in rk_cipher_fallback()
80 skcipher_request_set_callback(&rctx->fallback_req, areq->base.flags, in rk_cipher_fallback()
82 skcipher_request_set_crypt(&rctx->fallback_req, areq->src, areq->dst, in rk_cipher_fallback()
84 if (rctx->mode & RK_CRYPTO_DEC) in rk_cipher_fallback()
85 err = crypto_skcipher_decrypt(&rctx->fallback_req); in rk_cipher_fallback()
87 err = crypto_skcipher_encrypt(&rctx->fallback_req); in rk_cipher_fallback()
93 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_cipher_handle_req() local
103 rctx->dev = rkc; in rk_cipher_handle_req()
157 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_aes_ecb_encrypt() local
159 rctx->mode = RK_CRYPTO_AES_ECB_MODE; in rk_aes_ecb_encrypt()
165 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_aes_ecb_decrypt() local
167 rctx->mode = RK_CRYPTO_AES_ECB_MODE | RK_CRYPTO_DEC; in rk_aes_ecb_decrypt()
173 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_aes_cbc_encrypt() local
175 rctx->mode = RK_CRYPTO_AES_CBC_MODE; in rk_aes_cbc_encrypt()
181 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_aes_cbc_decrypt() local
183 rctx->mode = RK_CRYPTO_AES_CBC_MODE | RK_CRYPTO_DEC; in rk_aes_cbc_decrypt()
189 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_des_ecb_encrypt() local
191 rctx->mode = 0; in rk_des_ecb_encrypt()
197 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_des_ecb_decrypt() local
199 rctx->mode = RK_CRYPTO_DEC; in rk_des_ecb_decrypt()
205 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_des_cbc_encrypt() local
207 rctx->mode = RK_CRYPTO_TDES_CHAINMODE_CBC; in rk_des_cbc_encrypt()
213 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_des_cbc_decrypt() local
215 rctx->mode = RK_CRYPTO_TDES_CHAINMODE_CBC | RK_CRYPTO_DEC; in rk_des_cbc_decrypt()
221 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_des3_ede_ecb_encrypt() local
223 rctx->mode = RK_CRYPTO_TDES_SELECT; in rk_des3_ede_ecb_encrypt()
229 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_des3_ede_ecb_decrypt() local
231 rctx->mode = RK_CRYPTO_TDES_SELECT | RK_CRYPTO_DEC; in rk_des3_ede_ecb_decrypt()
237 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_des3_ede_cbc_encrypt() local
239 rctx->mode = RK_CRYPTO_TDES_SELECT | RK_CRYPTO_TDES_CHAINMODE_CBC; in rk_des3_ede_cbc_encrypt()
245 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_des3_ede_cbc_decrypt() local
247 rctx->mode = RK_CRYPTO_TDES_SELECT | RK_CRYPTO_TDES_CHAINMODE_CBC | in rk_des3_ede_cbc_decrypt()
256 struct rk_cipher_rctx *rctx = skcipher_request_ctx(req); in rk_cipher_hw_init() local
263 rctx->mode |= RK_CRYPTO_TDES_FIFO_MODE | in rk_cipher_hw_init()
266 CRYPTO_WRITE(dev, RK_CRYPTO_TDES_CTRL, rctx->mode); in rk_cipher_hw_init()
270 rctx->mode |= RK_CRYPTO_AES_FIFO_MODE | in rk_cipher_hw_init()
275 rctx->mode |= RK_CRYPTO_AES_192BIT_key; in rk_cipher_hw_init()
277 rctx->mode |= RK_CRYPTO_AES_256BIT_key; in rk_cipher_hw_init()
278 CRYPTO_WRITE(dev, RK_CRYPTO_AES_CTRL, rctx->mode); in rk_cipher_hw_init()
303 struct rk_cipher_rctx *rctx = skcipher_request_ctx(areq); in rk_cipher_run() local
315 struct rk_crypto_info *rkc = rctx->dev; in rk_cipher_run()
326 if (rctx->mode & RK_CRYPTO_DEC) { in rk_cipher_run()
328 scatterwalk_map_and_copy(rctx->backup_iv, areq->src, in rk_cipher_run()
342 if (rctx->mode & RK_CRYPTO_DEC) { in rk_cipher_run()
392 if (rctx->mode & RK_CRYPTO_DEC) { in rk_cipher_run()
406 if (rctx->mode & RK_CRYPTO_DEC) { in rk_cipher_run()
407 memcpy(areq->iv, rctx->backup_iv, ivsize); in rk_cipher_run()
408 memzero_explicit(rctx->backup_iv, ivsize); in rk_cipher_run()