Lines Matching refs:td_buf
29 struct rkce_hash_td_buf *td_buf; member
35 struct rkce_symm_td_buf *td_buf; member
250 hw_ctx->td_buf = rkce_cma_alloc(sizeof(struct rkce_hash_td_buf)); in rkce_sha_ctx_alloc()
251 if (!hw_ctx->td_buf) in rkce_sha_ctx_alloc()
254 memset(hw_ctx->td_buf, 0x00, sizeof(struct rkce_hash_td_buf)); in rkce_sha_ctx_alloc()
259 rkce_cma_free(hw_ctx->td_buf); in rkce_sha_ctx_alloc()
271 rkce_cma_free(hw_ctx->td_buf); in rkce_sha_ctx_free()
295 ret = rkce_init_hash_td(hash_ctx->td, hash_ctx->td_buf); in rk_sha_init()
316 memcpy(hash_ctx->td_buf->key, key, key_len); in rk_sha_init()
366 crypto_flush_cacheline((ulong)hash_ctx->td_buf, sizeof(*hash_ctx->td_buf)); in rk_sha_update()
374 crypto_invalidate_cacheline((ulong)hash_ctx->td_buf, sizeof(*hash_ctx->td_buf)); in rk_sha_update()
412 memcpy(output, hash_ctx->td_buf->hash, BITS2BYTE(nbits)); in rockchip_crypto_sha_final()
620 hw_ctx->td_buf = rkce_cma_alloc(sizeof(struct rkce_symm_td_buf)); in rkce_cipher_ctx_alloc()
621 if (!hw_ctx->td_buf) in rkce_cipher_ctx_alloc()
624 memset(hw_ctx->td_buf, 0x00, sizeof(struct rkce_symm_td_buf)); in rkce_cipher_ctx_alloc()
630 rkce_cma_free(hw_ctx->td_buf); in rkce_cipher_ctx_alloc()
643 rkce_cma_free(hw_ctx->td_buf); in rkce_cipher_ctx_free()
707 int rk_set_symm_td_buf_key(struct rkce_symm_td_buf *td_buf, in rk_set_symm_td_buf_key() argument
710 memset(td_buf->key1, 0x00, sizeof(td_buf->key1)); in rk_set_symm_td_buf_key()
711 memset(td_buf->key2, 0x00, sizeof(td_buf->key2)); in rk_set_symm_td_buf_key()
714 memcpy(td_buf->key1, ctx->key, ctx->key_len); in rk_set_symm_td_buf_key()
715 memcpy(td_buf->key2, ctx->twk_key, ctx->key_len); in rk_set_symm_td_buf_key()
717 memcpy(td_buf->key1, ctx->key, ctx->key_len); in rk_set_symm_td_buf_key()
722 memcpy(td_buf->key1 + DES_KEYSIZE * 2, td_buf->key1, DES_KEYSIZE); in rk_set_symm_td_buf_key()
774 rkce_init_symm_td(hw_ctx->td, hw_ctx->td_buf); in rk_crypto_cipher()
786 memcpy(hw_ctx->td_buf->iv, ctx->iv, ctx->iv_len); in rk_crypto_cipher()
790 ret = rk_set_symm_td_buf_key(hw_ctx->td_buf, ce_algo, ce_mode, ctx); in rk_crypto_cipher()
803 rkce_init_symm_td(hw_ctx->td_aad, hw_ctx->td_buf); in rk_crypto_cipher()
806 hw_ctx->td_buf->iv, ctx->iv_len, in rk_crypto_cipher()
808 hw_ctx->td_buf->iv, &new_iv_len); in rk_crypto_cipher()
818 hw_ctx->td_buf->gcm_len.aad_len_l = new_aad_len; in rk_crypto_cipher()
824 crypto_flush_cacheline((ulong)hw_ctx->td_buf, sizeof(*hw_ctx->td_buf)); in rk_crypto_cipher()
831 crypto_invalidate_cacheline((ulong)hw_ctx->td_buf, sizeof(*hw_ctx->td_buf)); in rk_crypto_cipher()
842 rkce_init_symm_td(hw_ctx->td_aad, hw_ctx->td_buf); in rk_crypto_cipher()
848 hw_ctx->td_buf->gcm_len.aad_len_l = aad_len; in rk_crypto_cipher()
849 hw_ctx->td_buf->gcm_len.pc_len_l = len; in rk_crypto_cipher()
855 crypto_flush_cacheline((ulong)hw_ctx->td_buf, sizeof(*hw_ctx->td_buf)); in rk_crypto_cipher()
862 crypto_invalidate_cacheline((ulong)hw_ctx->td_buf, sizeof(*hw_ctx->td_buf)); in rk_crypto_cipher()
872 crypto_flush_cacheline((ulong)hw_ctx->td_buf, sizeof(*hw_ctx->td_buf)); in rk_crypto_cipher()
882 crypto_invalidate_cacheline((ulong)hw_ctx->td_buf, sizeof(*hw_ctx->td_buf)); in rk_crypto_cipher()
887 memcpy(tag, hw_ctx->td_buf->tag, sizeof(hw_ctx->td_buf->tag)); in rk_crypto_cipher()