Lines Matching refs:cipher
154 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in spu_skcipher_rx_sg_create()
218 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in spu_skcipher_tx_sg_create()
323 cipher_parms.alg = ctx->cipher.alg; in handle_skcipher_req()
324 cipher_parms.mode = ctx->cipher.mode; in handle_skcipher_req()
349 if ((ctx->cipher.mode == CIPHER_MODE_CBC) && in handle_skcipher_req()
365 if ((ctx->cipher.mode == CIPHER_MODE_CBC) && in handle_skcipher_req()
374 } else if (ctx->cipher.mode == CIPHER_MODE_CTR) { in handle_skcipher_req()
434 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_skcipher_req()
448 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_skcipher_req()
484 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_skcipher_resp()
500 &iproc_priv.cipher_cnt[ctx->cipher.alg][ctx->cipher.mode]); in handle_skcipher_resp()
830 data_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, chunksize); in handle_ahash_req()
1055 data_padlen = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1059 data_padlen = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1061 assoc_buf_len = spu->spu_assoc_resp_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1066 if (ctx->cipher.mode == CIPHER_MODE_CCM) in spu_aead_rx_sg_create()
1295 cipher_parms.alg = ctx->cipher.alg; in handle_aead_req()
1296 cipher_parms.mode = ctx->cipher.mode; in handle_aead_req()
1348 if (spu->spu_assoc_resp_len(ctx->cipher.mode, in handle_aead_req()
1354 aead_parms.iv_len = spu->spu_aead_ivlen(ctx->cipher.mode, in handle_aead_req()
1361 aead_parms.aad_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1365 aead_parms.data_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1368 if (ctx->cipher.mode == CIPHER_MODE_CCM) { in handle_aead_req()
1374 ctx->cipher.mode, in handle_aead_req()
1383 spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1400 ctx->cipher.mode, in handle_aead_req()
1405 ctx->cipher.mode, in handle_aead_req()
1411 if (spu_req_incl_icv(ctx->cipher.mode, rctx->is_encrypt)) { in handle_aead_req()
1477 if (((ctx->cipher.mode == CIPHER_MODE_GCM) || in handle_aead_req()
1478 (ctx->cipher.mode == CIPHER_MODE_CCM)) && !rctx->is_encrypt) { in handle_aead_req()
1564 if (ctx->cipher.alg == CIPHER_ALG_AES) { in handle_aead_resp()
1565 if (ctx->cipher.mode == CIPHER_MODE_CCM) in handle_aead_resp()
1567 else if (ctx->cipher.mode == CIPHER_MODE_GCM) in handle_aead_resp()
1735 if (ctx->cipher.mode == CIPHER_MODE_CBC || in skcipher_enqueue()
1736 ctx->cipher.mode == CIPHER_MODE_CTR || in skcipher_enqueue()
1737 ctx->cipher.mode == CIPHER_MODE_OFB || in skcipher_enqueue()
1738 ctx->cipher.mode == CIPHER_MODE_XTS || in skcipher_enqueue()
1739 ctx->cipher.mode == CIPHER_MODE_GCM || in skcipher_enqueue()
1740 ctx->cipher.mode == CIPHER_MODE_CCM) { in skcipher_enqueue()
1758 static int des_setkey(struct crypto_skcipher *cipher, const u8 *key, in des_setkey() argument
1761 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in des_setkey()
1764 err = verify_skcipher_des_key(cipher, key); in des_setkey()
1772 static int threedes_setkey(struct crypto_skcipher *cipher, const u8 *key, in threedes_setkey() argument
1775 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in threedes_setkey()
1778 err = verify_skcipher_des3_key(cipher, key); in threedes_setkey()
1786 static int aes_setkey(struct crypto_skcipher *cipher, const u8 *key, in aes_setkey() argument
1789 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in aes_setkey()
1791 if (ctx->cipher.mode == CIPHER_MODE_XTS) in aes_setkey()
1813 static int skcipher_setkey(struct crypto_skcipher *cipher, const u8 *key, in skcipher_setkey() argument
1817 struct iproc_ctx_s *ctx = crypto_skcipher_ctx(cipher); in skcipher_setkey()
1825 switch (ctx->cipher.alg) { in skcipher_setkey()
1827 err = des_setkey(cipher, key, keylen); in skcipher_setkey()
1830 err = threedes_setkey(cipher, key, keylen); in skcipher_setkey()
1833 err = aes_setkey(cipher, key, keylen); in skcipher_setkey()
1846 if ((ctx->cipher.alg == CIPHER_ALG_AES) && in skcipher_setkey()
1847 (ctx->cipher.mode == CIPHER_MODE_XTS)) { in skcipher_setkey()
1860 cipher_parms.iv_len = crypto_skcipher_ivsize(cipher); in skcipher_setkey()
1863 cipher_parms.alg = ctx->cipher.alg; in skcipher_setkey()
1864 cipher_parms.mode = ctx->cipher.mode; in skcipher_setkey()
2514 if (((ctx->cipher.mode == CIPHER_MODE_GCM) || in aead_need_fallback()
2515 (ctx->cipher.mode == CIPHER_MODE_CCM)) && in aead_need_fallback()
2525 if ((ctx->cipher.mode == CIPHER_MODE_CCM) && in aead_need_fallback()
2538 if ((ctx->cipher.mode == CIPHER_MODE_CCM) && in aead_need_fallback()
2550 if (ctx->cipher.mode == CIPHER_MODE_GCM && in aead_need_fallback()
2551 ctx->cipher.alg == CIPHER_ALG_AES && in aead_need_fallback()
2659 if (ctx->cipher.mode == CIPHER_MODE_CBC || in aead_enqueue()
2660 ctx->cipher.mode == CIPHER_MODE_CTR || in aead_enqueue()
2661 ctx->cipher.mode == CIPHER_MODE_OFB || in aead_enqueue()
2662 ctx->cipher.mode == CIPHER_MODE_XTS || in aead_enqueue()
2663 ctx->cipher.mode == CIPHER_MODE_GCM) { in aead_enqueue()
2667 } else if (ctx->cipher.mode == CIPHER_MODE_CCM) { in aead_enqueue()
2717 static int aead_authenc_setkey(struct crypto_aead *cipher, in aead_authenc_setkey() argument
2721 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_authenc_setkey()
2722 struct crypto_tfm *tfm = crypto_aead_tfm(cipher); in aead_authenc_setkey()
2726 flow_log("%s() aead:%p key:%p keylen:%u\n", __func__, cipher, key, in aead_authenc_setkey()
2748 if (verify_aead_des_key(cipher, keys.enckey, keys.enckeylen)) in aead_authenc_setkey()
2754 if (verify_aead_des3_key(cipher, keys.enckey, keys.enckeylen)) in aead_authenc_setkey()
2812 static int aead_gcm_ccm_setkey(struct crypto_aead *cipher, in aead_gcm_ccm_setkey() argument
2816 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_gcm_ccm_setkey()
2817 struct crypto_tfm *tfm = crypto_aead_tfm(cipher); in aead_gcm_ccm_setkey()
2894 static int aead_gcm_esp_setkey(struct crypto_aead *cipher, in aead_gcm_esp_setkey() argument
2897 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_gcm_esp_setkey()
2912 return aead_gcm_ccm_setkey(cipher, key, keylen); in aead_gcm_esp_setkey()
2926 static int rfc4543_gcm_esp_setkey(struct crypto_aead *cipher, in rfc4543_gcm_esp_setkey() argument
2929 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in rfc4543_gcm_esp_setkey()
2945 return aead_gcm_ccm_setkey(cipher, key, keylen); in rfc4543_gcm_esp_setkey()
2959 static int aead_ccm_esp_setkey(struct crypto_aead *cipher, in aead_ccm_esp_setkey() argument
2962 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_ccm_esp_setkey()
2976 return aead_gcm_ccm_setkey(cipher, key, keylen); in aead_ccm_esp_setkey()
2979 static int aead_setauthsize(struct crypto_aead *cipher, unsigned int authsize) in aead_setauthsize() argument
2981 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_setauthsize()
4095 ctx->cipher = cipher_alg->cipher_info; in generic_cra_init()
4098 ctx->max_payload = spu->spu_ctx_max_payload(ctx->cipher.alg, in generic_cra_init()
4099 ctx->cipher.mode, in generic_cra_init()