Lines Matching refs:bctx
359 struct mtk_sha_hmac_ctx *bctx = tctx->base; in mtk_sha_finish_hmac() local
362 SHASH_DESC_ON_STACK(shash, bctx->shash); in mtk_sha_finish_hmac()
364 shash->tfm = bctx->shash; in mtk_sha_finish_hmac()
367 crypto_shash_update(shash, bctx->opad, ctx->bs) ?: in mtk_sha_finish_hmac()
411 struct mtk_sha_hmac_ctx *bctx = tctx->base; in mtk_sha_init() local
413 memcpy(ctx->buffer, bctx->ipad, ctx->bs); in mtk_sha_init()
803 struct mtk_sha_hmac_ctx *bctx = tctx->base; in mtk_sha_setkey() local
804 size_t bs = crypto_shash_blocksize(bctx->shash); in mtk_sha_setkey()
805 size_t ds = crypto_shash_digestsize(bctx->shash); in mtk_sha_setkey()
809 err = crypto_shash_tfm_digest(bctx->shash, key, keylen, in mtk_sha_setkey()
810 bctx->ipad); in mtk_sha_setkey()
815 memcpy(bctx->ipad, key, keylen); in mtk_sha_setkey()
818 memset(bctx->ipad + keylen, 0, bs - keylen); in mtk_sha_setkey()
819 memcpy(bctx->opad, bctx->ipad, bs); in mtk_sha_setkey()
822 bctx->ipad[i] ^= HMAC_IPAD_VALUE; in mtk_sha_setkey()
823 bctx->opad[i] ^= HMAC_OPAD_VALUE; in mtk_sha_setkey()
859 struct mtk_sha_hmac_ctx *bctx = tctx->base; in mtk_sha_cra_init_alg() local
862 bctx->shash = crypto_alloc_shash(alg_base, 0, in mtk_sha_cra_init_alg()
864 if (IS_ERR(bctx->shash)) { in mtk_sha_cra_init_alg()
868 return PTR_ERR(bctx->shash); in mtk_sha_cra_init_alg()
909 struct mtk_sha_hmac_ctx *bctx = tctx->base; in mtk_sha_cra_exit() local
911 crypto_free_shash(bctx->shash); in mtk_sha_cra_exit()