Lines Matching refs:cipher

165 	if ((ctx->cipher.mode == CIPHER_MODE_XTS) &&  in spu_ablkcipher_rx_sg_create()
179 if (ctx->cipher.alg == CIPHER_ALG_RC4) in spu_ablkcipher_rx_sg_create()
234 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in spu_ablkcipher_tx_sg_create()
340 cipher_parms.alg = ctx->cipher.alg; in handle_ablkcipher_req()
341 cipher_parms.mode = ctx->cipher.mode; in handle_ablkcipher_req()
366 if ((ctx->cipher.mode == CIPHER_MODE_CBC) && in handle_ablkcipher_req()
382 if ((ctx->cipher.mode == CIPHER_MODE_CBC) && in handle_ablkcipher_req()
391 } else if (ctx->cipher.mode == CIPHER_MODE_CTR) { in handle_ablkcipher_req()
405 if (ctx->cipher.alg == CIPHER_ALG_RC4) { in handle_ablkcipher_req()
478 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_ablkcipher_req()
492 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_ablkcipher_req()
530 if ((ctx->cipher.mode == CIPHER_MODE_XTS) && in handle_ablkcipher_resp()
541 if (ctx->cipher.alg == CIPHER_ALG_RC4) in handle_ablkcipher_resp()
549 &iproc_priv.cipher_cnt[ctx->cipher.alg][ctx->cipher.mode]); in handle_ablkcipher_resp()
881 data_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, chunksize); in handle_ahash_req()
1107 data_padlen = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1111 data_padlen = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1113 assoc_buf_len = spu->spu_assoc_resp_len(ctx->cipher.mode, in spu_aead_rx_sg_create()
1118 if (ctx->cipher.mode == CIPHER_MODE_CCM) in spu_aead_rx_sg_create()
1349 cipher_parms.alg = ctx->cipher.alg; in handle_aead_req()
1350 cipher_parms.mode = ctx->cipher.mode; in handle_aead_req()
1402 if (spu->spu_assoc_resp_len(ctx->cipher.mode, in handle_aead_req()
1408 aead_parms.iv_len = spu->spu_aead_ivlen(ctx->cipher.mode, in handle_aead_req()
1415 aead_parms.aad_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1419 aead_parms.data_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1422 if (ctx->cipher.mode == CIPHER_MODE_CCM) { in handle_aead_req()
1428 ctx->cipher.mode, in handle_aead_req()
1437 spu->spu_gcm_ccm_pad_len(ctx->cipher.mode, in handle_aead_req()
1454 ctx->cipher.mode, in handle_aead_req()
1459 ctx->cipher.mode, in handle_aead_req()
1465 if (spu_req_incl_icv(ctx->cipher.mode, rctx->is_encrypt)) { in handle_aead_req()
1531 if (((ctx->cipher.mode == CIPHER_MODE_GCM) || in handle_aead_req()
1532 (ctx->cipher.mode == CIPHER_MODE_CCM)) && !rctx->is_encrypt) { in handle_aead_req()
1618 if (ctx->cipher.alg == CIPHER_ALG_AES) { in handle_aead_resp()
1619 if (ctx->cipher.mode == CIPHER_MODE_CCM) in handle_aead_resp()
1621 else if (ctx->cipher.mode == CIPHER_MODE_GCM) in handle_aead_resp()
1793 if (ctx->cipher.mode == CIPHER_MODE_CBC || in ablkcipher_enqueue()
1794 ctx->cipher.mode == CIPHER_MODE_CTR || in ablkcipher_enqueue()
1795 ctx->cipher.mode == CIPHER_MODE_OFB || in ablkcipher_enqueue()
1796 ctx->cipher.mode == CIPHER_MODE_XTS || in ablkcipher_enqueue()
1797 ctx->cipher.mode == CIPHER_MODE_GCM || in ablkcipher_enqueue()
1798 ctx->cipher.mode == CIPHER_MODE_CCM) { in ablkcipher_enqueue()
1816 static int des_setkey(struct crypto_ablkcipher *cipher, const u8 *key, in des_setkey() argument
1819 struct iproc_ctx_s *ctx = crypto_ablkcipher_ctx(cipher); in des_setkey()
1824 if (crypto_ablkcipher_get_flags(cipher) & in des_setkey()
1828 crypto_ablkcipher_set_flags(cipher, flags); in des_setkey()
1835 crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); in des_setkey()
1841 static int threedes_setkey(struct crypto_ablkcipher *cipher, const u8 *key, in threedes_setkey() argument
1844 struct iproc_ctx_s *ctx = crypto_ablkcipher_ctx(cipher); in threedes_setkey()
1852 crypto_ablkcipher_set_flags(cipher, flags); in threedes_setkey()
1858 crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); in threedes_setkey()
1864 static int aes_setkey(struct crypto_ablkcipher *cipher, const u8 *key, in aes_setkey() argument
1867 struct iproc_ctx_s *ctx = crypto_ablkcipher_ctx(cipher); in aes_setkey()
1869 if (ctx->cipher.mode == CIPHER_MODE_XTS) in aes_setkey()
1884 crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); in aes_setkey()
1892 static int rc4_setkey(struct crypto_ablkcipher *cipher, const u8 *key, in rc4_setkey() argument
1895 struct iproc_ctx_s *ctx = crypto_ablkcipher_ctx(cipher); in rc4_setkey()
1912 static int ablkcipher_setkey(struct crypto_ablkcipher *cipher, const u8 *key, in ablkcipher_setkey() argument
1916 struct iproc_ctx_s *ctx = crypto_ablkcipher_ctx(cipher); in ablkcipher_setkey()
1924 switch (ctx->cipher.alg) { in ablkcipher_setkey()
1926 err = des_setkey(cipher, key, keylen); in ablkcipher_setkey()
1929 err = threedes_setkey(cipher, key, keylen); in ablkcipher_setkey()
1932 err = aes_setkey(cipher, key, keylen); in ablkcipher_setkey()
1935 err = rc4_setkey(cipher, key, keylen); in ablkcipher_setkey()
1945 if (ctx->cipher.alg != CIPHER_ALG_RC4) { in ablkcipher_setkey()
1950 if ((ctx->cipher.alg == CIPHER_ALG_AES) && in ablkcipher_setkey()
1951 (ctx->cipher.mode == CIPHER_MODE_XTS)) { in ablkcipher_setkey()
1964 cipher_parms.iv_len = crypto_ablkcipher_ivsize(cipher); in ablkcipher_setkey()
1967 cipher_parms.alg = ctx->cipher.alg; in ablkcipher_setkey()
1968 cipher_parms.mode = ctx->cipher.mode; in ablkcipher_setkey()
2615 if (((ctx->cipher.mode == CIPHER_MODE_GCM) || in aead_need_fallback()
2616 (ctx->cipher.mode == CIPHER_MODE_CCM)) && in aead_need_fallback()
2626 if ((ctx->cipher.mode == CIPHER_MODE_CCM) && in aead_need_fallback()
2639 if ((ctx->cipher.mode == CIPHER_MODE_CCM) && in aead_need_fallback()
2784 if (ctx->cipher.mode == CIPHER_MODE_CBC || in aead_enqueue()
2785 ctx->cipher.mode == CIPHER_MODE_CTR || in aead_enqueue()
2786 ctx->cipher.mode == CIPHER_MODE_OFB || in aead_enqueue()
2787 ctx->cipher.mode == CIPHER_MODE_XTS || in aead_enqueue()
2788 ctx->cipher.mode == CIPHER_MODE_GCM) { in aead_enqueue()
2792 } else if (ctx->cipher.mode == CIPHER_MODE_CCM) { in aead_enqueue()
2842 static int aead_authenc_setkey(struct crypto_aead *cipher, in aead_authenc_setkey() argument
2846 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_authenc_setkey()
2847 struct crypto_tfm *tfm = crypto_aead_tfm(cipher); in aead_authenc_setkey()
2855 flow_log("%s() aead:%p key:%p keylen:%u\n", __func__, cipher, key, in aead_authenc_setkey()
2894 if (crypto_aead_get_flags(cipher) & in aead_authenc_setkey()
2896 crypto_aead_set_flags(cipher, flags); in aead_authenc_setkey()
2913 crypto_aead_set_flags(cipher, flags); in aead_authenc_setkey()
2919 crypto_aead_set_flags(cipher, in aead_authenc_setkey()
2984 crypto_aead_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); in aead_authenc_setkey()
2988 static int aead_gcm_ccm_setkey(struct crypto_aead *cipher, in aead_gcm_ccm_setkey() argument
2992 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_gcm_ccm_setkey()
2993 struct crypto_tfm *tfm = crypto_aead_tfm(cipher); in aead_gcm_ccm_setkey()
3060 crypto_aead_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); in aead_gcm_ccm_setkey()
3075 static int aead_gcm_esp_setkey(struct crypto_aead *cipher, in aead_gcm_esp_setkey() argument
3078 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_gcm_esp_setkey()
3089 return aead_gcm_ccm_setkey(cipher, key, keylen); in aead_gcm_esp_setkey()
3103 static int rfc4543_gcm_esp_setkey(struct crypto_aead *cipher, in rfc4543_gcm_esp_setkey() argument
3106 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in rfc4543_gcm_esp_setkey()
3118 return aead_gcm_ccm_setkey(cipher, key, keylen); in rfc4543_gcm_esp_setkey()
3132 static int aead_ccm_esp_setkey(struct crypto_aead *cipher, in aead_ccm_esp_setkey() argument
3135 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_ccm_esp_setkey()
3145 return aead_gcm_ccm_setkey(cipher, key, keylen); in aead_ccm_esp_setkey()
3148 static int aead_setauthsize(struct crypto_aead *cipher, unsigned int authsize) in aead_setauthsize() argument
3150 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher); in aead_setauthsize()
4334 ctx->cipher = cipher_alg->cipher_info; in generic_cra_init()
4337 ctx->max_payload = spu->spu_ctx_max_payload(ctx->cipher.alg, in generic_cra_init()
4338 ctx->cipher.mode, in generic_cra_init()