Lines Matching refs:cipher
154 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in spu_skcipher_rx_sg_create()
219 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in spu_skcipher_tx_sg_create()
324 cipher_parms.alg = ctx->cipher.alg; in handle_skcipher_req()
325 cipher_parms.mode = ctx->cipher.mode; in handle_skcipher_req()
350 if ((ctx->cipher.mode == CIPHER_MODE_CBC) && in handle_skcipher_req()
366 if ((ctx->cipher.mode == CIPHER_MODE_CBC) && in handle_skcipher_req()
375 } else if (ctx->cipher.mode == CIPHER_MODE_CTR) { in handle_skcipher_req()
435 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_skcipher_req()
449 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_skcipher_req()
487 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_skcipher_resp()
503 &iproc_priv.cipher_cnt[ctx->cipher.alg][ctx->cipher.mode]); in handle_skcipher_resp()
835 data_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, chunksize); in handle_ahash_req()
1061 data_padlen = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1065 data_padlen = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1067 assoc_buf_len = spu->spu_assoc_resp_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1072 if (ctx->cipher.mode == CIPHER_MODE_CCM) in spu_aead_rx_sg_create()
1303 cipher_parms.alg = ctx->cipher.alg; in handle_aead_req()
1304 cipher_parms.mode = ctx->cipher.mode; in handle_aead_req()
1356 if (spu->spu_assoc_resp_len(ctx->cipher.mode, in handle_aead_req()
1362 aead_parms.iv_len = spu->spu_aead_ivlen(ctx->cipher.mode, in handle_aead_req()
1369 aead_parms.aad_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1373 aead_parms.data_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1376 if (ctx->cipher.mode == CIPHER_MODE_CCM) { in handle_aead_req()
1382 ctx->cipher.mode, in handle_aead_req()
1391 spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1408 ctx->cipher.mode, in handle_aead_req()
1413 ctx->cipher.mode, in handle_aead_req()
1419 if (spu_req_incl_icv(ctx->cipher.mode, rctx->is_encrypt)) { in handle_aead_req()
1485 if (((ctx->cipher.mode == CIPHER_MODE_GCM) || in handle_aead_req()
1486 (ctx->cipher.mode == CIPHER_MODE_CCM)) && !rctx->is_encrypt) { in handle_aead_req()
1572 if (ctx->cipher.alg == CIPHER_ALG_AES) { in handle_aead_resp()
1573 if (ctx->cipher.mode == CIPHER_MODE_CCM) in handle_aead_resp()
1575 else if (ctx->cipher.mode == CIPHER_MODE_GCM) in handle_aead_resp()
1743 if (ctx->cipher.mode == CIPHER_MODE_CBC || in skcipher_enqueue()
1744 ctx->cipher.mode == CIPHER_MODE_CTR || in skcipher_enqueue()
1745 ctx->cipher.mode == CIPHER_MODE_OFB || in skcipher_enqueue()
1746 ctx->cipher.mode == CIPHER_MODE_XTS || in skcipher_enqueue()
1747 ctx->cipher.mode == CIPHER_MODE_GCM || in skcipher_enqueue()
1748 ctx->cipher.mode == CIPHER_MODE_CCM) { in skcipher_enqueue()
1766 static int des_setkey(struct crypto_skcipher *cipher, const u8 *key, in des_setkey() argument
1769 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in des_setkey()
1772 err = verify_skcipher_des_key(cipher, key); in des_setkey()
1780 static int threedes_setkey(struct crypto_skcipher *cipher, const u8 *key, in threedes_setkey() argument
1783 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in threedes_setkey()
1786 err = verify_skcipher_des3_key(cipher, key); in threedes_setkey()
1794 static int aes_setkey(struct crypto_skcipher *cipher, const u8 *key, in aes_setkey() argument
1797 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in aes_setkey()
1799 if (ctx->cipher.mode == CIPHER_MODE_XTS) in aes_setkey()
1821 static int skcipher_setkey(struct crypto_skcipher *cipher, const u8 *key, in skcipher_setkey() argument
1825 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in skcipher_setkey()
1833 switch (ctx->cipher.alg) { in skcipher_setkey()
1835 err = des_setkey(cipher, key, keylen); in skcipher_setkey()
1838 err = threedes_setkey(cipher, key, keylen); in skcipher_setkey()
1841 err = aes_setkey(cipher, key, keylen); in skcipher_setkey()
1854 if ((ctx->cipher.alg == CIPHER_ALG_AES) && in skcipher_setkey()
1855 (ctx->cipher.mode == CIPHER_MODE_XTS)) { in skcipher_setkey()
1868 cipher_parms.iv_len = crypto_skcipher_ivsize(cipher); in skcipher_setkey()
1871 cipher_parms.alg = ctx->cipher.alg; in skcipher_setkey()
1872 cipher_parms.mode = ctx->cipher.mode; in skcipher_setkey()
2518 if (((ctx->cipher.mode == CIPHER_MODE_GCM) || in aead_need_fallback()
2519 (ctx->cipher.mode == CIPHER_MODE_CCM)) && in aead_need_fallback()
2529 if ((ctx->cipher.mode == CIPHER_MODE_CCM) && in aead_need_fallback()
2542 if ((ctx->cipher.mode == CIPHER_MODE_CCM) && in aead_need_fallback()
2554 if (ctx->cipher.mode == CIPHER_MODE_GCM && in aead_need_fallback()
2555 ctx->cipher.alg == CIPHER_ALG_AES && in aead_need_fallback()
2700 if (ctx->cipher.mode == CIPHER_MODE_CBC || in aead_enqueue()
2701 ctx->cipher.mode == CIPHER_MODE_CTR || in aead_enqueue()
2702 ctx->cipher.mode == CIPHER_MODE_OFB || in aead_enqueue()
2703 ctx->cipher.mode == CIPHER_MODE_XTS || in aead_enqueue()
2704 ctx->cipher.mode == CIPHER_MODE_GCM) { in aead_enqueue()
2708 } else if (ctx->cipher.mode == CIPHER_MODE_CCM) { in aead_enqueue()
2758 static int aead_authenc_setkey(struct crypto_aead *cipher, in aead_authenc_setkey() argument
2762 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_authenc_setkey()
2763 struct crypto_tfm *tfm = crypto_aead_tfm(cipher); in aead_authenc_setkey()
2767 flow_log("%s() aead:%p key:%p keylen:%u\n", __func__, cipher, key, in aead_authenc_setkey()
2789 if (verify_aead_des_key(cipher, keys.enckey, keys.enckeylen)) in aead_authenc_setkey()
2795 if (verify_aead_des3_key(cipher, keys.enckey, keys.enckeylen)) in aead_authenc_setkey()
2853 static int aead_gcm_ccm_setkey(struct crypto_aead *cipher, in aead_gcm_ccm_setkey() argument
2857 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_gcm_ccm_setkey()
2858 struct crypto_tfm *tfm = crypto_aead_tfm(cipher); in aead_gcm_ccm_setkey()
2935 static int aead_gcm_esp_setkey(struct crypto_aead *cipher, in aead_gcm_esp_setkey() argument
2938 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_gcm_esp_setkey()
2953 return aead_gcm_ccm_setkey(cipher, key, keylen); in aead_gcm_esp_setkey()
2967 static int rfc4543_gcm_esp_setkey(struct crypto_aead *cipher, in rfc4543_gcm_esp_setkey() argument
2970 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in rfc4543_gcm_esp_setkey()
2986 return aead_gcm_ccm_setkey(cipher, key, keylen); in rfc4543_gcm_esp_setkey()
3000 static int aead_ccm_esp_setkey(struct crypto_aead *cipher, in aead_ccm_esp_setkey() argument
3003 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_ccm_esp_setkey()
3017 return aead_gcm_ccm_setkey(cipher, key, keylen); in aead_ccm_esp_setkey()
3020 static int aead_setauthsize(struct crypto_aead *cipher, unsigned int authsize) in aead_setauthsize() argument
3022 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_setauthsize()
4193 ctx->cipher = cipher_alg->cipher_info; in generic_cra_init()
4196 ctx->max_payload = spu->spu_ctx_max_payload(ctx->cipher.alg, in generic_cra_init()
4197 ctx->cipher.mode, in generic_cra_init()