/* This function finishes the GCM operation and generates the authentication tag.  */
rt_err_t rt_hwcrypto_gcm_finish(struct rt_hwcrypto_ctx *ctx, const rt_uint8_t *tag, rt_size_t tag_len)
/* This function finishes the GCM operation and generates the authentication tag.  */
rt_err_t rt_hwcrypto_gcm_finish(struct rt_hwcrypto_ctx *ctx, const rt_uint8_t *tag, rt_size_t tag_len)
{
    struct hwcrypto_gcm *gcm_ctx = (struct hwcrypto_gcm *)ctx;
    if (gcm_ctx && gcm_ctx->ops->finish)
    {
        return gcm_ctx->ops->finish(gcm_ctx, tag, tag_len);
    }
    return -RT_EINVAL;
}