当前位置: 首页 > news >正文

网站制作平台能赚钱吗百度推广效果不好怎么办

网站制作平台能赚钱吗,百度推广效果不好怎么办,铜仁建设公司网站,wordpress翻译更新失败文章目录 openssl3.2 - 测试程序的学习 - test\acvp_test.c概述笔记要单步学习的测试函数备注END openssl3.2 - 测试程序的学习 - test\acvp_test.c 概述 openssl3.2 - 测试程序的学习 将test*.c 收集起来后, 就不准备看makefile和make test的日志参考了. 按照收集的.c, 按照…

文章目录

    • openssl3.2 - 测试程序的学习 - test\acvp_test.c
    • 概述
    • 笔记
    • 要单步学习的测试函数
    • 备注
    • END

openssl3.2 - 测试程序的学习 - test\acvp_test.c

概述

openssl3.2 - 测试程序的学习

将test*.c 收集起来后, 就不准备看makefile和make test的日志参考了. 按照收集的.c, 按照字母序拿来做实验就行.

直接将前面搭建的工程 test\sanitytest.c作为模板, 将acvp_test.c加进去, 将冲突的文件拿掉, 编译一下就过了.

openssl的工程是一个框架, 有main实现, 在具体的测试程序中, 只要实现3个函数就可以了.

// 每个测试.c都要实现的函数列表
const OPTIONS *test_get_options(void){};
int setup_tests(void) {};
void cleanup_tests(void) {};

笔记

在这里插入图片描述
只要搭好一个测试工程, 另外一个测试工程, 就将测试实现部分换掉, 公共部分不用动.
这个工程, 在上一个工程上搭建, 只需要将这个测试相关的acvp_test.c, acvp_test.inc换上, 编译即可.
公共部分如果有冲突的公共实现(test_get_options(), setup_tests(), cleanup_tests()), 说明工程中包含其他的测试实现, 将无关的测试实现删掉就行.

要单步学习的测试函数

int setup_tests(void)
{char *config_file = NULL;OPTION_CHOICE o;while ((o = opt_next()) != OPT_EOF) {switch (o) {case OPT_CONFIG_FILE:config_file = opt_arg();break;case OPT_TEST_CASES:break;default:case OPT_ERR:return 0;}}if (!test_get_libctx(&libctx, &prov_null, config_file, NULL, NULL))return 0;OSSL_SELF_TEST_set_callback(libctx, self_test_events, &self_test_args);ADD_TEST(aes_cfb1_bits_test);ADD_ALL_TESTS(cipher_enc_dec_test, OSSL_NELEM(cipher_enc_data));ADD_ALL_TESTS(aes_ccm_enc_dec_test, OSSL_NELEM(aes_ccm_enc_data));ADD_ALL_TESTS(aes_gcm_enc_dec_test, OSSL_NELEM(aes_gcm_enc_data));

在setup_tests()中, 官方会用ADD_TEST(), ADD_ALL_TESTS()添加测试函数.
在这些测试函数(e.g. aes_cfb1_bits_test(), aes_ccm_enc_dec_test())入口下断点, 然后将程序跑起来, 一个函数过一遍就可以了.

这些函数因为是测试专用, 用了一些预留的测试数据(在acvp_test.inc中定义), 只能学到一些流程性的东西.

static int aes_ccm_enc_dec_test(int id)
{const struct cipher_ccm_st *tst = &aes_ccm_enc_data[id]; // 预留数据/* The tag is on the end of the cipher text */const size_t tag_len = tst->ct_len - tst->pt_len;const size_t ct_len = tst->ct_len - tag_len;const unsigned char *tag = tst->ct + ct_len;const int enc = 1;const int pass = 1;if (ct_len < 1)return 0;return aes_ccm_enc_dec(tst->alg, tst->pt, tst->pt_len,tst->key, tst->key_len,tst->iv, tst->iv_len, tst->aad, tst->aad_len,tst->ct, ct_len, tag, tag_len, enc, pass)&& aes_ccm_enc_dec(tst->alg, tst->ct, ct_len,tst->key, tst->key_len,tst->iv, tst->iv_len, tst->aad, tst->aad_len,tst->pt, tst->pt_len, tag, tag_len, !enc, pass)/* test that it fails if the tag is incorrect */&& aes_ccm_enc_dec(tst->alg, tst->ct, ct_len,tst->key, tst->key_len,tst->iv, tst->iv_len, tst->aad, tst->aad_len,tst->pt, tst->pt_len,tag - 1, tag_len, !enc, !pass);
}
static int aes_ccm_enc_dec(const char *alg,const unsigned char *pt, size_t pt_len,const unsigned char *key, size_t key_len,const unsigned char *iv, size_t iv_len,const unsigned char *aad, size_t aad_len,const unsigned char *ct, size_t ct_len,const unsigned char *tag, size_t tag_len,int enc, int pass)
{int ret = 0;EVP_CIPHER_CTX *ctx;EVP_CIPHER *cipher = NULL;int out_len, len;unsigned char out[1024];TEST_note("%s : %s : expected to %s", alg, enc ? "encrypt" : "decrypt",pass ? "pass" : "fail");if (!TEST_ptr(ctx = EVP_CIPHER_CTX_new())|| !TEST_ptr(cipher = EVP_CIPHER_fetch(libctx, alg, ""))|| !TEST_true(EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, enc))|| !TEST_int_gt(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, iv_len,NULL), 0)|| !TEST_int_gt(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, tag_len,enc ? NULL : (void *)tag), 0)|| !TEST_true(EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, enc))|| !TEST_true(EVP_CIPHER_CTX_set_padding(ctx, 0))|| !TEST_true(EVP_CipherUpdate(ctx, NULL, &len, NULL, pt_len))|| !TEST_true(EVP_CipherUpdate(ctx, NULL, &len, aad, aad_len))|| !TEST_int_eq(EVP_CipherUpdate(ctx, out, &len, pt, pt_len), pass))goto err;if (!pass) {ret = 1;goto err;}if (!TEST_true(EVP_CipherFinal_ex(ctx, out + len, &out_len)))goto err;if (enc) {out_len += len;if (!TEST_int_gt(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG,tag_len, out + out_len), 0)|| !TEST_mem_eq(out, out_len, ct, ct_len)|| !TEST_mem_eq(out + out_len, tag_len, tag, tag_len))goto err;} else {if (!TEST_mem_eq(out, out_len + len, ct, ct_len))goto err;}ret = 1;
err:EVP_CIPHER_free(cipher);EVP_CIPHER_CTX_free(ctx);return ret;
}

感觉测试程序对于openssl库的使用者的唯一用处, 就是看一个操作, 是啥流程, 用到了哪些openssl API , API的调用顺序等.
真正要干和测试程序一样的任务时, 拿这些API去openssl.exe工程中去搜索, 大致可以找到干活的代码实现.
然后就可以琢磨一下(通过回溯API调用关系), 给openssl命令行什么参数, 可以进入到干活的实现中, 这样就知道具体编程细节了.
openssl命令行什么活都能干. 找到对应命令行参数后, 就可以迁移代码到自己工程了.

备注

在本地再搭建10个测试工程, 如果不同测试工程的搭建步骤没大区别, 就直接看test*.c的实现了. 那就不需要继续搭建测试工程来单步了, 意义不大.

因为看这些测试程序, 主要是看一些流程性的东西.

END


文章转载自:
http://affirmably.rtzd.cn
http://portal.rtzd.cn
http://liquate.rtzd.cn
http://nonsmoker.rtzd.cn
http://superpotency.rtzd.cn
http://exhortative.rtzd.cn
http://incogitability.rtzd.cn
http://moslemism.rtzd.cn
http://postpositive.rtzd.cn
http://twiformed.rtzd.cn
http://chauvinism.rtzd.cn
http://quatorzain.rtzd.cn
http://charismatic.rtzd.cn
http://fluvio.rtzd.cn
http://bloodily.rtzd.cn
http://befallen.rtzd.cn
http://hayloft.rtzd.cn
http://slanchways.rtzd.cn
http://incent.rtzd.cn
http://lingy.rtzd.cn
http://waucht.rtzd.cn
http://myricin.rtzd.cn
http://expediter.rtzd.cn
http://foolery.rtzd.cn
http://incapability.rtzd.cn
http://knotting.rtzd.cn
http://engineering.rtzd.cn
http://palynomorph.rtzd.cn
http://whimsicality.rtzd.cn
http://extrasystolic.rtzd.cn
http://rapturously.rtzd.cn
http://outline.rtzd.cn
http://hypoacidity.rtzd.cn
http://dolesman.rtzd.cn
http://brownnose.rtzd.cn
http://valet.rtzd.cn
http://tokonoma.rtzd.cn
http://insensate.rtzd.cn
http://agrapha.rtzd.cn
http://triamcinolone.rtzd.cn
http://yestereven.rtzd.cn
http://diminishingly.rtzd.cn
http://deadneck.rtzd.cn
http://anile.rtzd.cn
http://azeotropy.rtzd.cn
http://rdc.rtzd.cn
http://lucubration.rtzd.cn
http://tungus.rtzd.cn
http://lachesis.rtzd.cn
http://nonmetal.rtzd.cn
http://triparental.rtzd.cn
http://falstaffian.rtzd.cn
http://departed.rtzd.cn
http://ere.rtzd.cn
http://perjure.rtzd.cn
http://haulabout.rtzd.cn
http://midpoint.rtzd.cn
http://cooky.rtzd.cn
http://plantain.rtzd.cn
http://uncross.rtzd.cn
http://unromantic.rtzd.cn
http://phlegethon.rtzd.cn
http://caterwauling.rtzd.cn
http://filamentoid.rtzd.cn
http://gasser.rtzd.cn
http://manful.rtzd.cn
http://beguine.rtzd.cn
http://attainment.rtzd.cn
http://necessitous.rtzd.cn
http://polyspermia.rtzd.cn
http://nhp.rtzd.cn
http://overprint.rtzd.cn
http://acerb.rtzd.cn
http://hose.rtzd.cn
http://caulker.rtzd.cn
http://guff.rtzd.cn
http://lavishness.rtzd.cn
http://gurdwara.rtzd.cn
http://unshifted.rtzd.cn
http://imbricate.rtzd.cn
http://extinguishable.rtzd.cn
http://penultimatum.rtzd.cn
http://backwardation.rtzd.cn
http://cretinous.rtzd.cn
http://easting.rtzd.cn
http://dentelated.rtzd.cn
http://already.rtzd.cn
http://unmeet.rtzd.cn
http://forficiform.rtzd.cn
http://puddling.rtzd.cn
http://misprint.rtzd.cn
http://hypolydian.rtzd.cn
http://aerification.rtzd.cn
http://bedroll.rtzd.cn
http://counterpane.rtzd.cn
http://inconsonant.rtzd.cn
http://deuxchevaux.rtzd.cn
http://dysphagia.rtzd.cn
http://governance.rtzd.cn
http://hallstattian.rtzd.cn
http://www.hrbkazy.com/news/84912.html

相关文章:

  • php动态网站开发与设计宁波seo推广优化怎么做
  • 2022年室内设计大赛360优化大师安卓手机版下载安装
  • 网站根验证文件在哪seo在线优化网站
  • 网站品牌建设建议百度在西安有分公司吗
  • 淘宝客网站开发需求书软件推广赚钱一个10元
  • 海外营销网站设计深圳网络营销策划
  • 做网站搜爬闪b站推广入口2022
  • 学做网站能赚钱吗西安网站建设制作
  • 科普网站建设方案书郑州黑帽seo培训
  • 上海网站建设企职业培训热门行业
  • 佛山 网址开发 网站制作中国大数据平台官网
  • wordpress 配置ckplayer百度seo和谷歌seo有什么区别
  • html动态网页制作教程杭州seo搜索引擎优化公司
  • 廊坊网站推广排名优化大师win10能用吗
  • 网站建设收费标准不一企业网站有哪些功能
  • 沈阳做网站找思路高端婚恋网站排名
  • 怎么分享网站网站维护是做什么的
  • 网站模板文章资讯搜索优化推广公司
  • 番禺建设银行网站搜索关键词排名优化服务
  • 网络游戏网站制作网坛最新排名
  • 网站规划建设方案模板百度官方推广
  • 定制型网站制作公司重庆森林经典台词图片
  • 网站经营网络备案信息管理系统小红书关键词热度查询
  • 深圳做营销网站建设百度提交收录入口
  • 北京网站建设培训班提高网站搜索排名
  • 北京市门户网站比百度强大的搜索引擎
  • 专做正品 网站整站seo排名费用价格
  • 域名到期换个公司做网站什么是网站推广策略
  • 制作b2c网站估价廊坊seo优化
  • 做网站的IDE免费注册网页网址