Lines Matching refs:rctx
150 struct qce_sha_reqctx *rctx = ahash_request_ctx(req); in qce_setup_regs_ahash() local
161 if (!rctx->last_blk && req->nbytes % blocksize) in qce_setup_regs_ahash()
166 if (IS_CMAC(rctx->flags)) { in qce_setup_regs_ahash()
174 auth_cfg = qce_auth_cfg(rctx->flags, rctx->authklen, digestsize); in qce_setup_regs_ahash()
177 if (IS_SHA_HMAC(rctx->flags) || IS_CMAC(rctx->flags)) { in qce_setup_regs_ahash()
178 u32 authkey_words = rctx->authklen / sizeof(u32); in qce_setup_regs_ahash()
180 qce_cpu_to_be32p_array(mackey, rctx->authkey, rctx->authklen); in qce_setup_regs_ahash()
185 if (IS_CMAC(rctx->flags)) in qce_setup_regs_ahash()
188 if (rctx->first_blk) in qce_setup_regs_ahash()
189 memcpy(auth, rctx->digest, digestsize); in qce_setup_regs_ahash()
191 qce_cpu_to_be32p_array(auth, rctx->digest, digestsize); in qce_setup_regs_ahash()
193 iv_words = (IS_SHA1(rctx->flags) || IS_SHA1_HMAC(rctx->flags)) ? 5 : 8; in qce_setup_regs_ahash()
196 if (rctx->first_blk) in qce_setup_regs_ahash()
200 (u32 *)rctx->byte_count, 2); in qce_setup_regs_ahash()
202 auth_cfg = qce_auth_cfg(rctx->flags, 0, digestsize); in qce_setup_regs_ahash()
204 if (rctx->last_blk) in qce_setup_regs_ahash()
209 if (rctx->first_blk) in qce_setup_regs_ahash()
316 struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); in qce_setup_regs_skcipher() local
325 unsigned int ivsize = rctx->ivsize; in qce_setup_regs_skcipher()
326 unsigned long flags = rctx->flags; in qce_setup_regs_skcipher()
351 rctx->cryptlen); in qce_setup_regs_skcipher()
361 qce_xts_swapiv(enciv, rctx->iv, ivsize); in qce_setup_regs_skcipher()
363 qce_cpu_to_be32p_array(enciv, rctx->iv, ivsize); in qce_setup_regs_skcipher()
372 qce_write(qce, REG_ENCR_SEG_SIZE, rctx->cryptlen); in qce_setup_regs_skcipher()
382 qce_write(qce, REG_SEG_SIZE, rctx->cryptlen); in qce_setup_regs_skcipher()
422 struct qce_aead_reqctx *rctx = aead_request_ctx(req); in qce_setup_regs_aead() local
433 unsigned int enc_ivsize = rctx->ivsize; in qce_setup_regs_aead()
437 unsigned long flags = rctx->flags; in qce_setup_regs_aead()
448 enciv_words = qce_be32_to_cpu_array(enciv, rctx->iv, enc_ivsize); in qce_setup_regs_aead()
451 if (IS_CCM(rctx->flags)) { in qce_setup_regs_aead()
473 if (IS_SHA_HMAC(rctx->flags)) { in qce_setup_regs_aead()
475 if (IS_SHA1_HMAC(rctx->flags)) { in qce_setup_regs_aead()
478 } else if (IS_SHA256_HMAC(rctx->flags)) { in qce_setup_regs_aead()
484 } else if (IS_CCM(rctx->flags)) { in qce_setup_regs_aead()
486 authnonce_words = qce_be32_to_cpu_array(authnonce, rctx->ccm_nonce, QCE_MAX_NONCE); in qce_setup_regs_aead()
497 auth_cfg = qce_auth_cfg(rctx->flags, auth_keylen, ctx->authsize); in qce_setup_regs_aead()
501 if (IS_CCM(rctx->flags)) in qce_setup_regs_aead()
506 if (IS_CCM(rctx->flags)) in qce_setup_regs_aead()
513 totallen = rctx->cryptlen + rctx->assoclen; in qce_setup_regs_aead()
516 if (IS_CCM(rctx->flags) && IS_DECRYPT(rctx->flags)) in qce_setup_regs_aead()
517 qce_write(qce, REG_ENCR_SEG_SIZE, rctx->cryptlen + ctx->authsize); in qce_setup_regs_aead()
519 qce_write(qce, REG_ENCR_SEG_SIZE, rctx->cryptlen); in qce_setup_regs_aead()
520 qce_write(qce, REG_ENCR_SEG_START, rctx->assoclen & 0xffff); in qce_setup_regs_aead()
527 if (IS_CCM(rctx->flags) && IS_DECRYPT(rctx->flags)) in qce_setup_regs_aead()