[go: up one dir, main page]

JP2018005702A - Random number generator, random number generation method, and random number generation program - Google Patents

Random number generator, random number generation method, and random number generation program Download PDF

Info

Publication number
JP2018005702A
JP2018005702A JP2016133851A JP2016133851A JP2018005702A JP 2018005702 A JP2018005702 A JP 2018005702A JP 2016133851 A JP2016133851 A JP 2016133851A JP 2016133851 A JP2016133851 A JP 2016133851A JP 2018005702 A JP2018005702 A JP 2018005702A
Authority
JP
Japan
Prior art keywords
random number
function
value
candidate data
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2016133851A
Other languages
Japanese (ja)
Other versions
JP6678926B2 (en
Inventor
裕貴 太中
Yuki Tanaka
裕貴 太中
良範 青野
Yoshinori Aono
良範 青野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
National Institute of Information and Communications Technology
Original Assignee
NEC Corp
National Institute of Information and Communications Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp, National Institute of Information and Communications Technology filed Critical NEC Corp
Priority to JP2016133851A priority Critical patent/JP6678926B2/en
Publication of JP2018005702A publication Critical patent/JP2018005702A/en
Application granted granted Critical
Publication of JP6678926B2 publication Critical patent/JP6678926B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

【課題】記憶領域が限られた装置上においても、分散値の大きい離散ガウス分布に従う乱数を効率的に生成すること。【解決手段】候補計算部は、確率分布の累積分布函数をそれぞれ上側および下側で挟む形の上側近似函数および下側近似函数の一方を第一近似函数として所有し、乱数データに第一近似函数の逆函数を作用させ、整数丸めを取って得られる第一丸め値を計算し、第一丸め値を出力候補データとして出力する。第一評価部は、上側近似函数および下側近似函数の他方を第二近似函数として所有し、出力候補データを受け、乱数データに第二近似函数の逆函数を作用させ、整数丸めを取って得られる第二丸め値を計算し、第二丸め値が出力候補データに等しいか否かを判定し、第二丸め値が出力候補データに等しいときに、出力候補データを確率分布に従った乱数として出力する。【選択図】図1PROBLEM TO BE SOLVED: To efficiently generate a random number according to a discrete Gaussian distribution having a large variance value even on a device having a limited storage area. A candidate calculation unit has one of an upper approximation function and a lower approximation function that sandwich a cumulative distribution function of a probability distribution on the upper side and the lower side, respectively, as a first approximation function, and first approximation to random number data. The first rounding value obtained by taking the integer rounding is calculated by applying the inverse function of the function, and the first rounding value is output as output candidate data. The first evaluation unit owns the other of the upper approximation function and the lower approximation function as the second approximation function, receives the output candidate data, applies the inverse function of the second approximation function to the random number data, and rounds the integers. Calculates the obtained second rounded value, determines whether the second rounded value is equal to the output candidate data, and when the second rounded value is equal to the output candidate data, the output candidate data is a random number according to the probability distribution. Output as. [Selection diagram] Fig. 1

Description

本発明は、離散ガウス分布に従う乱数を生成する、乱数生成装置、乱数生成方法、および乱数生成プログラムに関する。   The present invention relates to a random number generation device, a random number generation method, and a random number generation program that generate random numbers according to a discrete Gaussian distribution.

まず、離散ガウス分布を定義する。実数の集合に属する実数値sにより定まる函数

Figure 2018005702
として、整数の集合に属する整数値uを確率
Figure 2018005702
で出力した分布を、分散値がsの離散ガウス分布と呼ぶ。ここで、πは円周率を表し、expは自然対数の底を表す。 First, a discrete Gaussian distribution is defined. A function determined by a real value s belonging to a set of real numbers
Figure 2018005702
As an integer value u belonging to the set of integers
Figure 2018005702
The distribution output in is called a discrete Gaussian distribution with a variance value of s. Here, π represents the pi, and exp represents the natural logarithm base.

この離散ガウス分布に従って生成された乱数は、格子暗号に用いられる(例えば、非特許文献1参照)。格子暗号は耐量子暗号として期待され、計算効率が良く、機能性の高い暗号スキームとして研究されている暗号システムである。   Random numbers generated according to this discrete Gaussian distribution are used for lattice encryption (for example, see Non-Patent Document 1). Lattice cryptosystems are cryptographic systems that are expected as quantum-proof cryptosystems and are studied as cryptographic schemes with high computational efficiency and high functionality.

離散ガウス分布は全ての整数値を取りうる確率分布である。離散ガウス分布を格子暗号として用いる場合、次のように、分布の出力する整数値の範囲を、自然数の集合に属する、セキュリティパラメータnに依存する形で制限する事で、確率変数の生成を効率化する事が多い。つまり、

Figure 2018005702
として
Figure 2018005702
を離散ガウス分布の出力範囲とする。分布が出力する整数の範囲をこのように制限しても、格子暗号の安全性に影響を与えないことが知られている。 The discrete Gaussian distribution is a probability distribution that can take all integer values. When the discrete Gaussian distribution is used as a lattice cipher, it is possible to efficiently generate random variables by limiting the range of integer values output by the distribution in a manner that depends on the security parameter n belonging to the set of natural numbers as follows: Often becomes. That means
Figure 2018005702
As
Figure 2018005702
Is the output range of the discrete Gaussian distribution. It is known that even if the range of integers output by the distribution is restricted in this way, the security of lattice encryption is not affected.

正規化定数Wを

Figure 2018005702
と定義するとき、分布が出力する整数の範囲を上述のように制限した離散ガウス分布は、
Figure 2018005702
とおき、このΨ(x)を用いて、整数の集合に属する整数値uを確率Ψ(u)で出力する。 Normalization constant W
Figure 2018005702
The discrete Gaussian distribution with the range of integers output by the distribution restricted as described above is
Figure 2018005702
Then, using this Ψ (x), an integer value u belonging to the set of integers is output with a probability Ψ (u).

そこで本明細書では、以下「離散ガウス分布」といったら、分布が出力する整数の範囲が

Figure 2018005702
であり、整数の集合に属する整数値uを確率Ψ(u)で出力する確率分布を指すものとする。 Therefore, in this specification, the range of integers output by the distribution is referred to as “discrete Gaussian distribution” below.
Figure 2018005702
And a probability distribution that outputs an integer value u belonging to a set of integers with probability Ψ (u).

また、函数

Figure 2018005702
を、「離散ガウス分布を定める函数」と呼ぶことにする。 Also, the function
Figure 2018005702
Is called “a function that determines a discrete Gaussian distribution”.

離散ガウス分布に従う乱数生成方法として、累積法と棄却サンプル法との二つが知られている。ここでは、離散ガウス分布を定める函数をφ(x)とし、分布の生成範囲を

Figure 2018005702
とする。 As a random number generation method according to the discrete Gaussian distribution, two methods, the accumulation method and the rejection sample method, are known. Here, the function that defines the discrete Gaussian distribution is φ (x), and the generation range of the distribution is
Figure 2018005702
And

まず累積法について、非特許文献2の記載に基づいて説明する。図7に示すように、この非特許文献2に開示された、第1の関連技術に係る離散ガウス分布に従う乱数生成装置200は、記憶装置210と、探索器220と、一様乱数生成器230とから成る。   First, the accumulation method will be described based on the description of Non-Patent Document 2. As shown in FIG. 7, the random number generation device 200 according to the discrete Gaussian distribution according to the first related technique disclosed in Non-Patent Document 2 includes a storage device 210, a searcher 220, and a uniform random number generator 230. It consists of.

このような構成を有する、第1の関連技術の離散ガウス分布に従う乱数生成装置200は、次のように動作する。   The random number generation device 200 according to the discrete Gaussian distribution of the first related technology having such a configuration operates as follows.

まず、乱数生成装置200は、値

Figure 2018005702
を事前計算し、記憶装置210に記憶しておく。次に、一様乱数生成器230が実数値x∈[0,1]を出力する。一様乱数生成器230から出力された、実数の集合に属する実数値xは、探索器220に送られる。 First, the random number generation device 200 generates a value
Figure 2018005702
Is pre-calculated and stored in the storage device 210. Next, the uniform random number generator 230 outputs a real value x∈ [0, 1]. The real value x belonging to the set of real numbers output from the uniform random number generator 230 is sent to the searcher 220.

探索器220は、記憶装置210に記憶されている値から、φ(z - 1)≦x≦φ(z)なる、整数の集合に属する整数値zを二分探索し、符号sign=±を一様に選び、整数の集合に属する

Figure 2018005702
を出力する。
以上が累積法による離散ガウス分布に従う乱数生成方法である。 The searcher 220 performs a binary search from the values stored in the storage device 210 for an integer value z belonging to the set of integers φ (z-1) ≦ x ≦ φ (z), and sets the sign sign = ±. Choose and belong to the set of integers
Figure 2018005702
Is output.
The above is the random number generation method according to the discrete Gaussian distribution by the accumulation method.

累積法では記憶装置210に記憶するデータ

Figure 2018005702
の数がtσに比例する。よって、累積法は、メモリ量が制限された装置上で、分散値σの大きい離散ガウス分布を生成することができないという問題がある。分散σは既存の格子暗号では大きな値になっている。具体的なメモリ量は、たとえば、非特許文献3では、下記の表1のようになっている。 In the accumulation method, data stored in the storage device 210
Figure 2018005702
Is proportional to tσ. Therefore, the accumulation method has a problem in that a discrete Gaussian distribution having a large variance value σ cannot be generated on a device with a limited amount of memory. The variance σ is a large value in the existing lattice encryption. The specific memory amount is, for example, as shown in Table 1 below in Non-Patent Document 3.

Figure 2018005702
Figure 2018005702

格子暗号は、RSA(Rivest-Shamir-Adleman)方式をはじめとした周知の暗号方式も計算量が少ない為、センサ機器や携帯電話のような計算資源や記憶容量が小さいデバイスでの利用が期待されている。しかしながら、格子暗号のサブルーチンである離散ガウス分布の生成に累積法を用いた場合、累積法で必要とするデータの保存に多くの記憶容量を使ってしまう。そのため、格子暗号をこのようなデバイスでは利用できなくなってしまう。   Lattice cryptography is expected to be used in devices with small computational resources and storage capacity, such as sensor devices and mobile phones, because well-known cryptosystems such as the RSA (Rivest-Shamir-Adleman) method require less computation. ing. However, when the accumulation method is used to generate a discrete Gaussian distribution, which is a subroutine of lattice encryption, a large amount of storage capacity is used for storing data required by the accumulation method. As a result, lattice encryption cannot be used on such devices.

次に、棄却サンプル法について説明する。棄却サンプル法は離散ガウス分布に限らず、任意の離散型確率分布に従った乱数を生成する際に適応できるものである。そこで、まず一般の離散型確率分布に従った確率変数Xに対する棄却サンプル法を、非特許文献4にしたがって説明する。その後で、離散ガウス分布に従った乱数を生成する棄却サンプル法について説明する。   Next, the rejection sample method will be described. The rejection sample method is not limited to the discrete Gaussian distribution, but can be applied when generating random numbers according to an arbitrary discrete probability distribution. Therefore, first, a rejection sample method for a random variable X according to a general discrete probability distribution will be described according to Non-Patent Document 4. After that, a rejection sample method for generating random numbers according to a discrete Gaussian distribution will be described.

離散型確率分布p(X=xi)に従う乱数を、棄却サンプル法を利用して生成するには、以下のようにする。 To generate a random number according to the discrete probability distribution p (X = x i ) using the rejection sample method, the following is performed.

まず、すべてのxに対して、t(xi)≧p(xi)を満足する函数t(x)で、函数t(x)を効率的に計算できるものを準備し、正規化をおこなったr(x)=t(x)/Σt(xi)とおく。 First, for all x i , prepare a function t (x) that satisfies t (x i ) ≧ p (x i ) and can calculate the function t (x) efficiently, and normalize it. Set r (x) = t (x) / Σt (x i ).

次の手順により、確率変数Xに対する離散型分布p(X=xi)(確率分布函数)に従う乱数の棄却サンプル法を行う。
(Step 1) 確率分布函数rをもつ乱数Yを生成する。
(Step 2) Yとは独立に区間[0,1]の一様乱数Uを発生させる。
(Step 3) U≦p(Y)/t(Y)を満たす場合は乱数としてX=Yとする。満たさない場合は(Step1)にもどる。
The random sample rejection sampling method according to the discrete distribution p (X = x i ) (probability distribution function) for the random variable X is performed by the following procedure.
(Step 1) Generate random number Y with probability distribution function r.
(Step 2) A uniform random number U in the interval [0, 1] is generated independently of Y.
(Step 3) When U ≦ p (Y) / t (Y) is satisfied, X = Y is set as a random number. If not, return to (Step 1).

次に離散ガウス分布に従う乱数を生成する方法を、非特許文献5に基づいて説明する。なお、非特許文献5に開示された方法を、後述する本発明のそれと比較するため、非特許文献5に開示された方法を実現するための装置構成についても付記する。   Next, a method for generating random numbers according to the discrete Gaussian distribution will be described based on Non-Patent Document 5. In addition, in order to compare the method disclosed in Non-Patent Document 5 with that of the present invention described later, an apparatus configuration for realizing the method disclosed in Non-Patent Document 5 is also appended.

非特許文献5では、上述した棄却サンプル法を函数t(x)が恒等的に1である場合に対して適応したものである。   In Non-Patent Document 5, the rejection sample method described above is applied to the case where the function t (x) is identically 1.

図8に示すように、この非特許文献5に開示された、第2の関連技術に係る離散ガウス分布に従う乱数生成装置300は、棄却判定器310と、乱数生成器320と、出力装置330とからなる。このような構成を有する、第2の関連技術の離散ガウス分布に従う乱数生成装置300は次のように動作する。   As shown in FIG. 8, the random number generation device 300 according to the discrete Gaussian distribution according to the second related technique disclosed in Non-Patent Document 5 includes a rejection determination unit 310, a random number generation unit 320, and an output unit 330. Consists of. The random number generation device 300 having such a configuration and following the discrete Gaussian distribution of the second related technology operates as follows.

すなわち、乱数生成器320が、整数の集合に属する

Figure 2018005702
の範囲で、整数の集合に属する一様乱数u1(整数値)を生成する。次に、乱数生成器320は、[0,φ(0)]の範囲で、実数の集合に属する実数値乱数u2を生成する。 That is, the random number generator 320 belongs to a set of integers.
Figure 2018005702
A uniform random number u 1 (integer value) belonging to the set of integers in the range of is generated. Next, the random number generator 320 generates a real value random number u 2 belonging to a set of real numbers in the range of [0, φ (0)].

次に、整数の集合に属する一様乱数u1と実数の集合に属する実数値乱数u2とが棄却判定器310に入力される。棄却判定器310は、φ(u1)と実数の集合に属するu2とを比較し、u2≦φ(u1)なら整数の集合に属するu1を出力する。 Next, the uniform random number u 1 belonging to the set of integers and the real value random number u 2 belonging to the set of real numbers are input to the rejection determination unit 310. Rejection determination unit 310 compares φ (u 1 ) with u 2 belonging to the set of real numbers, and outputs u 1 belonging to the set of integers if u 2 ≦ φ (u 1 ).

そうでなければ、乱数生成装置300は、最初のステップに戻り、同じ操作をやり直す。   Otherwise, the random number generation device 300 returns to the first step and repeats the same operation.

以上が棄却サンプル法による離散ガウス分布に従う乱数生成方法である。この棄却サンプル法に関する課題は、棄却されるごとにガウス分布関数を計算しなければならないので、計算効率がわるくなる点である。   The above is the random number generation method according to the discrete Gaussian distribution by the rejection sample method. The problem with this rejection sample method is that the Gaussian distribution function must be calculated each time it is rejected, resulting in a loss of calculation efficiency.

また、本発明に関連する先行技術文献(特許文献)も知られている。   Further, prior art documents (patent documents) related to the present invention are also known.

例えば、特許文献1は、秘密鍵共有の暗号システムに用いられる相関乱数を発生する相関乱数発生装置を開示している。この特許文献1に開示された相関乱数発生装置は、駆動用不規則信号発生部と、駆動用不規則信号伝送部と、第1乱数発生部と、第2乱数発生部とから構成される。第1乱数発生部は、乱数用不規則信号生成部と、パラメータ値生成部と、量子化部とを含んで構成される。また、第2乱数発生部も、乱数用不規則信号生成部と、パラメータ値生成部と、量子化部とを含んで構成される。量子化部は、乱数用不規則信号を量子化して離散化された乱数を出力する。   For example, Patent Document 1 discloses a correlated random number generator that generates a correlated random number used in a secret key sharing encryption system. The correlation random number generation device disclosed in Patent Document 1 includes a driving irregular signal generation unit, a driving irregular signal transmission unit, a first random number generation unit, and a second random number generation unit. The first random number generation unit includes a random number random signal generation unit, a parameter value generation unit, and a quantization unit. The second random number generation unit is also configured to include a random number random signal generation unit, a parameter value generation unit, and a quantization unit. The quantizing unit quantizes the random number random signal and outputs a randomized random number.

特許文献2は、得られる計算結果の精度を保証する損失分布計算システムを開示している。指定された頻度分布の累積分布函数をPf(・)と書くこととする。また、Pf(・)の確率函数(確率質量函数)をpf(・)と書くことにする。指定された規模分布の累積分布函数をPs(・)と書くこととする。また、Ps(・)が離散分布の場合は、その確率函数(確率質量函数)をps(・)、Psが連続分布の場合は、その確率密度関数をPs(・)と書くことにする。損失分布計算システムは、頻度分布蓄積手段と、規模分布蓄積手段と、規模分布離散化手段と、離散化規模分布蓄積手段とを含む。入力された頻度分布の情報は、頻度分布蓄積手段に蓄積される。規模分布離散化手段は、規模分布蓄積手段に蓄積されている規模分布Ps(・)に対して、上側離散化、または下側離散化、またはその両方をおこない、上側離散化規模分布Us(・)、または下側離散化規模分布Ds(・)、またはその両方を生成し、離散化規模分布蓄積手段に蓄積する。   Patent Document 2 discloses a loss distribution calculation system that guarantees the accuracy of the calculation results obtained. The cumulative distribution function of the specified frequency distribution is written as Pf (•). In addition, the probability function (probability mass function) of Pf (•) is written as pf (•). The cumulative distribution function of the designated size distribution is written as Ps (•). When Ps (·) is a discrete distribution, the probability function (probability mass function) is ps (·), and when Ps is a continuous distribution, the probability density function is written as Ps (·). The loss distribution calculation system includes frequency distribution storage means, scale distribution storage means, scale distribution discretization means, and discretized scale distribution storage means. The input frequency distribution information is stored in the frequency distribution storage means. The scale distribution discretization means performs the upper discretization, the lower discretization, or both on the scale distribution Ps (•) accumulated in the scale distribution accumulation means, and the upper discretization scale distribution Us (· ), Or the lower discretization scale distribution Ds (•), or both, is generated and stored in the discretization scale distribution storage means.

特開2008−070636号公報JP 2008-070636 A 国際公開第2011/037169号International Publication No. 2011/037169

Regev “On lattices, learning with errors, random linear codes, and cryptography ”, STOC 2005, ACM (2005), 84-93Regev “On lattices, learning with errors, random linear codes, and cryptography”, STOC 2005, ACM (2005), 84-93 Chris Peikert “An efficient and parallel Gaussian Sampler for lattices. ” , CRYPTO, 2010, pages 80-97Chris Peikert “An efficient and parallel Gaussian Sampler for lattices.”, CRYPTO, 2010, pages 80-97 DWARAKANATH , GALBRAITH “Sampling From Discrete Gaussians for Lattice-Based Cryptography on a Constrained Device ”DWARAKANATH, GALBRAITH “Sampling From Discrete Gaussians for Lattice-Based Cryptography on a Constrained Device” 四辻哲章 “計算機シュミレーションのための確率分布乱数生成法 ” 92ページ~93ページTetsuaki Shijo “Probability random number generator for computer simulation” pages 92-93 Craig Gentry, Chris Peikert , Vinod Vaikuntanathan “ How to Use a Short Basis: Trapdoors for Hard Lattices and New Cryptographic Constructions ”, STOC, 2008, pages 197-206Craig Gentry, Chris Peikert, Vinod Vaikuntanathan “How to Use a Short Basis: Trapdoors for Hard Lattices and New Cryptographic Constructions”, STOC, 2008, pages 197-206

離散ガウス分布に従う乱数生成方法には、上述したように、累積法と棄却サンプル法とがあるが、以下に、それぞれの課題を順番に述べる。   As described above, the random number generation method according to the discrete Gaussian distribution includes the accumulation method and the rejection sample method. Each problem will be described in turn below.

累積法に関しての問題点は、記憶領域が限られた装置上で、分散値の大きい離散ガウス分布に従う乱数を生成することが、非効率的にしか生成できないということである。その理由は、記憶領域が限られた装置では記憶領域に記憶すべき値

Figure 2018005702
をすべて記憶することができないからである。 The problem with the accumulation method is that generating random numbers according to a discrete Gaussian distribution with a large variance on a device with a limited storage area can only be generated inefficiently. The reason for this is the value that should be stored in the storage area for devices with limited storage area.
Figure 2018005702
It is because all cannot be memorized.

棄却サンプル法に関しての問題点は、離散ガウス分布に従う乱数の生成速度が遅い点である。その理由は、棄却されるごとにガウス分布函数を計算しなければならないので、計算効率がわるくなるからである。   The problem with the rejected sample method is that the generation speed of random numbers according to the discrete Gaussian distribution is slow. The reason is that the Gaussian distribution function must be calculated every time it is rejected, resulting in poor calculation efficiency.

尚、特許文献1は、与えられた確率分布にしたがって乱数を生成する装置を開示しているにすぎない。   Note that Patent Document 1 merely discloses an apparatus that generates random numbers according to a given probability distribution.

特許文献2は、規模分布に対して、上側離散化規模分布、または下側離散化規模分布、またはその両方を生成する技術的思想を開示しているに過ぎない。   Patent Document 2 merely discloses a technical idea for generating an upper discretization scale distribution, a lower discretization scale distribution, or both of the scale distributions.

本発明の目的は、上述したいずれかの課題を解決する、乱数生成装置、乱数生成方法、および乱数生成プログラムを提供することにある。   An object of the present invention is to provide a random number generation device, a random number generation method, and a random number generation program that solve any of the above-described problems.

本発明の乱数生成装置は、与えられた確率分布にしたがって乱数を生成する乱数生成装置であって、乱数データを生成する乱数生成器と;前記確率分布の累積分布函数をそれぞれ上側および下側で挟む形の上側近似函数および下側近似函数の一方を第一近似函数として所有し、前記乱数データに前記第一近似函数の逆函数を作用させ、整数丸めを取って得られる第一丸め値を計算し、該第一丸め値を出力候補データとして出力する候補計算部と;前記上側近似函数および前記下側近似函数の他方を第二近似函数として所有し、前記出力候補データを受け、前記乱数データに前記第二近似函数の逆函数を作用させ、整数丸めを取って得られる第二丸め値を計算し、前記第二丸め値が前記出力候補データに等しいか否かを判定し、前記第二丸め値が前記出力候補データに等しいときに、前記出力候補データを前記乱数として出力する第一評価部と;を備えることを特徴とする。   The random number generation device of the present invention is a random number generation device that generates random numbers according to a given probability distribution, a random number generator that generates random number data; and a cumulative distribution function of the probability distribution on an upper side and a lower side, respectively. One of the upper approximate function and the lower approximate function in the sandwiched form is owned as the first approximate function, the inverse function of the first approximate function is applied to the random number data, and the first rounded value obtained by taking the integer rounding is obtained. A candidate calculation unit that calculates and outputs the first rounded value as output candidate data; possesses the other of the upper approximate function and the lower approximate function as a second approximate function, receives the output candidate data, and receives the random number A second rounding value obtained by applying an inverse function of the second approximate function to the data and taking integer rounding, and determining whether the second rounding value is equal to the output candidate data; Double rounding value When equal to said output candidate data, the first evaluation portion outputs the output candidate data as said random number; characterized in that it comprises a.

本発明の乱数生成方法は、与えられた確率分布にしたがって乱数を生成する乱数生成方法であって、乱数生成器が、乱数データを生成し;候補計算部が、前記確率分布の累積分布函数をそれぞれ上側および下側で挟む形の上側近似函数および下側近似函数の一方を第一近似函数として所有し、前記乱数データに前記第一近似函数の逆函数を作用させ、整数丸めを取って得られる第一丸め値を計算し、該第一丸め値を出力候補データとして出力し;第一評価部が、前記上側近似函数および前記下側近似函数の他方を第二近似函数として所有し、前記出力候補データを受け、前記乱数データに前記第二近似函数の逆函数を作用させ、整数丸めを取って得られる第二丸め値を計算し、前記第二丸め値が前記出力候補データに等しいか否かを判定し、前記第二丸め値が前記出力候補データに等しいときに、前記出力候補データを前記乱数として出力する、ことを特徴とする。   The random number generation method of the present invention is a random number generation method for generating random numbers according to a given probability distribution, wherein a random number generator generates random number data; a candidate calculation unit calculates a cumulative distribution function of the probability distribution. One of the upper and lower approximate functions sandwiched between the upper and lower sides is owned as the first approximate function, and the inverse function of the first approximate function is applied to the random number data to obtain an integer round. A first rounded value to be output and output the first rounded value as output candidate data; a first evaluation unit owns the other of the upper approximate function and the lower approximate function as a second approximate function, Receiving output candidate data, operating the inverse function of the second approximate function on the random number data, calculating a second rounded value obtained by taking integer rounding, and whether the second rounded value is equal to the output candidate data Determine whether or not When serial second rounding value is equal to the output candidate data, and outputs the output candidate data as said random number, characterized in that.

本発明の乱数生成プログラムは、コンピュータを、確率分布の累積分布函数をそれぞれ上側および下側で挟む形の上側近似函数および下側近似函数の一方を第一近似函数として所有し、乱数生成器から生成された乱数データに前記第一近似函数の逆函数を作用させ、整数丸めを取って得られる第一丸め値を計算し、該第一丸め値を出力候補データとして出力する候補計算手段;および前記上側近似函数および前記下側近似函数の他方を第二近似函数として所有し、前記出力候補データを受け、前記乱数データに前記第二近似函数の逆函数を作用させ、整数丸めを取って得られる第二丸め値を計算し、前記第二丸め値が前記出力候補データに等しいか否かを判定し、前記第二丸め値が前記出力候補データに等しいときに、前記出力候補データを前記確率分布にしたがった乱数として出力する第一評価手段;として機能させる。   The random number generation program of the present invention possesses one of the upper approximate function and the lower approximate function in the form of sandwiching the cumulative distribution function of the probability distribution on the upper and lower sides as the first approximate function, respectively. Candidate calculation means for operating the inverse function of the first approximate function on the generated random data, calculating a first rounded value obtained by taking integer rounding, and outputting the first rounded value as output candidate data; and Owning the other of the upper approximate function and the lower approximate function as a second approximate function, receiving the output candidate data, applying the inverse function of the second approximate function to the random number data, and obtaining integer rounding A second rounded value is calculated, and it is determined whether the second rounded value is equal to the output candidate data, and when the second rounded value is equal to the output candidate data, the output candidate data is First evaluation means for outputting as a random number in accordance with the serial probability distribution; function as.

本発明によれば、記憶領域が限られた装置上においても、分散値の大きい離散ガウス分布に従う乱数を効率的に生成することができる。   According to the present invention, it is possible to efficiently generate random numbers according to a discrete Gaussian distribution having a large variance value even on an apparatus with a limited storage area.

本発明の第1の実施形態に係る乱数生成装置の構成を示すブロック図である。It is a block diagram which shows the structure of the random number generator which concerns on the 1st Embodiment of this invention. 図1に示した乱数生成装置に使用される、候補計算部の構成を示すブロック図である。It is a block diagram which shows the structure of the candidate calculation part used for the random number generator shown in FIG. 図1に示した乱数生成装置に使用される、第一評価部の構成を示すブロック図である。It is a block diagram which shows the structure of a 1st evaluation part used for the random number generator shown in FIG. 図1に示した乱数生成装置に使用される、第二評価部の構成を示す図である。It is a figure which shows the structure of the 2nd evaluation part used for the random number generator shown in FIG. 第1の実施形態に係る乱数生成装置の動作を示す流れ図である。It is a flowchart which shows operation | movement of the random number generator which concerns on 1st Embodiment. 本発明の第2の実施改訂に係る乱数生成装置の第二評価部の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the 2nd evaluation part of the random number generator which concerns on 2nd implementation revision of this invention. 第1の関連技術に係る離散ガウス分布に従う乱数生成装置の構成を示すブロック図である。It is a block diagram which shows the structure of the random number generator according to the discrete Gaussian distribution which concerns on a 1st related technique. 第2の関連技術に係る離散ガウス分布に従う乱数生成装置の構成を示すブロック図である。It is a block diagram which shows the structure of the random number generator according to the discrete Gaussian distribution which concerns on a 2nd related technique.

[本発明の問題解決手法]
本発明は、格子暗号及び署名に用いる、制限された装置上における離散ガウス分布に従う乱数を生成する、乱数生成装置、乱数生成方法、および乱数生成プログラムである。
[Problem solving method of the present invention]
The present invention is a random number generation device, a random number generation method, and a random number generation program for generating random numbers according to a discrete Gaussian distribution on a limited device, which are used for lattice encryption and signatures.

まず、本発明の理解を容易にするために、離散ガウス分布に対する累積分布函数を用いて、以下のようにして離散ガウス分布に従う乱数を生成できることについて述べる。
(Step1)実数値一様乱数u∈[0,1]をとる。
(Step2)実数値一様乱数uに対し、離散ガウス分布の累積分布函数の逆函数を作用させ、整数丸めを取る。
(Step3)符号(±)を一様に選び、(Step2)で得た値に付け、出力する。
First, in order to facilitate understanding of the present invention, it will be described that a random number according to a discrete Gaussian distribution can be generated using a cumulative distribution function for the discrete Gaussian distribution as follows.
(Step 1) Take a real-valued uniform random number u∈ [0,1].
(Step 2) The inverse function of the cumulative distribution function of discrete Gaussian distribution is applied to the real-valued uniform random number u, and integer rounding is performed.
(Step 3) Select the sign (±) uniformly, attach it to the value obtained in (Step 2), and output.

以上で述べた方法により、原理的には離散ガウス分布に従う乱数を生成できる。しかしながら、離散ガウス分布の累積分布函数

Figure 2018005702
の逆函数を効率的に計算するのは困難であるので、上述した方法をそのまま用いる事はできない。 By the method described above, it is possible in principle to generate a random number according to a discrete Gaussian distribution. However, the cumulative distribution function of the discrete Gaussian distribution
Figure 2018005702
Since it is difficult to efficiently calculate the inverse function of, the above method cannot be used as it is.

そこで、函数

Figure 2018005702
の逆函数を効率的に求める一手法として、整数の集合に属する定義域
Figure 2018005702
の値を記憶領域に保存し、これらを用いて函数Ψの逆函数を求める、というものがある。この方法を用いれば、φ(k)を求めるのに必要な計算時間が省略できるので、函数Ψの逆函数を効率的に求めることができる。 So, the function
Figure 2018005702
A domain belonging to a set of integers as a method for efficiently obtaining the inverse function of
Figure 2018005702
Is stored in a storage area, and the inverse function of the function Ψ is obtained by using these values. If this method is used, the calculation time required to obtain φ (k) can be omitted, so that the inverse function of the function Ψ can be obtained efficiently.

しかしながら、この手法を用いるには、φ(k)の値全てを記憶領域に保存しなければならない。本発明の目的は、記憶領域が限られた装置上においても分散値の大きい離散ガウス分布に従う乱数を生成する事にあるので、この手法では問題が解決されない。   However, to use this method, all values of φ (k) must be stored in the storage area. An object of the present invention is to generate a random number according to a discrete Gaussian distribution having a large variance value even on an apparatus having a limited storage area, and this method does not solve the problem.

そこで本発明では、函数Ψの逆函数Ψ−1(u)を以下のアイデアに基づいて、記憶領域をさほど消費することなく、分散値の大きい離散ガウス分布に従う乱数を効率的に生成することができるサンプル法を実現する。ここで、上付き文字−1又は{-1}は、逆函数を意味する。 Therefore, in the present invention, based on the following idea, the inverse function Ψ −1 (u) of the function Ψ can be efficiently generated with random numbers according to a discrete Gaussian distribution having a large variance value without consuming much storage space. A possible sample method is realized. Here, the superscript −1 or {−1} means an inverse function.

[A,Cの性質]
まず、離散ガウス分布に対する累積分布函数Ψ(x)を上下にはさむ。すなわち、実数xを定義域に持つ実数値函数A(x),C(x)として、以下の性質1〜4を満たすものを選ぶ:
性質1. 全ての非負実数xに対し、A(x)≧Ψ(x)≧C(x)
性質2. yに対する実数値函数A(y)の逆函数A−1(y)の整数丸めの値と、yに対する実数値函数C(y)の逆函数C−1(y)の整数丸めの値とは、多くのyに関して一致する。(性質1より、これらのyに対しては逆函数Ψ−1(y)の整数丸めの値も逆函数A−1(y)の整数丸めの値と一致する。)
性質3. Aの逆函数は効率的に計算できる。
性質4. 次のいずれかの性質が満たされている:
i. Cの逆函数が効率的に計算できる。
ii. Cが効率的に計算できる。
[Properties of A and C]
First, the cumulative distribution function Ψ (x) for the discrete Gaussian distribution is sandwiched up and down. That is, as the real valued functions A (x) and C (x) having the real number x in the domain, those satisfying the following properties 1 to 4 are selected:
Property 1. For all non-negative real numbers x, A (x) ≧ Ψ (x) ≧ C (x)
Property 2. What is the integer rounding value of the inverse function A −1 (y) of the real-valued function A (y) for y and the integer rounding value of the inverse function C −1 (y) of the real-valued function C (y) for y? Agree on many y. (From property 1, for these y, the integer rounding value of the inverse function Ψ −1 (y) also matches the integer rounding value of the inverse function A −1 (y).)
Property 3. The inverse function of A can be calculated efficiently.
Property 4. One of the following properties is met:
i. The inverse function of C can be calculated efficiently.
ii. C can be calculated efficiently.

以下、函数A(x)およびC(x)を、それぞれ、上側近似函数および下側近似函数と呼ぶことにする。   Hereinafter, the functions A (x) and C (x) will be referred to as the upper approximate function and the lower approximate function, respectively.

本発明では,これらの函数を用いる事で,前述したStep1, 2, 3を以下のように改良する。   In the present invention, the above-described Steps 1, 2, and 3 are improved as follows by using these functions.

まず(Step 1)では前述したのと同様、実数値一様乱数u∈[0,(1/2)]をとる。   First, in (Step 1), a real-valued uniform random number u∈ [0, (1/2)] is taken as described above.

次にStep 2では、函数Ψの逆函数Ψ−1(u)を直接計算する代わりに、函数Aの逆函数A−1(u)を計算する。性質1により、逆函数A−1(u)は効率的に計算でき、しかも性質2により、多くのuに対し、逆函数A−1(u)の整数丸めの値は逆函数Ψ−1(u)の整数丸めの値に等しい。 Next, in Step 2, instead of directly calculating the inverse function Ψ −1 (u) of the function Ψ, the inverse function A −1 (u) of the function A is calculated. Due to property 1, the inverse function A −1 (u) can be calculated efficiently, and due to property 2, for many u, the integer rounding value of the inverse function A −1 (u) is the inverse function Ψ −1 ( Equal to integer rounding value in u).

これは、すなわち、本発明では、多くのuに対し、函数Ψの逆函数Ψ−1(u)の整数丸めを効率的に計算できる事を意味する。 This means that in the present invention, integer rounding of the inverse function Ψ −1 (u) of the function Ψ can be efficiently calculated for many u.

(Step 1)で得た乱数uに対し、A−1(u)=Ψ−1(u)が実際に成立する事を確認するための十分条件として、本発明では、逆函数A−1(u)の整数丸めの値と逆函数C−1(u)の整数丸めの値とが一致している事を確認する。 As a sufficient condition for confirming that A −1 (u) = Ψ −1 (u) is actually satisfied with respect to the random number u obtained in (Step 1), in the present invention, the inverse function A −1 ( It is confirmed that the integer rounding value of u) matches the integer rounding value of the inverse function C −1 (u).

性質1より、これらが一致していれば、逆函数A−1(u)の整数丸めの値は逆函数Ψ−1(u)の整数丸めの値に等しいので、逆函数A−1(u)に(Step 3)の符号をつけた値を出力値とする。 If they match, the integer rounding value of the inverse function A −1 (u) is equal to the integer rounding value of the inverse function Ψ −1 (u), so that the inverse function A −1 (u ) To which the sign of (Step 3) is added is the output value.

ここで、逆函数A−1(u)の整数丸めの値(第一丸め値)と逆函数C−1(u)の整数丸めの値(第二丸め値)とが一致している事を確認する方法には2通りある。 Here, the integer rounding value (first rounding value) of the inverse function A −1 (u) and the integer rounding value (second rounding value) of the inverse function C −1 (u) match. There are two ways to check.

第一の方法は、函数Cの逆函数C−1(u)を計算し、逆函数A−1(u)の整数丸めの値(第一丸め値)と逆函数C−1(u)の整数丸めの値(第二丸め値)とを直接比較する、というものである。この方法は、逆函数C−1(u)の計算を伴うので、性質4.iが成立している場合に効率的に実行できる方法である。 The first method calculates the inverse function C −1 (u) of the function C, and calculates the integer rounding value (first rounded value) of the inverse function A −1 (u) and the inverse function C −1 (u). The integer rounding value (second rounding value) is directly compared. Since this method involves calculation of the inverse function C −1 (u), the property 4. This is a method that can be executed efficiently when i holds.

第二の方法は、iを逆函数A{-1}(u)の整数丸めの値(第一丸め値)としたときに、C(i-(1/2))を計算して、uと比較し、C(i-(1/2))≦uなら逆函数A{-1}と逆函数C{-1}の整数丸めの値は一致する、というものである。これは、(i-(1/2))≦C{-1}(u)より、

Figure 2018005702
から分かる。 The second method calculates C (i- (1/2)) when u is an integer rounding value (first rounding value) of the inverse function A {-1} (u), and u If C (i− (1/2)) ≦ u, the integer rounding values of the inverse function A {−1} and the inverse function C {−1} are the same. From (i- (1/2)) ≦ C {-1} (u)
Figure 2018005702
I understand.

この方法は函数C(u)の計算を伴うので、性質4.iiが成立している場合に効率的に実行できる方法である。   This method involves the calculation of the function C (u). This is a method that can be executed efficiently when ii holds.

また、函数Aの逆函数A−1(u)の整数丸めの値(第一丸め値)と函数Cの逆函数C−1(u)の整数丸めの値(第二丸め値)とが一致していないケースでは、本発明では函数Ψの逆函数Ψ−1(u)を直接求め、そこに(Step 3)の符号をつけたものを出力値とする。 The integer rounding value (first rounding value) of the inverse function A −1 (u) of the function A and the integer rounding value (second rounding value) of the inverse function C −1 (u) of the function C are the same. In the case of not doing so, in the present invention, the inverse function Ψ −1 (u) of the function Ψ is directly obtained, and the value obtained by adding the sign of (Step 3) is used as the output value.

ここで、函数ΨのΨ−1(u)の計算は効率的ではないので、このケースでは計算時間を要する事になる。しかしながら、性質2により、そもそもこのケースが起こることはめったにないので、本発明が必要とする計算時間の期待値は小さくてすむ。 Here, since the calculation of Ψ −1 (u) of the function Ψ is not efficient, a calculation time is required in this case. However, since this case rarely occurs in the first place due to the property 2, the expected value of the calculation time required by the present invention is small.

上側近似函数A(x)と下側近似函数C(x)の具体的な形に関しては、後述する[発明の実施の形態]で述べる。   Specific forms of the upper approximate function A (x) and the lower approximate function C (x) will be described in [Embodiment of the invention] described later.

なお、上側近似函数A(x)はどのように求めても良いが、たとえば上側近似函数A(x)をテイラー展開し、必要な有効数字を得るのに十分な項までを計算することで求める事ができる。下側近似函数C(x)、逆函数A−1(u)、逆函数C−1(u)も同様である。 The upper approximation function A (x) can be obtained in any way, but for example, it is obtained by Taylor expansion of the upper approximation function A (x) and calculating up to a term sufficient to obtain the necessary significant figures. I can do things. The same applies to the lower approximate function C (x), the inverse function A −1 (u), and the inverse function C −1 (u).

本発明では、上側近似函数A(x)と下側近似函数C(x)(ないしその逆函数)を計算するのに必要となるデータ(たとえばこれらの函数のテイラー展開の最初の数項の係数)のみを記憶領域に保存しておけば良い。したがって、本発明を用いれば、記憶容量が少ない装置上で、離散ガウス分布に従う乱数を効率的に発生することができる。   In the present invention, the data necessary to calculate the upper approximate function A (x) and the lower approximate function C (x) (or its inverse function) (for example, the coefficients of the first few terms of the Taylor expansion of these functions) ) Only in the storage area. Therefore, by using the present invention, it is possible to efficiently generate random numbers according to the discrete Gaussian distribution on an apparatus with a small storage capacity.

上では、性質1〜性質4を満たす函数A, Cを用いる事で本発明を実現したが、性質3および性質4の代わりに、以下の性質5および性質6を満たす函数A, Cを用いても、本発明を実現できる。
性質5. Cの逆関数は効率的に計算できる。
性質6. 次のいずれかの性質が満たされている:
i. Aの逆関数が効率的に計算できる。
ii. Aが効率的に計算できる。
In the above, the present invention is realized by using the functions A and C satisfying the properties 1 to 4, but instead of the properties 3 and 4, the functions A and C satisfying the following properties 5 and 6 are used. Also, the present invention can be realized.
Property 5. The inverse function of C can be calculated efficiently.
Property 6 One of the following properties is met:
i. The inverse function of A can be calculated efficiently.
ii. A can be calculated efficiently.

性質5および性質6は、性質3および性質4においてAとCを入れ替えたものである。よって、前述した本発明のアイデアでAとCとを入れ替えれば、性質5および性質6を満たすAとCに対しても、本発明を適応できる。   Property 5 and property 6 are obtained by replacing A and C in property 3 and property 4. Therefore, if A and C are interchanged in the idea of the present invention described above, the present invention can be applied to A and C satisfying properties 5 and 6.

以上のようにして、本発明の目的を達成することができる。具体的な方法については、後述する実施の形態に記載する。   As described above, the object of the present invention can be achieved. A specific method will be described in an embodiment described later.

次に、本発明の効果について説明する。   Next, the effect of the present invention will be described.

第1の効果は、メモリ量、すなわち記憶容量が制限された装置上においても、離散ガウス分布に従う乱数を生成できる点にある。   The first effect is that a random number according to a discrete Gaussian distribution can be generated even on a device having a limited memory capacity, that is, a storage capacity.

累積法では

Figure 2018005702
の値を100bitで記憶する。 In the cumulative method
Figure 2018005702
Is stored in 100bit.

棄却サンプル法では、ガウス函数の多項式近似式における係数を記憶する。   In the rejection sample method, a coefficient in a polynomial approximation formula of a Gauss function is stored.

これに対して、本発明では、ガウス函数の多項式近似式における係数、上側近似函数の逆函数、下側近似函数の逆函数の多項式近似式における係数を記憶する。   On the other hand, in the present invention, the coefficient in the polynomial approximation formula of the Gaussian function, the inverse function of the upper approximation function, and the coefficient in the polynomial approximation formula of the inverse function of the lower approximation function are stored.

このことから、本発明では、メモリ量が制限された装置上でも、分散値が大きい離散ガウス分布の生成を行うことができる。よって、本発明を格子暗号のサブルーチンと用いる事で、センサ機器や携帯電話のような計算資源や記憶容量が小さいデバイスでの利用が期待される。   Thus, in the present invention, a discrete Gaussian distribution having a large variance value can be generated even on an apparatus with a limited amount of memory. Therefore, by using the present invention as a lattice encryption subroutine, it is expected to be used in a device with a small computing resource and storage capacity such as a sensor device or a mobile phone.

第2の効果は、計算効率が改善できる点にある。   The second effect is that the calculation efficiency can be improved.

累積法では、1つの出力値に対して、2分探索の計算量を必要とする。   In the accumulation method, the calculation amount of the binary search is required for one output value.

棄却サンプル法では、1つの出力値に対して、

Figure 2018005702
を必要とする。 In the rejection sample method, for one output value,
Figure 2018005702
Need.

これに対して、本発明では、高確率で(上側近似函数の逆函数の計算)+(下側近似函数の逆函数の計算)であるので、1つの出力値に対して、効率的に乱数を生成することが期待できる。   On the other hand, in the present invention, with high probability (calculation of the inverse function of the upper approximate function) + (calculation of the inverse function of the lower approximate function), it is possible to efficiently generate a random number for one output value. Can be expected to generate

[発明の実施の形態]
以下、本発明の実施の形態について、図面を参照しつつ詳細に説明する。なお、同一の要素には同一の符号を付し,重複する説明を省略する場合がある。
[Embodiment of the Invention]
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In addition, the same code | symbol is attached | subjected to the same element and the overlapping description may be abbreviate | omitted.

[第1の実施形態]
[構成の説明]
図1を参照すると、本発明の第1の実施形態に係る乱数生成装置は、プログラム制御により動作するコンピュータ(中央処理装置;プロセッサ;データ処理装置)90と、一様乱数を[0.1]の範囲で生成する一様乱数生成部100と、出力装置140とを備えている。
[First Embodiment]
[Description of configuration]
Referring to FIG. 1, a random number generation device according to a first embodiment of the present invention includes a computer (central processing unit; processor; data processing unit) 90 that operates under program control, and a uniform random number in a range of [0.1]. The uniform random number generation unit 100 that generates the output device 140 and the output device 140.

コンピュータ90は、候補計算部110と、第一評価部120と、第二評価部130とを含む。出力装置140は符号決定部141を含む。   The computer 90 includes a candidate calculation unit 110, a first evaluation unit 120, and a second evaluation unit 130. The output device 140 includes a code determination unit 141.

ここでは、

Figure 2018005702
here,
Figure 2018005702

図2に示されるように、候補計算部110は、乱数入力部111と、上側近似逆函数計算部112とを含む。   As shown in FIG. 2, the candidate calculation unit 110 includes a random number input unit 111 and an upper approximate inverse function calculation unit 112.

図3に示されるように、第一評価部120は、候補データ入力部121と、下側近似逆函数計算部122とを含む。   As shown in FIG. 3, the first evaluation unit 120 includes a candidate data input unit 121 and a lower approximate inverse function calculation unit 122.

図4に示されるように、第二評価部130は、棄却判定部131と、乱数生成部132とを含む。   As shown in FIG. 4, the second evaluation unit 130 includes a rejection determination unit 131 and a random number generation unit 132.

図5を参照して、図1に示した乱数生成装置の動作について説明する。   The operation of the random number generation device shown in FIG. 1 will be described with reference to FIG.

一様乱数生成部100は乱数データu∈[0,(1/2)]を出力する(ステップS501)。   The uniform random number generator 100 outputs random number data uε [0, (1/2)] (step S501).

次に一様乱数生成部100により出力された、実数の集合に属する乱数データuは候補計算部110の乱数入力部111に送られる。   Next, the random number data u belonging to the set of real numbers output by the uniform random number generation unit 100 is sent to the random number input unit 111 of the candidate calculation unit 110.

以下に述べる候補計算部110と第一評価部120との動作において、次の二つの函数を考える。一つの函数は、離散ガウス分布の累積分布函数より真に大きい函数(以下、「上側近似函数」とよび、A(x)とおく)である。もう一方の函数は、累積分布函数より真に小さい函数(以下、「下側近似函数」とよび、C(x)とおく)である。   In the operation of the candidate calculation unit 110 and the first evaluation unit 120 described below, the following two functions are considered. One function is a function that is truly larger than the cumulative distribution function of the discrete Gaussian distribution (hereinafter referred to as the “upper approximation function” and referred to as A (x)). The other function is a function that is truly smaller than the cumulative distribution function (hereinafter referred to as “lower approximate function” and referred to as C (x)).

例えば上側近似函数として

Figure 2018005702
を考え、下側近似函数として
Figure 2018005702
を考える。 For example, the upper approximation function
Figure 2018005702
As a lower approximation function
Figure 2018005702
think of.

以下の説明では、候補計算部110に上側近似函数が含まれ、第一評価部120に下側近似函数が含まれるとして説明する。しかしながら、候補計算部110に下側近似函数が含まれ、第一評価部120に上側近似函数が含まれるようにしてもよい。   In the following description, it is assumed that the candidate calculation unit 110 includes an upper approximate function and the first evaluation unit 120 includes a lower approximate function. However, the candidate calculation unit 110 may include the lower approximate function, and the first evaluation unit 120 may include the upper approximate function.

候補計算部110の上側近似逆函数計算部112は、上側近似函数を持つ。上側近似逆函数計算部112は、乱数入力部111から受けた乱数データuに対して、上側近似函数A(u)の逆函数A{-1}(u)を計算することで、最終的に出力したい整数値(第一丸め値)の出力候補データ113として、[A{-1}(u)]と[A{-1}(u)]-1を2つ出力する(ステップS502)。 The upper approximate inverse function calculator 112 of the candidate calculator 110 has an upper approximate function. The upper approximate inverse function calculation unit 112 finally calculates the inverse function A {-1} (u) of the upper approximate function A (u) with respect to the random number data u received from the random number input unit 111. [A {-1} (u)] and [A {-1} (u)]-1 are output as the output candidate data 113 of the integer value (first rounded value) to be output (step S502).

この出力候補データ113は、第一評価部120へ送られる。   This output candidate data 113 is sent to the first evaluation unit 120.

第一評価部120の下側近似逆函数計算部122は、乱数データuに対して、下側近似函数C(x)の逆函数C{-1}(u)を整数丸めした値(第二の丸め値)[C{-1}(u)]を計算した後、整数値[C{-1}(u)]と[A{-1}(u)]の値が等しいかどうかを判定する(ステップS503)。 The lower approximate inverse function calculation unit 122 of the first evaluation unit 120 rounds the inverse function C {−1} (u) of the lower approximate function C (x) to the random number data u by integer rounding (the second rounding value) after calculating the [C {-1} (u) ], determines whether the value of the integer value [C {-1} (u) ] and [a {-1} (u) ] is equal to (Step S503).

ここで、[A{-1}(u)]=[C{-1}(u)]の判定方法には二種類ある。
第一の方法は、[A{-1}(u)]と[C{-1}(u)]とを計算し、一致をみる方法である。
第二の方法は、uとC([A{-1}(u)]-(1/2))との大小関係を比較して、u≧C([A{-1}(u)]-(1/2))なら[C{-1}(u)]=[A{-1}(u)]と判定でき、そうでなければ値が異なると判定する方法である。
Here, there are two kinds of determination methods of [A {-1} (u)] = [C {-1} (u)].
The first method is to calculate [A {-1} (u)] and [C {-1} (u)] and see a match.
The second method compares the magnitude relationship between u and C ([A {-1} (u)]-(1/2)), and u ≧ C ([A {-1} (u)] -(1/2)), it can be determined that [C {-1} (u)] = [A {-1} (u)]; otherwise, the value is determined to be different.

これら2つの方法のうちどちらの方法を選ぶかは、上側近似函数A(x)、下側近似函数C(x)の選び方による(上述した[A, Cの性質]を参照)。   Which of these two methods is selected depends on how the upper approximate function A (x) and the lower approximate function C (x) are selected (see the above [Properties of A and C]).

この判定で、整数値[C{-1}(u)]と[A{-1}(u)]の値が等しければ、第一評価部120は、整数値[A{-1}(u)]=[C{-1}(u)]を出力装置140へ送信する。 If the values of the integer values [C {-1} (u)] and [A {-1} (u)] are equal in this determination, the first evaluation unit 120 determines that the integer value [A {-1} (u )] = [C {−1} (u)] is transmitted to the output device 140.

出力装置140の符号決定部141は、符号±を決定し、[A{-1}(u)]=[C{-1}(u)]に符号をつけ出力する(ステップS504)。 The code determination unit 141 of the output device 140 determines the sign ±, and adds [A {-1} (u)] = [C {-1} (u)] with a code (step S504).

値が異なれば、第一評価部120は、整数値[A{-1}(u)]を第二評価部130へ送信する。 If the values are different, the first evaluation unit 120 transmits the integer value [A {-1} (u)] to the second evaluation unit 130.

第二評価部130の棄却判定部131は、a=[A{-1}(u)]としたとき、

Figure 2018005702
を比較し、
Figure 2018005702
a-1を出力し、そうでなければaを出力装置140へ送信する(ステップS505)。 When the rejection determination unit 131 of the second evaluation unit 130 sets a = [A {-1} (u)],
Figure 2018005702
Compare
Figure 2018005702
a-1 is output, otherwise a is transmitted to the output device 140 (step S505).

出力装置140は、送られてきたデータを符号決定部141へ送信する。符号決定部141は、符号(±)を出力装置140により送られたデータにつけ、出力する(ステップS506)。   The output device 140 transmits the transmitted data to the code determination unit 141. The code determination unit 141 adds the code (±) to the data sent by the output device 140 and outputs the data (step S506).

[第1の実施形態の効果の説明]
次に、本第1の実施形態の効果について説明する。
[Description of Effects of First Embodiment]
Next, the effect of the first embodiment will be described.

本第1の実施形態では、まず出力の候補を効率的に生成し、効率的かつ高確率で第一評価部120において一つに絞るというように構成されているため、効率的にサンプルできる。さらには、誤差函数の逆函数の多項式のみ記憶すればよいので、少ない記憶容量の装置上であっても離散ガウス分布に従う乱数が生成できる。   In the first embodiment, output candidates are first efficiently generated, and the first evaluation unit 120 is configured to efficiently and with high probability, the sample can be efficiently sampled. Furthermore, since it is only necessary to store the polynomial of the inverse function of the error function, random numbers according to the discrete Gaussian distribution can be generated even on a device with a small storage capacity.

[第2の実施形態]
[構成の説明]
次に、本発明の第2の実施形態について図面を参照して詳細に説明する。
[Second Embodiment]
[Description of configuration]
Next, a second embodiment of the present invention will be described in detail with reference to the drawings.

第2の実施形態に係る乱数生成装置は、図1乃至図4に図示した第1の実施形態に係る乱数生成装置と構成上では実質的に同一であるが、第二評価部130の動作のみが異なる。   The random number generation device according to the second embodiment is substantially the same in configuration as the random number generation device according to the first embodiment illustrated in FIGS. 1 to 4, but only the operation of the second evaluation unit 130. Is different.

[動作の説明]
次に、図6を参照して、第2の実施の形態に係る第二評価部130の動作について説明する。
[Description of operation]
Next, the operation of the second evaluation unit 130 according to the second embodiment will be described with reference to FIG.

第二評価部130は、出力候補データaを受け取り、函数φ(x+1)と函数φ(x)とを用いて、棄却サンプル法を行う。   The second evaluation unit 130 receives the output candidate data a, and performs a rejection sample method using the function φ (x + 1) and the function φ (x).

まず、乱数生成部132は、ステップS601では、0〜a-1の実数範囲で実数の集合に属する乱数u1(実数値)を生成し、さらに整数の集合に属する整数値kにおける{k+(1/2)}から乱数u1に最近の整数値kを取る。 First, in step S601, the random number generation unit 132 generates a random number u 1 (real value) belonging to a set of real numbers in a real number range of 0 to a−1, and further {k + ( 1/2)} takes a random integer u 1 to the latest integer value k.

次に、乱数生成部132は、ステップS602では、0〜φ(0) の実数範囲で乱数u2を生成する。 Next, in step S602, the random number generation unit 132 generates a random number u 2 in the real number range of 0 to φ (0).

次に、第二評価部130の棄却判定部131は、ステップS603では、

Figure 2018005702
であるかを判定する。もし
Figure 2018005702
でない場合は、棄却判定部131は、ステップS601に戻る。もし
Figure 2018005702
であるなら、棄却判定部131は、ステップS604へ進み、
Figure 2018005702
であるか否かを判定する。もし
Figure 2018005702
であるなら、棄却判定部131はaを出力し(ステップS605)、そうでなければ、棄却判定部131は、a-1を出力する(ステップS606)。 Next, in step S603, the rejection determination unit 131 of the second evaluation unit 130
Figure 2018005702
It is determined whether it is. if
Figure 2018005702
If not, rejection determination unit 131 returns to step S601. if
Figure 2018005702
If so, rejection determination section 131 proceeds to step S604,
Figure 2018005702
It is determined whether or not. if
Figure 2018005702
If so, rejection determination section 131 outputs a (step S605). Otherwise, rejection determination section 131 outputs a-1 (step S606).

[第2の実施形態の効果の説明]
次に、本第2の実施形態の効果について説明する。
[Description of Effects of Second Embodiment]
Next, the effect of the second embodiment will be described.

本第2の実施形態では、まず出力の候補を効率的に生成し、効率的かつ高確率で第一評価部において一つに絞るというように構成されているため、効率的にサンプルできる。さらには、誤差函数の逆函数の多項式のみ記憶すればよいので、少ない記憶容量の装置上であっても離散ガウス分布に従う乱数を生成することができる。   In the second embodiment, output candidates are first efficiently generated, and the first evaluation unit is configured to efficiently and with high probability, the sample can be efficiently sampled. Furthermore, since only the inverse polynomial of the error function needs to be stored, random numbers according to the discrete Gaussian distribution can be generated even on a device with a small storage capacity.

[発明の効果の説明]
次に、本発明の効果について説明する。
[Explanation of the effect of the invention]
Next, the effect of the present invention will be described.

第1の効果は、メモリ量、すなわち記憶容量が制限された装置上においても離散ガウス分布に従う乱数を生成することができることである。
第2の効果は、計算効率を改善できることである。
The first effect is that random numbers that follow a discrete Gaussian distribution can be generated even on a device with a limited memory capacity, that is, a storage capacity.
The second effect is that the calculation efficiency can be improved.

なお、本発明は、上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、複数の構成要素の適宜な組合せにより種々の発明を形成できる。   Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. Various inventions can be formed by appropriately combining a plurality of components.

尚、乱数生成装置の各部は、ハードウェアとソフトウェアとの組み合わせを用いて実現すればよい。ハードウェアとソフトウェアとを組み合わせた形態では、RAM(random access memory)に乱数生成プログラムが展開され、該乱数生成プログラムに基づいて制御部(CPU(central processing unit))等のハードウェアを動作させることによって、各部を各種手段として実現する。また、該乱数生成プログラムは、記録媒体に記録されて頒布されても良い。当該記録媒体に記録された乱数生成プログラムは、有線、無線、又は記録媒体そのものを介して、メモリに読込まれ、制御部等を動作させる。尚、記録媒体を例示すれば、オプティカルディスクや磁気ディスク、半導体メモリ装置、ハードディスクなどが挙げられる。   In addition, what is necessary is just to implement | achieve each part of a random number generator using the combination of hardware and software. In the form of a combination of hardware and software, a random number generation program is expanded in a random access memory (RAM), and hardware such as a control unit (CPU (central processing unit)) is operated based on the random number generation program. Thus, each unit is realized as various means. Further, the random number generation program may be recorded on a recording medium and distributed. The random number generation program recorded on the recording medium is read into the memory via the wired, wireless, or recording medium itself, and operates the control unit and the like. Examples of the recording medium include an optical disk, a magnetic disk, a semiconductor memory device, and a hard disk.

上記実施の形態を別の表現で説明すれば、乱数生成装置として動作させるコンピュータを、RAMに展開された乱数生成プログラムに基づき、候補計算部110、第一評価部120、および第二評価部130として動作させることで実現することが可能である。   To describe the above-described embodiment in another expression, a candidate operating unit 110, a first evaluation unit 120, and a second evaluation unit 130 are computers that operate as a random number generation device based on a random number generation program expanded in a RAM. It can be realized by operating as

また、本発明の具体的な構成は前述の実施の形態に限られるものではなく、この発明の要旨を逸脱しない範囲の変更があってもこの発明に含まれる。   In addition, the specific configuration of the present invention is not limited to the above-described embodiment, and changes within a range not departing from the gist of the present invention are included in the present invention.

以上、実施の形態を参照して本願発明を説明したが、本願発明は上記実施の形態に限定されるものではない。本願発明の構成や詳細には、本願発明のスコープ内で当業者が理解し得る様々な変更をすることができる。   Although the present invention has been described with reference to the embodiments, the present invention is not limited to the above embodiments. Various changes that can be understood by those skilled in the art can be made to the configuration and details of the present invention within the scope of the present invention.

上記の実施形態の一部又は全部は、以下の付記のようにも記載されうるが、以下には限られない。   A part or all of the above-described embodiment can be described as in the following supplementary notes, but is not limited thereto.

(付記1)与えられた確率分布にしたがって乱数を生成する乱数生成装置であって、
乱数データを生成する乱数生成器と、
前記確率分布の累積分布函数をそれぞれ上側および下側で挟む形の上側近似函数および下側近似函数の一方を第一近似函数として所有し、前記乱数データに前記第一近似函数の逆函数を作用させ、整数丸めを取って得られる第一丸め値を計算し、該第一丸め値を出力候補データとして出力する候補計算部と、
前記上側近似函数および前記下側近似函数の他方を第二近似函数として所有し、前記出力候補データを受け、前記乱数データに前記第二近似函数の逆函数を作用させ、整数丸めを取って得られる第二丸め値を計算し、前記第二丸め値が前記出力候補データに等しいか否かを判定し、前記第二丸め値が前記出力候補データに等しいときに、前記出力候補データを前記乱数として出力する第一評価部と、
を備えることを特徴とする乱数生成装置。
(Appendix 1) A random number generation device that generates random numbers according to a given probability distribution,
A random number generator for generating random data;
One of the upper approximate function and the lower approximate function that sandwich the cumulative distribution function of the probability distribution above and below, respectively, is owned as the first approximate function, and the inverse function of the first approximate function is applied to the random number data. Calculating a first rounded value obtained by taking integer rounding, and outputting the first rounded value as output candidate data;
Owning the other of the upper approximate function and the lower approximate function as a second approximate function, receiving the output candidate data, applying the inverse function of the second approximate function to the random number data, and obtaining integer rounding The second rounding value is calculated, it is determined whether the second rounding value is equal to the output candidate data, and when the second rounding value is equal to the output candidate data, the output candidate data is determined as the random number. A first evaluation unit that outputs as
A random number generation device comprising:

(付記2)前記累積分布函数は、分散値がsの離散ガウス分布

Figure 2018005702
の累積分布函数であることを特徴とする、付記1に記載の乱数生成装置。 (Supplementary note 2) The cumulative distribution function is a discrete Gaussian distribution with variance s
Figure 2018005702
The random number generation device according to appendix 1, wherein the random distribution function is

(付記3)前記上側近似函数は、

Figure 2018005702
であり、
前記下側近似函数は、
Figure 2018005702
であることを特徴とする、付記2に記載の乱数生成装置。 (Supplementary note 3) The upper approximate function is
Figure 2018005702
And
The lower approximate function is
Figure 2018005702
The random number generation device according to appendix 2, characterized in that:

(付記4)前記第二丸め値が前記出力候補データに等しくないときに、棄却サンプル法を用いて前記乱数を生成する第二評価部を更に有する、付記1乃至3のいずれか1項に記載の乱数生成装置。 (Appendix 4) The appendix according to any one of appendices 1 to 3, further comprising: a second evaluation unit that generates the random number using a rejection sample method when the second rounded value is not equal to the output candidate data. Random number generator.

(付記5)前記第二評価部は、前記乱数として整数ガウス値を計算する、付記4に記載の乱数生成装置。 (Supplementary note 5) The random number generation device according to supplementary note 4, wherein the second evaluation unit calculates an integer Gaussian value as the random number.

(付記6)与えられた確率分布にしたがって乱数を生成する乱数生成方法であって、
乱数生成器が、乱数データを生成し、
候補計算部が、前記確率分布の累積分布函数をそれぞれ上側および下側で挟む形の上側近似函数および下側近似函数の一方を第一近似函数として所有し、前記乱数データに前記第一近似函数の逆函数を作用させ、整数丸めを取って得られる第一丸め値を計算し、該第一丸め値を出力候補データとして出力し、
第一評価部が、前記上側近似函数および前記下側近似函数の他方を第二近似函数として所有し、前記出力候補データを受け、前記乱数データに前記第二近似函数の逆函数を作用させ、整数丸めを取って得られる第二丸め値を計算し、前記第二丸め値が前記出力候補データに等しいか否かを判定し、前記第二丸め値が前記出力候補データに等しいときに、前記出力候補データを前記乱数として出力する、
をことを特徴とする乱数生成方法。
(Appendix 6) A random number generation method for generating random numbers according to a given probability distribution,
A random number generator generates random data,
The candidate calculation unit possesses one of the upper approximate function and the lower approximate function in the form of sandwiching the cumulative distribution function of the probability distribution above and below as the first approximate function, and the first approximate function is included in the random number data. To calculate the first rounded value obtained by taking the integer rounding, and output the first rounded value as output candidate data,
The first evaluation unit owns the other of the upper approximate function and the lower approximate function as a second approximate function, receives the output candidate data, and causes the inverse function of the second approximate function to act on the random number data, Calculating a second rounded value obtained by taking integer rounding, determining whether the second rounded value is equal to the output candidate data, and when the second rounded value is equal to the output candidate data, Outputting output candidate data as the random number;
A random number generation method characterized by the above.

(付記7)前記累積分布函数は、分散値がsの離散ガウス分布

Figure 2018005702
の累積分布函数であることを特徴とする、付記6に記載の乱数生成方法。 (Supplementary note 7) The cumulative distribution function is a discrete Gaussian distribution with a variance value of s.
Figure 2018005702
The random number generation method according to appendix 6, wherein the random distribution function is:

(付記8)前記上側近似函数は、

Figure 2018005702
であり、
前記下側近似函数は、
Figure 2018005702
であることを特徴とする、付記7に記載の乱数生成方法。 (Supplementary note 8) The upper approximate function is
Figure 2018005702
And
The lower approximate function is
Figure 2018005702
The random number generation method according to appendix 7, wherein:

(付記9)前記第二丸め値が前記出力候補データに等しくないときに、第二評価部が、棄却サンプル法を用いて前記乱数を生成する、付記6乃至8のいずれか1項に記載の乱数生成方法。 (Supplementary note 9) The second evaluation unit generates the random number using a rejection sample method when the second rounded value is not equal to the output candidate data, according to any one of supplementary notes 6 to 8. Random number generation method.

(付記10)前記第二評価部が、前記乱数として整数ガウス値を計算する、付記9に記載の乱数生成方法。 (Supplementary note 10) The random number generation method according to supplementary note 9, wherein the second evaluation unit calculates an integer Gaussian value as the random number.

(付記11)
コンピュータを、
確率分布の累積分布函数をそれぞれ上側および下側で挟む形の上側近似函数および下側近似函数の一方を第一近似函数として所有し、乱数生成器から生成された乱数データに前記第一近似函数の逆函数を作用させ、整数丸めを取って得られる第一丸め値を計算し、該第一丸め値を出力候補データとして出力する候補計算手段、および
前記上側近似函数および前記下側近似函数の他方を第二近似函数として所有し、前記出力候補データを受け、前記乱数データに前記第二近似函数の逆函数を作用させ、整数丸めを取って得られる第二丸め値を計算し、前記第二丸め値が前記出力候補データに等しいか否かを判定し、前記第二丸め値が前記出力候補データに等しいときに、前記出力候補データを前記確率分布にしたがった乱数として出力する第一評価手段、
として機能させる乱数生成プログラム。
(Appendix 11)
Computer
One of the upper approximation function and the lower approximation function with the cumulative distribution function of the probability distribution sandwiched between the upper and lower sides, respectively, is owned as the first approximation function, and the first approximation function is added to the random number data generated from the random number generator. The first rounding value obtained by taking the integer rounding is calculated, the first rounding value is output as output candidate data, and the upper approximation function and the lower approximation function Owning the other as a second approximate function, receiving the output candidate data, applying an inverse function of the second approximate function to the random number data, calculating a second rounded value obtained by taking an integer round, It is determined whether or not a double rounded value is equal to the output candidate data, and when the second rounded value is equal to the output candidate data, the output candidate data is output as a random number according to the probability distribution Evaluation means,
Random number generation program to function as.

(付記12)前記累積分布函数は、分散値がsの離散ガウス分布

Figure 2018005702
の累積分布函数であることを特徴とする、付記11に記載の乱数生成プログラム。 (Supplementary note 12) The cumulative distribution function is a discrete Gaussian distribution with a variance value of s.
Figure 2018005702
The random number generation program according to appendix 11, characterized by being a cumulative distribution function of

(付記13)前記上側近似函数は、

Figure 2018005702
であり、
前記下側近似函数は、
Figure 2018005702
であることを特徴とする、付記12に記載の乱数生成プログラム。 (Supplementary note 13) The upper approximate function is
Figure 2018005702
And
The lower approximate function is
Figure 2018005702
The random number generation program according to appendix 12, characterized in that:

(付記14)前記コンピュータを、前記第二丸め値が前記出力候補データに等しくないときに、棄却サンプル法を用いて前記乱数を生成する第二評価手段として更に機能させる、付記11乃至13のいずれか1項に記載の乱数生成プログラム。 (Supplementary note 14) Any one of Supplementary notes 11 to 13, further causing the computer to function as second evaluation means for generating the random number using a reject sample method when the second rounded value is not equal to the output candidate data. The random number generation program according to item 1.

(付記15)前記第二評価手段は、前記乱数として整数ガウス値を計算する、付記14に記載の乱数生成プログラム。 (Supplementary note 15) The random number generation program according to supplementary note 14, wherein the second evaluation unit calculates an integer Gaussian value as the random number.

本発明は、格子暗号及び署名に用いる、離散ガウス分布に従う乱数の生成の用途に適用できる。   The present invention can be applied to the generation of random numbers according to a discrete Gaussian distribution used for lattice encryption and signatures.

90 コンピュータ(中央処理装置;プロセッサ;データ処理装置)
100 一様乱数生成部
110 候補計算部
111 乱数入力部
112 上側近似逆函数計算部
113 候補データ
120 第一評価部
121 候補データ入力部
122 下側近似逆函数計算部
130 第二評価部
131 棄却判定部
132 乱数生成部
140 出力装置
141 符号決定部
90 Computer (Central processing unit; Processor; Data processing unit)
100 Uniform Random Number Generation Unit 110 Candidate Calculation Unit 111 Random Number Input Unit 112 Upper Approximate Inverse Function Calculation Unit 113 Candidate Data 120 First Evaluation Unit 121 Candidate Data Input Unit 122 Lower Approximate Inverse Function Calculation Unit 130 Second Evaluation Unit 131 Rejection Determination Unit 132 random number generation unit 140 output device 141 code determination unit

Claims (10)

与えられた確率分布にしたがって乱数を生成する乱数生成装置であって、
乱数データを生成する乱数生成器と、
前記確率分布の累積分布函数をそれぞれ上側および下側で挟む形の上側近似函数および下側近似函数の一方を第一近似函数として所有し、前記乱数データに前記第一近似函数の逆函数を作用させ、整数丸めを取って得られる第一丸め値を計算し、該第一丸め値を出力候補データとして出力する候補計算部と、
前記上側近似函数および前記下側近似函数の他方を第二近似函数として所有し、前記出力候補データを受け、前記乱数データに前記第二近似函数の逆函数を作用させ、整数丸めを取って得られる第二丸め値を計算し、前記第二丸め値が前記出力候補データに等しいか否かを判定し、前記第二丸め値が前記出力候補データに等しいときに、前記出力候補データを前記乱数として出力する第一評価部と、
を備えることを特徴とする乱数生成装置。
A random number generator for generating random numbers according to a given probability distribution,
A random number generator for generating random data;
One of the upper approximate function and the lower approximate function that sandwich the cumulative distribution function of the probability distribution above and below, respectively, is owned as the first approximate function, and the inverse function of the first approximate function is applied to the random number data. Calculating a first rounded value obtained by taking integer rounding, and outputting the first rounded value as output candidate data;
Owning the other of the upper approximate function and the lower approximate function as a second approximate function, receiving the output candidate data, applying the inverse function of the second approximate function to the random number data, and obtaining integer rounding The second rounding value is calculated, it is determined whether the second rounding value is equal to the output candidate data, and when the second rounding value is equal to the output candidate data, the output candidate data is determined as the random number. A first evaluation unit that outputs as
A random number generation device comprising:
前記累積分布函数は、分散値がsの離散ガウス分布
Figure 2018005702
の累積分布函数であることを特徴とする、請求項1に記載の乱数生成装置。
The cumulative distribution function is a discrete Gaussian distribution with a variance value of s.
Figure 2018005702
The random number generation device according to claim 1, wherein the random number generation function is a cumulative distribution function.
前記上側近似函数は、
Figure 2018005702
であり、
前記下側近似函数は、
Figure 2018005702
であることを特徴とする、請求項2に記載の乱数生成装置。
The upper approximate function is
Figure 2018005702
And
The lower approximate function is
Figure 2018005702
The random number generation device according to claim 2, wherein:
前記第二丸め値が前記出力候補データに等しくないときに、棄却サンプル法を用いて前記乱数を生成する第二評価部を更に有する、請求項1乃至3のいずれか1項に記載の乱数生成装置。   4. The random number generation according to claim 1, further comprising: a second evaluation unit that generates the random number using a rejection sample method when the second rounded value is not equal to the output candidate data. 5. apparatus. 前記第二評価部は、前記乱数として整数ガウス値を計算する、請求項4に記載の乱数生成装置。   The random number generation device according to claim 4, wherein the second evaluation unit calculates an integer Gaussian value as the random number. 与えられた確率分布にしたがって乱数を生成する乱数生成方法であって、
乱数生成器が、乱数データを生成し、
候補計算部が、前記確率分布の累積分布函数をそれぞれ上側および下側で挟む形の上側近似函数および下側近似函数の一方を第一近似函数として所有し、前記乱数データに前記第一近似函数の逆函数を作用させ、整数丸めを取って得られる第一丸め値を計算し、該第一丸め値を出力候補データとして出力し、
第一評価部が、前記上側近似函数および前記下側近似函数の他方を第二近似函数として所有し、前記出力候補データを受け、前記乱数データに前記第二近似函数の逆函数を作用させ、整数丸めを取って得られる第二丸め値を計算し、前記第二丸め値が前記出力候補データに等しいか否かを判定し、前記第二丸め値が前記出力候補データに等しいときに、前記出力候補データを前記乱数として出力する、
をことを特徴とする乱数生成方法。
A random number generation method for generating random numbers according to a given probability distribution,
A random number generator generates random data,
The candidate calculation unit possesses one of the upper approximate function and the lower approximate function in the form of sandwiching the cumulative distribution function of the probability distribution above and below as the first approximate function, and the first approximate function is included in the random number data. To calculate the first rounded value obtained by taking the integer rounding, and output the first rounded value as output candidate data,
The first evaluation unit owns the other of the upper approximate function and the lower approximate function as a second approximate function, receives the output candidate data, and causes the inverse function of the second approximate function to act on the random number data, Calculating a second rounded value obtained by taking integer rounding, determining whether the second rounded value is equal to the output candidate data, and when the second rounded value is equal to the output candidate data, Outputting output candidate data as the random number;
A random number generation method characterized by the above.
前記累積分布函数は、分散値がsの離散ガウス分布
Figure 2018005702
の累積分布函数であることを特徴とする、請求項6に記載の乱数生成方法。
The cumulative distribution function is a discrete Gaussian distribution with a variance value of s.
Figure 2018005702
The random number generation method according to claim 6, wherein the function is a cumulative distribution function.
前記上側近似函数は、
Figure 2018005702
であり、
前記下側近似函数は、
Figure 2018005702
であることを特徴とする、請求項7に記載の乱数生成方法。
The upper approximate function is
Figure 2018005702
And
The lower approximate function is
Figure 2018005702
The random number generation method according to claim 7, wherein:
前記第二丸め値が前記出力候補データに等しくないときに、第二評価部が、棄却サンプル法を用いて前記乱数を生成する、請求項6乃至8のいずれか1項に記載の乱数生成方法。   The random number generation method according to any one of claims 6 to 8, wherein when the second rounded value is not equal to the output candidate data, the second evaluation unit generates the random number using a rejection sample method. . コンピュータを、
確率分布の累積分布函数をそれぞれ上側および下側で挟む形の上側近似函数および下側近似函数の一方を第一近似函数として所有し、乱数生成器から生成された乱数データに前記第一近似函数の逆函数を作用させ、整数丸めを取って得られる第一丸め値を計算し、該第一丸め値を出力候補データとして出力する候補計算手段、および
前記上側近似函数および前記下側近似函数の他方を第二近似函数として所有し、前記出力候補データを受け、前記乱数データに前記第二近似函数の逆函数を作用させ、整数丸めを取って得られる第二丸め値を計算し、前記第二丸め値が前記出力候補データに等しいか否かを判定し、前記第二丸め値が前記出力候補データに等しいときに、前記出力候補データを前記確率分布にしたがった乱数として出力する第一評価手段、
として機能させる乱数生成プログラム。
Computer
One of the upper approximation function and the lower approximation function with the cumulative distribution function of the probability distribution sandwiched between the upper and lower sides, respectively, is owned as the first approximation function, and the first approximation function is added to the random number data generated from the random number generator. The first rounding value obtained by taking the integer rounding is calculated, the first rounding value is output as output candidate data, and the upper approximation function and the lower approximation function Owning the other as a second approximate function, receiving the output candidate data, applying an inverse function of the second approximate function to the random number data, calculating a second rounded value obtained by taking an integer round, It is determined whether or not a double rounded value is equal to the output candidate data, and when the second rounded value is equal to the output candidate data, the output candidate data is output as a random number according to the probability distribution Evaluation means,
Random number generation program to function as.
JP2016133851A 2016-07-06 2016-07-06 Random number generation device, random number generation method, and random number generation program Active JP6678926B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016133851A JP6678926B2 (en) 2016-07-06 2016-07-06 Random number generation device, random number generation method, and random number generation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016133851A JP6678926B2 (en) 2016-07-06 2016-07-06 Random number generation device, random number generation method, and random number generation program

Publications (2)

Publication Number Publication Date
JP2018005702A true JP2018005702A (en) 2018-01-11
JP6678926B2 JP6678926B2 (en) 2020-04-15

Family

ID=60946494

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016133851A Active JP6678926B2 (en) 2016-07-06 2016-07-06 Random number generation device, random number generation method, and random number generation program

Country Status (1)

Country Link
JP (1) JP6678926B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109617679A (en) * 2018-11-29 2019-04-12 哈希未来(北京)科技有限公司 Generate, obtain and provide method, system and the storage medium of random number
CN113904769A (en) * 2021-12-08 2022-01-07 浙江九州量子信息技术股份有限公司 Quantum encryption-based power distribution automation reinforcement implementation method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05216630A (en) * 1991-11-29 1993-08-27 Nec Corp Correlative random number generator
JP2000276459A (en) * 1999-03-26 2000-10-06 Fujitsu Ltd Random number generation device, random number generation method and random number generation system using conversion function by learning
JP2001256076A (en) * 2000-03-08 2001-09-21 Ricoh Co Ltd Test data generation device, test data generation method, and recording medium
US20170220322A1 (en) * 2016-01-28 2017-08-03 International Business Machines Corporation Generating gaussian random numbers using inverse sampling and recurrence relationship

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05216630A (en) * 1991-11-29 1993-08-27 Nec Corp Correlative random number generator
JP2000276459A (en) * 1999-03-26 2000-10-06 Fujitsu Ltd Random number generation device, random number generation method and random number generation system using conversion function by learning
JP2001256076A (en) * 2000-03-08 2001-09-21 Ricoh Co Ltd Test data generation device, test data generation method, and recording medium
US20170220322A1 (en) * 2016-01-28 2017-08-03 International Business Machines Corporation Generating gaussian random numbers using inverse sampling and recurrence relationship

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
DIRK P. KROESE, THOMAS TAIMRE, ZDRAVKO I. BOTEV, 伏見正則, 逆瀬川浩孝, 「モンテカルロ法ハンドブック」, vol. 初版, JPN6020003736, 25 October 2014 (2014-10-25), JP, ISSN: 0004205765 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109617679A (en) * 2018-11-29 2019-04-12 哈希未来(北京)科技有限公司 Generate, obtain and provide method, system and the storage medium of random number
CN113904769A (en) * 2021-12-08 2022-01-07 浙江九州量子信息技术股份有限公司 Quantum encryption-based power distribution automation reinforcement implementation method
CN113904769B (en) * 2021-12-08 2022-03-18 浙江九州量子信息技术股份有限公司 Quantum encryption-based power distribution automation reinforcement implementation method

Also Published As

Publication number Publication date
JP6678926B2 (en) 2020-04-15

Similar Documents

Publication Publication Date Title
El Bansarkhani et al. Improvement and efficient implementation of a lattice-based signature scheme
Cheon et al. Homomorphic encryption for arithmetic of approximate numbers
Both et al. Decoding linear codes with high error rate and its impact for LPN security
US11277256B2 (en) Ciphertext comparison method using homomorphic encryption and apparatus for performing the same
Albrecht On dual lattice attacks against small-secret LWE and parameter choices in HElib and SEAL
Zhao et al. Desynchronization attacks resilient watermarking method based on frequency singular value coefficient modification
Bost et al. Machine learning classification over encrypted data
Guo et al. Coded-BKW: Solving LWE using lattice codes
Eftang et al. Parameter multi‐domain ‘hp’empirical interpolation
KR101273465B1 (en) Apparatus for batch verification and method using the same
Yasuda et al. Practical packing method in somewhat homomorphic encryption
US9473302B2 (en) Ciphertext processing device, ciphertext processing method, computer-readable recording medium, and information processing device
US20230038304A1 (en) Method for providing information to be stored and method for providing a proof of retrievability
Meherrem et al. Maximum principle for optimal control of McKean‐Vlasov FBSDEs with Lévy process via the differentiability with respect to probability law
Dearmon et al. G aussian process regression and b ayesian model averaging: An alternative approach to modeling spatial phenomena
Cheon et al. Grafting: decoupled scale factors and modulus in RNS-CKKS
JP6678926B2 (en) Random number generation device, random number generation method, and random number generation program
Zhang et al. A novel fast image encryption algorithm based on coefficient independent coupled exponential chaotic map
Khovanov Stochastic approach for assessing the predictability of chaotic time series using reservoir computing
JPWO2019030799A1 (en) Random number generation system, random number generation method, and random number generation program
Hamdi et al. An appropriate system for securing real-time voice communication based on ADPCM coding and chaotic maps
Wu et al. Error assessment of multivariate random processes simulated by a conditional-simulation method
Machicao et al. Zooming into chaos as a pathway for the creation of a fast, light and reliable cryptosystem
Zeng et al. Detecting affine equivalence of Boolean functions and circuit transformation
JP6845460B2 (en) Random number generator, random number generation method, random number generation program, and auxiliary output unit used for it

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190607

TRDD Decision of grant or rejection written
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200115

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20200205

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200227

R150 Certificate of patent or registration of utility model

Ref document number: 6678926

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250