Lines Matching refs:cipher
155 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in spu_skcipher_rx_sg_create()
220 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in spu_skcipher_tx_sg_create()
325 cipher_parms.alg = ctx->cipher.alg; in handle_skcipher_req()
326 cipher_parms.mode = ctx->cipher.mode; in handle_skcipher_req()
351 if ((ctx->cipher.mode == CIPHER_MODE_CBC) && in handle_skcipher_req()
367 if ((ctx->cipher.mode == CIPHER_MODE_CBC) && in handle_skcipher_req()
376 } else if (ctx->cipher.mode == CIPHER_MODE_CTR) { in handle_skcipher_req()
436 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_skcipher_req()
450 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_skcipher_req()
486 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_skcipher_resp()
502 &iproc_priv.cipher_cnt[ctx->cipher.alg][ctx->cipher.mode]); in handle_skcipher_resp()
834 data_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, chunksize); in handle_ahash_req()
1059 data_padlen = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1063 data_padlen = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1065 assoc_buf_len = spu->spu_assoc_resp_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1070 if (ctx->cipher.mode == CIPHER_MODE_CCM) in spu_aead_rx_sg_create()
1301 cipher_parms.alg = ctx->cipher.alg; in handle_aead_req()
1302 cipher_parms.mode = ctx->cipher.mode; in handle_aead_req()
1354 if (spu->spu_assoc_resp_len(ctx->cipher.mode, in handle_aead_req()
1360 aead_parms.iv_len = spu->spu_aead_ivlen(ctx->cipher.mode, in handle_aead_req()
1367 aead_parms.aad_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1371 aead_parms.data_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1374 if (ctx->cipher.mode == CIPHER_MODE_CCM) { in handle_aead_req()
1380 ctx->cipher.mode, in handle_aead_req()
1389 spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1406 ctx->cipher.mode, in handle_aead_req()
1411 ctx->cipher.mode, in handle_aead_req()
1417 if (spu_req_incl_icv(ctx->cipher.mode, rctx->is_encrypt)) { in handle_aead_req()
1483 if (((ctx->cipher.mode == CIPHER_MODE_GCM) || in handle_aead_req()
1484 (ctx->cipher.mode == CIPHER_MODE_CCM)) && !rctx->is_encrypt) { in handle_aead_req()
1570 if (ctx->cipher.alg == CIPHER_ALG_AES) { in handle_aead_resp()
1571 if (ctx->cipher.mode == CIPHER_MODE_CCM) in handle_aead_resp()
1573 else if (ctx->cipher.mode == CIPHER_MODE_GCM) in handle_aead_resp()
1741 if (ctx->cipher.mode == CIPHER_MODE_CBC || in skcipher_enqueue()
1742 ctx->cipher.mode == CIPHER_MODE_CTR || in skcipher_enqueue()
1743 ctx->cipher.mode == CIPHER_MODE_OFB || in skcipher_enqueue()
1744 ctx->cipher.mode == CIPHER_MODE_XTS || in skcipher_enqueue()
1745 ctx->cipher.mode == CIPHER_MODE_GCM || in skcipher_enqueue()
1746 ctx->cipher.mode == CIPHER_MODE_CCM) { in skcipher_enqueue()
1764 static int des_setkey(struct crypto_skcipher *cipher, const u8 *key, in des_setkey() argument
1767 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in des_setkey()
1770 err = verify_skcipher_des_key(cipher, key); in des_setkey()
1778 static int threedes_setkey(struct crypto_skcipher *cipher, const u8 *key, in threedes_setkey() argument
1781 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in threedes_setkey()
1784 err = verify_skcipher_des3_key(cipher, key); in threedes_setkey()
1792 static int aes_setkey(struct crypto_skcipher *cipher, const u8 *key, in aes_setkey() argument
1795 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in aes_setkey()
1797 if (ctx->cipher.mode == CIPHER_MODE_XTS) in aes_setkey()
1819 static int skcipher_setkey(struct crypto_skcipher *cipher, const u8 *key, in skcipher_setkey() argument
1823 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in skcipher_setkey()
1831 switch (ctx->cipher.alg) { in skcipher_setkey()
1833 err = des_setkey(cipher, key, keylen); in skcipher_setkey()
1836 err = threedes_setkey(cipher, key, keylen); in skcipher_setkey()
1839 err = aes_setkey(cipher, key, keylen); in skcipher_setkey()
1852 if ((ctx->cipher.alg == CIPHER_ALG_AES) && in skcipher_setkey()
1853 (ctx->cipher.mode == CIPHER_MODE_XTS)) { in skcipher_setkey()
1866 cipher_parms.iv_len = crypto_skcipher_ivsize(cipher); in skcipher_setkey()
1869 cipher_parms.alg = ctx->cipher.alg; in skcipher_setkey()
1870 cipher_parms.mode = ctx->cipher.mode; in skcipher_setkey()
2516 if (((ctx->cipher.mode == CIPHER_MODE_GCM) || in aead_need_fallback()
2517 (ctx->cipher.mode == CIPHER_MODE_CCM)) && in aead_need_fallback()
2527 if ((ctx->cipher.mode == CIPHER_MODE_CCM) && in aead_need_fallback()
2540 if ((ctx->cipher.mode == CIPHER_MODE_CCM) && in aead_need_fallback()
2552 if (ctx->cipher.mode == CIPHER_MODE_GCM && in aead_need_fallback()
2553 ctx->cipher.alg == CIPHER_ALG_AES && in aead_need_fallback()
2698 if (ctx->cipher.mode == CIPHER_MODE_CBC || in aead_enqueue()
2699 ctx->cipher.mode == CIPHER_MODE_CTR || in aead_enqueue()
2700 ctx->cipher.mode == CIPHER_MODE_OFB || in aead_enqueue()
2701 ctx->cipher.mode == CIPHER_MODE_XTS || in aead_enqueue()
2702 ctx->cipher.mode == CIPHER_MODE_GCM) { in aead_enqueue()
2706 } else if (ctx->cipher.mode == CIPHER_MODE_CCM) { in aead_enqueue()
2756 static int aead_authenc_setkey(struct crypto_aead *cipher, in aead_authenc_setkey() argument
2760 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_authenc_setkey()
2761 struct crypto_tfm *tfm = crypto_aead_tfm(cipher); in aead_authenc_setkey()
2765 flow_log("%s() aead:%p key:%p keylen:%u\n", __func__, cipher, key, in aead_authenc_setkey()
2787 if (verify_aead_des_key(cipher, keys.enckey, keys.enckeylen)) in aead_authenc_setkey()
2793 if (verify_aead_des3_key(cipher, keys.enckey, keys.enckeylen)) in aead_authenc_setkey()
2851 static int aead_gcm_ccm_setkey(struct crypto_aead *cipher, in aead_gcm_ccm_setkey() argument
2855 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_gcm_ccm_setkey()
2856 struct crypto_tfm *tfm = crypto_aead_tfm(cipher); in aead_gcm_ccm_setkey()
2933 static int aead_gcm_esp_setkey(struct crypto_aead *cipher, in aead_gcm_esp_setkey() argument
2936 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_gcm_esp_setkey()
2951 return aead_gcm_ccm_setkey(cipher, key, keylen); in aead_gcm_esp_setkey()
2965 static int rfc4543_gcm_esp_setkey(struct crypto_aead *cipher, in rfc4543_gcm_esp_setkey() argument
2968 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in rfc4543_gcm_esp_setkey()
2984 return aead_gcm_ccm_setkey(cipher, key, keylen); in rfc4543_gcm_esp_setkey()
2998 static int aead_ccm_esp_setkey(struct crypto_aead *cipher, in aead_ccm_esp_setkey() argument
3001 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_ccm_esp_setkey()
3015 return aead_gcm_ccm_setkey(cipher, key, keylen); in aead_ccm_esp_setkey()
3018 static int aead_setauthsize(struct crypto_aead *cipher, unsigned int authsize) in aead_setauthsize() argument
3020 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_setauthsize()
4191 ctx->cipher = cipher_alg->cipher_info; in generic_cra_init()
4194 ctx->max_payload = spu->spu_ctx_max_payload(ctx->cipher.alg, in generic_cra_init()
4195 ctx->cipher.mode, in generic_cra_init()