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()
485 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_skcipher_resp()
501 &iproc_priv.cipher_cnt[ctx->cipher.alg][ctx->cipher.mode]); in handle_skcipher_resp()
833 data_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, chunksize); in handle_ahash_req()
1058 data_padlen = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1062 data_padlen = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1064 assoc_buf_len = spu->spu_assoc_resp_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1069 if (ctx->cipher.mode == CIPHER_MODE_CCM) in spu_aead_rx_sg_create()
1300 cipher_parms.alg = ctx->cipher.alg; in handle_aead_req()
1301 cipher_parms.mode = ctx->cipher.mode; in handle_aead_req()
1353 if (spu->spu_assoc_resp_len(ctx->cipher.mode, in handle_aead_req()
1359 aead_parms.iv_len = spu->spu_aead_ivlen(ctx->cipher.mode, in handle_aead_req()
1366 aead_parms.aad_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1370 aead_parms.data_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1373 if (ctx->cipher.mode == CIPHER_MODE_CCM) { in handle_aead_req()
1379 ctx->cipher.mode, in handle_aead_req()
1388 spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1405 ctx->cipher.mode, in handle_aead_req()
1410 ctx->cipher.mode, in handle_aead_req()
1416 if (spu_req_incl_icv(ctx->cipher.mode, rctx->is_encrypt)) { in handle_aead_req()
1482 if (((ctx->cipher.mode == CIPHER_MODE_GCM) || in handle_aead_req()
1483 (ctx->cipher.mode == CIPHER_MODE_CCM)) && !rctx->is_encrypt) { in handle_aead_req()
1569 if (ctx->cipher.alg == CIPHER_ALG_AES) { in handle_aead_resp()
1570 if (ctx->cipher.mode == CIPHER_MODE_CCM) in handle_aead_resp()
1572 else if (ctx->cipher.mode == CIPHER_MODE_GCM) in handle_aead_resp()
1740 if (ctx->cipher.mode == CIPHER_MODE_CBC || in skcipher_enqueue()
1741 ctx->cipher.mode == CIPHER_MODE_CTR || in skcipher_enqueue()
1742 ctx->cipher.mode == CIPHER_MODE_OFB || in skcipher_enqueue()
1743 ctx->cipher.mode == CIPHER_MODE_XTS || in skcipher_enqueue()
1744 ctx->cipher.mode == CIPHER_MODE_GCM || in skcipher_enqueue()
1745 ctx->cipher.mode == CIPHER_MODE_CCM) { in skcipher_enqueue()
1763 static int des_setkey(struct crypto_skcipher *cipher, const u8 *key, in des_setkey() argument
1766 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in des_setkey()
1769 err = verify_skcipher_des_key(cipher, key); in des_setkey()
1777 static int threedes_setkey(struct crypto_skcipher *cipher, const u8 *key, in threedes_setkey() argument
1780 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in threedes_setkey()
1783 err = verify_skcipher_des3_key(cipher, key); in threedes_setkey()
1791 static int aes_setkey(struct crypto_skcipher *cipher, const u8 *key, in aes_setkey() argument
1794 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in aes_setkey()
1796 if (ctx->cipher.mode == CIPHER_MODE_XTS) in aes_setkey()
1818 static int skcipher_setkey(struct crypto_skcipher *cipher, const u8 *key, in skcipher_setkey() argument
1822 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in skcipher_setkey()
1830 switch (ctx->cipher.alg) { in skcipher_setkey()
1832 err = des_setkey(cipher, key, keylen); in skcipher_setkey()
1835 err = threedes_setkey(cipher, key, keylen); in skcipher_setkey()
1838 err = aes_setkey(cipher, key, keylen); in skcipher_setkey()
1851 if ((ctx->cipher.alg == CIPHER_ALG_AES) && in skcipher_setkey()
1852 (ctx->cipher.mode == CIPHER_MODE_XTS)) { in skcipher_setkey()
1865 cipher_parms.iv_len = crypto_skcipher_ivsize(cipher); in skcipher_setkey()
1868 cipher_parms.alg = ctx->cipher.alg; in skcipher_setkey()
1869 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()
2661 if (ctx->cipher.mode == CIPHER_MODE_CBC || in aead_enqueue()
2662 ctx->cipher.mode == CIPHER_MODE_CTR || in aead_enqueue()
2663 ctx->cipher.mode == CIPHER_MODE_OFB || in aead_enqueue()
2664 ctx->cipher.mode == CIPHER_MODE_XTS || in aead_enqueue()
2665 ctx->cipher.mode == CIPHER_MODE_GCM) { in aead_enqueue()
2669 } else if (ctx->cipher.mode == CIPHER_MODE_CCM) { in aead_enqueue()
2719 static int aead_authenc_setkey(struct crypto_aead *cipher, in aead_authenc_setkey() argument
2723 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_authenc_setkey()
2724 struct crypto_tfm *tfm = crypto_aead_tfm(cipher); in aead_authenc_setkey()
2728 flow_log("%s() aead:%p key:%p keylen:%u\n", __func__, cipher, key, in aead_authenc_setkey()
2750 if (verify_aead_des_key(cipher, keys.enckey, keys.enckeylen)) in aead_authenc_setkey()
2756 if (verify_aead_des3_key(cipher, keys.enckey, keys.enckeylen)) in aead_authenc_setkey()
2814 static int aead_gcm_ccm_setkey(struct crypto_aead *cipher, in aead_gcm_ccm_setkey() argument
2818 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_gcm_ccm_setkey()
2819 struct crypto_tfm *tfm = crypto_aead_tfm(cipher); in aead_gcm_ccm_setkey()
2896 static int aead_gcm_esp_setkey(struct crypto_aead *cipher, in aead_gcm_esp_setkey() argument
2899 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_gcm_esp_setkey()
2914 return aead_gcm_ccm_setkey(cipher, key, keylen); in aead_gcm_esp_setkey()
2928 static int rfc4543_gcm_esp_setkey(struct crypto_aead *cipher, in rfc4543_gcm_esp_setkey() argument
2931 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in rfc4543_gcm_esp_setkey()
2947 return aead_gcm_ccm_setkey(cipher, key, keylen); in rfc4543_gcm_esp_setkey()
2961 static int aead_ccm_esp_setkey(struct crypto_aead *cipher, in aead_ccm_esp_setkey() argument
2964 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_ccm_esp_setkey()
2978 return aead_gcm_ccm_setkey(cipher, key, keylen); in aead_ccm_esp_setkey()
2981 static int aead_setauthsize(struct crypto_aead *cipher, unsigned int authsize) in aead_setauthsize() argument
2983 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_setauthsize()
4097 ctx->cipher = cipher_alg->cipher_info; in generic_cra_init()
4100 ctx->max_payload = spu->spu_ctx_max_payload(ctx->cipher.alg, in generic_cra_init()
4101 ctx->cipher.mode, in generic_cra_init()