创建RSA context和创建blk块内存池
创建RSA context和创建blk块内存池,请参见创建RSA context和创建blk块内存池,仅增加回调函数的设置,用于任务完成后,poll线程进行调用。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | static void _rsa_cb(void *message, void *rsa_tag) { struct rsa_async_tag *tag = rsa_tag; void *ctx = tag->ctx; int thread_id = tag->thread_id; int cnt = tag->cnt; struct wd_rsa_msg *msg = message; if (msg->status = WD_SUCCESS) printf("thread %d do RSA %dth time success!\n", thread_id, cnt); else printf("thread %d do RSA %dth time fail(status=%d)!\n", thread_id, cnt, msg->status); free(rsa_tag); wd_free_blk(pool, (void *)msg->in); wd_free_blk(pool, (void *)msg->out); } setup.cb = (void *)_rsa_cb; …… |
父主题: RSA异步接口使用示例