Lines Matching refs:hash_ctx

48 	struct rkce_sha_contex		*hash_ctx;  member
279 struct rkce_sha_contex *hash_ctx = NULL; in rk_sha_init() local
286 if (priv->hash_ctx) in rk_sha_init()
291 hash_ctx = rkce_sha_ctx_alloc(); in rk_sha_init()
292 if (!hash_ctx) in rk_sha_init()
295 ret = rkce_init_hash_td(hash_ctx->td, hash_ctx->td_buf); in rk_sha_init()
301 hash_ctx->ctrl.td_type = RKCE_TD_TYPE_HASH; in rk_sha_init()
302 hash_ctx->ctrl.hw_pad_en = 1; in rk_sha_init()
303 hash_ctx->ctrl.first_pkg = 1; in rk_sha_init()
304 hash_ctx->ctrl.last_pkg = 0; in rk_sha_init()
305 hash_ctx->ctrl.hash_algo = ce_algo; in rk_sha_init()
306 hash_ctx->ctrl.hmac_en = is_hmac; in rk_sha_init()
307 hash_ctx->ctrl.is_preemptible = 0; in rk_sha_init()
308 hash_ctx->ctrl.int_en = 1; in rk_sha_init()
316 memcpy(hash_ctx->td_buf->key, key, key_len); in rk_sha_init()
319 priv->hash_ctx = hash_ctx; in rk_sha_init()
322 rkce_sha_ctx_free(hash_ctx); in rk_sha_init()
323 priv->hash_ctx = NULL; in rk_sha_init()
332 struct rkce_sha_contex *hash_ctx; in rk_sha_update() local
336 if (!priv->hash_ctx) in rk_sha_update()
342 hash_ctx = priv->hash_ctx; in rk_sha_update()
343 td = hash_ctx->td; in rk_sha_update()
345 td->ctrl = hash_ctx->ctrl; in rk_sha_update()
348 if (hash_ctx->ctrl.first_pkg == 1) in rk_sha_update()
349 hash_ctx->ctrl.first_pkg = 0; in rk_sha_update()
359 hash_ctx->length += len; in rk_sha_update()
365 crypto_flush_cacheline((ulong)hash_ctx->td, sizeof(*hash_ctx->td)); in rk_sha_update()
366 crypto_flush_cacheline((ulong)hash_ctx->td_buf, sizeof(*hash_ctx->td_buf)); in rk_sha_update()
370 rkce_sha_ctx_free(hash_ctx); in rk_sha_update()
371 priv->hash_ctx = NULL; in rk_sha_update()
374 crypto_invalidate_cacheline((ulong)hash_ctx->td_buf, sizeof(*hash_ctx->td_buf)); in rk_sha_update()
394 struct rkce_sha_contex *hash_ctx = priv->hash_ctx; in rockchip_crypto_sha_final() local
398 if (!priv->hash_ctx) in rockchip_crypto_sha_final()
403 if (hash_ctx->length != ctx->length) { in rockchip_crypto_sha_final()
405 hash_ctx->length, ctx->length); in rockchip_crypto_sha_final()
412 memcpy(output, hash_ctx->td_buf->hash, BITS2BYTE(nbits)); in rockchip_crypto_sha_final()
415 rkce_sha_ctx_free(hash_ctx); in rockchip_crypto_sha_final()
416 priv->hash_ctx = NULL; in rockchip_crypto_sha_final()