• Home
  • Raw
  • Download

Lines Matching refs:cipher

557 static int chcr_cipher_fallback(struct crypto_skcipher *cipher,  in chcr_cipher_fallback()  argument
567 SKCIPHER_REQUEST_ON_STACK(subreq, cipher); in chcr_cipher_fallback()
568 skcipher_request_set_tfm(subreq, cipher); in chcr_cipher_fallback()
740 static int chcr_cipher_fallback_setkey(struct crypto_ablkcipher *cipher, in chcr_cipher_fallback_setkey() argument
744 struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher); in chcr_cipher_fallback_setkey()
745 struct chcr_context *ctx = crypto_ablkcipher_ctx(cipher); in chcr_cipher_fallback_setkey()
750 crypto_skcipher_set_flags(ablkctx->sw_cipher, cipher->base.crt_flags & in chcr_cipher_fallback_setkey()
760 static int chcr_aes_cbc_setkey(struct crypto_ablkcipher *cipher, in chcr_aes_cbc_setkey() argument
764 struct chcr_context *ctx = crypto_ablkcipher_ctx(cipher); in chcr_aes_cbc_setkey()
770 err = chcr_cipher_fallback_setkey(cipher, key, keylen); in chcr_aes_cbc_setkey()
787 crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); in chcr_aes_cbc_setkey()
793 static int chcr_aes_ctr_setkey(struct crypto_ablkcipher *cipher, in chcr_aes_ctr_setkey() argument
797 struct chcr_context *ctx = crypto_ablkcipher_ctx(cipher); in chcr_aes_ctr_setkey()
803 err = chcr_cipher_fallback_setkey(cipher, key, keylen); in chcr_aes_ctr_setkey()
819 crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); in chcr_aes_ctr_setkey()
825 static int chcr_aes_rfc3686_setkey(struct crypto_ablkcipher *cipher, in chcr_aes_rfc3686_setkey() argument
829 struct chcr_context *ctx = crypto_ablkcipher_ctx(cipher); in chcr_aes_rfc3686_setkey()
841 err = chcr_cipher_fallback_setkey(cipher, key, keylen); in chcr_aes_rfc3686_setkey()
858 crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); in chcr_aes_rfc3686_setkey()
900 struct crypto_cipher *cipher; in chcr_update_tweak() local
905 cipher = ablkctx->aes_generic; in chcr_update_tweak()
910 ret = crypto_cipher_setkey(cipher, key, keylen); in chcr_update_tweak()
914 crypto_cipher_encrypt_one(cipher, iv, iv); in chcr_update_tweak()
918 crypto_cipher_decrypt_one(cipher, iv, iv); in chcr_update_tweak()
1735 static int chcr_aes_xts_setkey(struct crypto_ablkcipher *cipher, const u8 *key, in chcr_aes_xts_setkey() argument
1738 struct chcr_context *ctx = crypto_ablkcipher_ctx(cipher); in chcr_aes_xts_setkey()
1743 err = chcr_cipher_fallback_setkey(cipher, key, key_len); in chcr_aes_xts_setkey()
1760 crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); in chcr_aes_xts_setkey()
2850 struct crypto_cipher *cipher; in chcr_gcm_setkey() local
2895 cipher = crypto_alloc_cipher("aes-generic", 0, 0); in chcr_gcm_setkey()
2896 if (IS_ERR(cipher)) { in chcr_gcm_setkey()
2902 ret = crypto_cipher_setkey(cipher, key, keylen); in chcr_gcm_setkey()
2908 crypto_cipher_encrypt_one(cipher, gctx->ghash_h, gctx->ghash_h); in chcr_gcm_setkey()
2911 crypto_free_cipher(cipher); in chcr_gcm_setkey()