Lines Matching refs:tctx

69 geode_aes_crypt(const struct geode_aes_tfm_ctx *tctx, const void *src,  in geode_aes_crypt()  argument
96 _writefield(AES_WRITEKEY0_REG, tctx->key); in geode_aes_crypt()
112 struct geode_aes_tfm_ctx *tctx = crypto_tfm_ctx(tfm); in geode_setkey_cip() local
114 tctx->keylen = len; in geode_setkey_cip()
117 memcpy(tctx->key, key, len); in geode_setkey_cip()
128 tctx->fallback.cip->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; in geode_setkey_cip()
129 tctx->fallback.cip->base.crt_flags |= in geode_setkey_cip()
132 return crypto_cipher_setkey(tctx->fallback.cip, key, len); in geode_setkey_cip()
138 struct geode_aes_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in geode_setkey_skcipher() local
140 tctx->keylen = len; in geode_setkey_skcipher()
143 memcpy(tctx->key, key, len); in geode_setkey_skcipher()
154 crypto_skcipher_clear_flags(tctx->fallback.skcipher, in geode_setkey_skcipher()
156 crypto_skcipher_set_flags(tctx->fallback.skcipher, in geode_setkey_skcipher()
159 return crypto_skcipher_setkey(tctx->fallback.skcipher, key, len); in geode_setkey_skcipher()
165 const struct geode_aes_tfm_ctx *tctx = crypto_tfm_ctx(tfm); in geode_encrypt() local
167 if (unlikely(tctx->keylen != AES_KEYSIZE_128)) { in geode_encrypt()
168 crypto_cipher_encrypt_one(tctx->fallback.cip, out, in); in geode_encrypt()
172 geode_aes_crypt(tctx, in, out, AES_BLOCK_SIZE, NULL, in geode_encrypt()
180 const struct geode_aes_tfm_ctx *tctx = crypto_tfm_ctx(tfm); in geode_decrypt() local
182 if (unlikely(tctx->keylen != AES_KEYSIZE_128)) { in geode_decrypt()
183 crypto_cipher_decrypt_one(tctx->fallback.cip, out, in); in geode_decrypt()
187 geode_aes_crypt(tctx, in, out, AES_BLOCK_SIZE, NULL, in geode_decrypt()
194 struct geode_aes_tfm_ctx *tctx = crypto_tfm_ctx(tfm); in fallback_init_cip() local
196 tctx->fallback.cip = crypto_alloc_cipher(name, 0, in fallback_init_cip()
199 if (IS_ERR(tctx->fallback.cip)) { in fallback_init_cip()
201 return PTR_ERR(tctx->fallback.cip); in fallback_init_cip()
209 struct geode_aes_tfm_ctx *tctx = crypto_tfm_ctx(tfm); in fallback_exit_cip() local
211 crypto_free_cipher(tctx->fallback.cip); in fallback_exit_cip()
240 struct geode_aes_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in geode_init_skcipher() local
242 tctx->fallback.skcipher = in geode_init_skcipher()
245 if (IS_ERR(tctx->fallback.skcipher)) { in geode_init_skcipher()
247 return PTR_ERR(tctx->fallback.skcipher); in geode_init_skcipher()
251 crypto_skcipher_reqsize(tctx->fallback.skcipher)); in geode_init_skcipher()
257 struct geode_aes_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in geode_exit_skcipher() local
259 crypto_free_skcipher(tctx->fallback.skcipher); in geode_exit_skcipher()
265 const struct geode_aes_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in geode_skcipher_crypt() local
270 if (unlikely(tctx->keylen != AES_KEYSIZE_128)) { in geode_skcipher_crypt()
274 skcipher_request_set_tfm(subreq, tctx->fallback.skcipher); in geode_skcipher_crypt()
284 geode_aes_crypt(tctx, walk.src.virt.addr, walk.dst.virt.addr, in geode_skcipher_crypt()