创建Digest context
参照创建Digest context,仅增加回调函数的设置,用于任务完成后,poll线程进行调用。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | static void _digest_cb(void *message, void *digest_tag) { struct digest_async_tag *tag = digest_tag; void *ctx = tag->ctx; int thread_id = tag->thread_id; int cnt = tag->cnt; struct wcrypto_digest_msg *msg = message; if (msg->status = WD_SUCCESS) printf("thread %d do digest %dth time suc cess!\n", thread_id, cnt); else printf("thread %d do RSA %dth time fail(status=%d)!\n", thread_id, cnt, msg->status); free(digest_tag); } setup.cb = (void *)_digest_cb; …… |
父主题: Digest异步接口使用示例