Lines Matching refs:tfmctx

29 static int sun8i_ss_hashkey(struct sun8i_ss_hash_tfm_ctx *tfmctx, const u8 *key,
51 dev_err(tfmctx->ss->dev, "shash init error ret=%d\n", ret);
54 ret = crypto_shash_finup(sdesc, key, keylen, tfmctx->key);
56 dev_err(tfmctx->ss->dev, "shash finup error\n");
67 struct sun8i_ss_hash_tfm_ctx *tfmctx = crypto_ahash_ctx(ahash);
75 ret = sun8i_ss_hashkey(tfmctx, key, keylen);
78 tfmctx->keylen = digestsize;
80 tfmctx->keylen = keylen;
81 memcpy(tfmctx->key, key, keylen);
84 tfmctx->ipad = kzalloc(bs, GFP_KERNEL);
85 if (!tfmctx->ipad)
87 tfmctx->opad = kzalloc(bs, GFP_KERNEL);
88 if (!tfmctx->opad) {
93 memset(tfmctx->key + tfmctx->keylen, 0, bs - tfmctx->keylen);
94 memcpy(tfmctx->ipad, tfmctx->key, tfmctx->keylen);
95 memcpy(tfmctx->opad, tfmctx->key, tfmctx->keylen);
97 tfmctx->ipad[i] ^= HMAC_IPAD_VALUE;
98 tfmctx->opad[i] ^= HMAC_OPAD_VALUE;
101 ret = crypto_ahash_setkey(tfmctx->fallback_tfm, key, keylen);
105 memzero_explicit(tfmctx->key, keylen);
106 kfree_sensitive(tfmctx->opad);
108 kfree_sensitive(tfmctx->ipad);
152 struct sun8i_ss_hash_tfm_ctx *tfmctx = crypto_ahash_ctx(tfm);
154 kfree_sensitive(tfmctx->ipad);
155 kfree_sensitive(tfmctx->opad);
157 crypto_free_ahash(tfmctx->fallback_tfm);
158 pm_runtime_put_sync_suspend(tfmctx->ss->dev);
165 struct sun8i_ss_hash_tfm_ctx *tfmctx = crypto_ahash_ctx(tfm);
169 ahash_request_set_tfm(&rctx->fallback_req, tfmctx->fallback_tfm);
179 struct sun8i_ss_hash_tfm_ctx *tfmctx = crypto_ahash_ctx(tfm);
181 ahash_request_set_tfm(&rctx->fallback_req, tfmctx->fallback_tfm);
191 struct sun8i_ss_hash_tfm_ctx *tfmctx = crypto_ahash_ctx(tfm);
193 ahash_request_set_tfm(&rctx->fallback_req, tfmctx->fallback_tfm);
203 struct sun8i_ss_hash_tfm_ctx *tfmctx = crypto_ahash_ctx(tfm);
205 ahash_request_set_tfm(&rctx->fallback_req, tfmctx->fallback_tfm);
229 struct sun8i_ss_hash_tfm_ctx *tfmctx = crypto_ahash_ctx(tfm);
231 ahash_request_set_tfm(&rctx->fallback_req, tfmctx->fallback_tfm);
244 struct sun8i_ss_hash_tfm_ctx *tfmctx = crypto_ahash_ctx(tfm);
246 ahash_request_set_tfm(&rctx->fallback_req, tfmctx->fallback_tfm);
273 struct sun8i_ss_hash_tfm_ctx *tfmctx = crypto_ahash_ctx(tfm);
275 ahash_request_set_tfm(&rctx->fallback_req, tfmctx->fallback_tfm);
494 struct sun8i_ss_hash_tfm_ctx *tfmctx = crypto_ahash_ctx(tfm);
587 if (tfmctx->keylen && hmac == 0) {
596 addr_xpad = dma_map_single(ss->dev, tfmctx->ipad, bs, DMA_TO_DEVICE);
609 if (tfmctx->keylen && hmac == 2) {
623 addr_xpad = dma_map_single(ss->dev, tfmctx->opad, bs, DMA_TO_DEVICE);