Lines Matching refs:ctx

367 	struct ixp_ctx *ctx;
398 ctx = crypto_tfm_ctx(crypt->data.tfm);
402 if (atomic_dec_and_test(&ctx->configuring))
403 complete(&ctx->completion);
406 ctx = crypto_tfm_ctx(crypt->data.tfm);
407 *(u32*)ctx->decrypt.npe_ctx &= cpu_to_be32(~CIPH_ENCR);
408 if (atomic_dec_and_test(&ctx->configuring))
409 complete(&ctx->completion);
568 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
571 atomic_set(&ctx->configuring, 0);
572 ret = init_sa_dir(&ctx->encrypt);
575 ret = init_sa_dir(&ctx->decrypt);
577 free_sa_dir(&ctx->encrypt);
596 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
597 free_sa_dir(&ctx->encrypt);
598 free_sa_dir(&ctx->decrypt);
604 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
651 atomic_inc(&ctx->configuring);
665 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
668 dir = encrypt ? &ctx->encrypt : &ctx->decrypt;
707 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
708 struct ix_sa_dir *dir = &ctx->decrypt;
726 atomic_inc(&ctx->configuring);
739 struct ixp_ctx *ctx = crypto_tfm_ctx(tfm);
742 dir = encrypt ? &ctx->encrypt : &ctx->decrypt;
829 struct ixp_ctx *ctx = crypto_ablkcipher_ctx(tfm);
833 init_completion(&ctx->completion);
834 atomic_inc(&ctx->configuring);
836 reset_sa_dir(&ctx->encrypt);
837 reset_sa_dir(&ctx->decrypt);
839 ctx->encrypt.npe_mode = NPE_OP_HMAC_DISABLE;
840 ctx->decrypt.npe_mode = NPE_OP_HMAC_DISABLE;
857 if (!atomic_dec_and_test(&ctx->configuring))
858 wait_for_completion(&ctx->completion);
865 struct ixp_ctx *ctx = crypto_ablkcipher_ctx(tfm);
871 memcpy(ctx->nonce, key + (key_len - CTR_RFC3686_NONCE_SIZE),
881 struct ixp_ctx *ctx = crypto_ablkcipher_ctx(tfm);
894 if (atomic_read(&ctx->configuring))
897 dir = encrypt ? &ctx->encrypt : &ctx->decrypt;
964 struct ixp_ctx *ctx = crypto_ablkcipher_ctx(tfm);
970 memcpy(iv, ctx->nonce, CTR_RFC3686_NONCE_SIZE);
1005 struct ixp_ctx *ctx = crypto_aead_ctx(tfm);
1018 if (atomic_read(&ctx->configuring))
1022 dir = &ctx->encrypt;
1025 dir = &ctx->decrypt;
1107 struct ixp_ctx *ctx = crypto_aead_ctx(tfm);
1112 if (!ctx->enckey_len && !ctx->authkey_len)
1114 init_completion(&ctx->completion);
1115 atomic_inc(&ctx->configuring);
1117 reset_sa_dir(&ctx->encrypt);
1118 reset_sa_dir(&ctx->decrypt);
1120 ret = setup_cipher(&tfm->base, 0, ctx->enckey, ctx->enckey_len);
1123 ret = setup_cipher(&tfm->base, 1, ctx->enckey, ctx->enckey_len);
1126 ret = setup_auth(&tfm->base, 0, authsize, ctx->authkey,
1127 ctx->authkey_len, digest_len);
1130 ret = setup_auth(&tfm->base, 1, authsize, ctx->authkey,
1131 ctx->authkey_len, digest_len);
1144 if (!atomic_dec_and_test(&ctx->configuring))
1145 wait_for_completion(&ctx->completion);
1161 struct ixp_ctx *ctx = crypto_aead_ctx(tfm);
1173 ctx->enckey_len = be32_to_cpu(param->enckeylen);
1178 if (keylen < ctx->enckey_len)
1181 ctx->authkey_len = keylen - ctx->enckey_len;
1182 memcpy(ctx->enckey, key + ctx->authkey_len, ctx->enckey_len);
1183 memcpy(ctx->authkey, key, ctx->authkey_len);
1187 ctx->enckey_len = 0;
1209 struct ixp_ctx *ctx = crypto_aead_ctx(tfm);
1214 if (!ctx->salted) {
1215 get_random_bytes(ctx->salt, ivsize);
1216 ctx->salted = 1;
1218 memcpy(req->areq.iv, ctx->salt, ivsize);