dudect_bencher test for constant-time函数

密码学中,constant-time函数可从软件层面预防side-channel攻击,对于constant-time函数的测试验证,可通过dudect_bencher来实现。

dudect_bencher的论文依据为《Dude, is my code constant time?》,基于统计学的角度来分析函数是否为constant-time。

https://github.com/brycx/orion-dudect/tree/subtle-short-circuit/ct-bencher中对subtlect-eq函数的constant-time一致性测试的结果,表现为:

git clone https://github.com/brycx/orion-dudect.git
cd orin-dudect
git checkout subtle-short-circuit
bash run_benches_stable.sh

在这里插入图片描述
其中输出信息的含义为:

  • max_t:为t-value的最大值。
  • n:计算t-value所用到的样本数量。
  • max_tau:计算方式为max_tau=max_t/sqrt(n)
  • (5/tau)^2:为t>5时,区分不同分布需要的计算次数。

通常地,认为max_t>5时,该函数的为not constant-time。但是,当max_t<5时,也不意味着该函数就肯定是constant-time。
t-values greater than 5 are generally considered a good indication that the function is not constant time. t-values less than 5 does not necessarily imply that the function is constant-time, since there may be other input distributions under which the function behaves significantly differently.

参考资料:
[1] https://github.com/rozbb/dudect-bencher
[2] Dude, is my code constant time?

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值