信息网络安全 ›› 2024, Vol. 24 ›› Issue (6): 855-862.doi: 10.3969/j.issn.1671-1122.2024.06.004

• 密码专题 • 上一篇    下一篇

一种抵御计时攻击的指数Bernoulli精确采样算法

杜育松1(), 江思维1, 沈静2, 张家豪1   

  1. 1.中山大学计算机学院,广州 510006
    2.广东工贸职业技术学院,广州 510510
  • 收稿日期:2024-04-06 出版日期:2024-06-10 发布日期:2024-07-05
  • 通讯作者: 杜育松 duyusong@mail.sysu.edu.cn
  • 作者简介:杜育松(1982—),男,河北,副教授,博士,主要研究方向为密码学|江思维(2000—),男,辽宁,硕士研究生,主要研究方向为密码学|沈静(1980—),女,浙江,讲师,硕士,主要研究方向为网络与信息安全|张家豪(2001—),男,广东,主要研究方向为保密管理
  • 基金资助:
    广东省基础与应用基础研究重大项目(2019B030302008);广东省基础与应用基础研究项目(2022A1515011512);广东工贸职业技术学院校级科研项目(2021-ZK-17)

An Algorithm for Sampling Exactly from Exponential Bernoulli Distributions with Resistance against Timing Attacks

DU Yusong1(), JIANG Siwei1, SHEN Jing2, ZHANG Jiahao1   

  1. 1. School of Computer Science and Engineering, Sun Yat-Sen University, Guangzhou 510006, China
    2. Guangdong Polytechnic of Industry and Commerce, Guangzhou 510510, China
  • Received:2024-04-06 Online:2024-06-10 Published:2024-07-05

摘要:

整数上的离散高斯采样是格密码的基础构建之一。拒绝采样是实现整数上离散高斯采样的一种主要的方法,而使用拒绝采样的关键是实现一个以指数函数为参数的Bernoulli分布的采样过程。这一采样过程也是决定整个采样算法能否抵御计时攻击的关键。对于实数x>0,借鉴SUN等人提出的一种针对指数函数Bernoulli分布β2-x的等时采样算法,文章给出了一种可供选择的针对Bernoulli分布β2-x的抵御计时攻击的精确采样算法,该算法能防止x的取值因计时攻击而遭到泄露,并且不需要(在线的)浮点运算,同时还能避免SUN等人的采样算法在实际实现中产生的统计误差,从而确保采样结果的精确性。实验结果验证了这一精确采样算法的有效性。

关键词: 格密码, 离散高斯采样, Bernoulli分布, 计时攻击

Abstract:

Discrete Gaussian sampling over the integers is one of the fundamental building blocks of lattice-based cryptography. Rejection sampling is one of the main methods for the discrete Gaussian sampling over the integers. The key of using rejection sampling is to implement a sampling procedure for Bernoulli distributions with exponential functions as parameters, and this sampling procedure is also the key to determine whether the whole sampling algorithm can resist timing attacks. For a real x > 0, based on the isochronous sampling algorithm given by SUN et al. for the “exponential Bernoulli distribution” β2-x, an alternative exact sampling algorithm with timing attack resistance is proposed for β2-x. It can prevent the leakage of the information on the value of x caused by timing attacks, and does not require (online) floating-point arithmetic, and can also avoid the statistical error in the practical implementation of the sampling algorithm of SUN et al., so as to ensure the exactness of sampling results in practice. Experimental results demonstrate the effectiveness of this exact sampling algorithm.

Key words: lattice-based cryptography, discrete Gaussian sampling, Bernoulli distribution, timing attack

中图分类号: