__u8 *output,intencrypt){structscatterlistsrc[1];structscatterlistdst[1];structblkcipher_descdesc;structcrypto_blkcipher*cipher=crypto_alloc_blkcipher("cbc(aes)", 0, 0);crypto_blkcipher_setkey(cipher, key, keyLength); sg_init_table(dst,1); sg_init_table(src,1); sg_set_buf(&dst[0]...
staticintasync_chainiv_givencrypt_first(struct skcipher_givcrypt_request *req){structcrypto_ablkcipher*geniv=skcipher_givcrypt_reqtfm(req);structasync_chainiv_ctx*ctx=crypto_ablkcipher_ctx(geniv);interr =0;if(test_and_set_bit(CHAINIV_STATE_INUSE, &ctx->state))gotoout;if(crypto_ablkciphe...
+ req = ablkcipher_request_alloc(tfm, GFP_KERNEL); + if (!req) { + printk("failed to allocate request for %s\n", algo); + goto out; + } + + ablkcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, + tcrypt_complete, &result); j = 0; for (i = 0; i < tcoun...
+static inline struct crypto_ablkcipher *__crypto_ablkcipher_cast( + struct crypto_tfm *tfm) +{ + return (struct crypto_ablkcipher *)tfm; +} + +static inline struct crypto_ablkcipher *crypto_alloc_ablkcipher( + const char *alg_name, u32 type, u32 mask) +{ + type &= ~CRYPTO...
return cryptd_alloc_blkcipher(tb, &state); }return ERR_PTR(-EINVAL); }static void cryptd_free(struct crypto_instance *inst) { struct cryptd_instance_ctx *ctx = crypto_instance_ctx(inst);crypto_drop_spawn(&ctx->spawn); kfree(inst); ...
static inline unsigned int ablkcipher_done_fast(struct ablkcipher_walk *walk, unsigned int n) static inline void ablkcipher_done_fast(struct ablkcipher_walk *walk, unsigned int n) { scatterwalk_advance(&walk->in, n); scatterwalk_advance(&walk->out, n);...
When we need to allocate a temporary blkcipher_walk_next and it fails, the code is supposed to take the slow path of processing the data block by block. However, due to an unrelated change we instead end up dereferencing the NULL pointer. This patch fixes it by moving the unrelated b...
+ active = ablkcipher_tfm_in_queue(&state->queue, + __crypto_ablkcipher_cast(tfm)); mutex_unlock(&state->mutex); BUG_ON(active); @@ -251,8 +252,6 @@ static struct crypto_instance *cryptd_alloc_blkcipher( inst->alg.cra_ablkcipher.encrypt = cryptd_blkcipher_encrypt_enqueue; ...
>> + struct omap_aes_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req)); >> + int ret = 0; >> + >> + tfm = crypto_alloc_ablkcipher("ctr(aes)", 0, 0); > > Ugh, you cannot allocate crypto transforms in the data path. You ...
ctx->enc_tfm=crypto_alloc_cipher("aes",0,0); if(IS_ERR(ctx->enc_tfm)) returnPTR_ERR(ctx->enc_tfm); return0; } staticvoidcbc_exit(structcrypto_tfm*tfm) { structaesbs_cbc_ctx*ctx=crypto_tfm_ctx(tfm); crypto_free_cipher(ctx->enc_tfm); ...