JP2011123693A - Method, apparatus and program for determining period of integer sequence - Google Patents

Method, apparatus and program for determining period of integer sequence Download PDF

Info

Publication number
JP2011123693A
JP2011123693A JP2009281167A JP2009281167A JP2011123693A JP 2011123693 A JP2011123693 A JP 2011123693A JP 2009281167 A JP2009281167 A JP 2009281167A JP 2009281167 A JP2009281167 A JP 2009281167A JP 2011123693 A JP2011123693 A JP 2011123693A
Authority
JP
Japan
Prior art keywords
value
input
period
output
permutation
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.)
Pending
Application number
JP2009281167A
Other languages
Japanese (ja)
Inventor
Toru Ito
徹 伊東
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.)
Netcomsec Co Ltd
Original Assignee
Netcomsec Co Ltd
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 Netcomsec Co Ltd filed Critical Netcomsec Co Ltd
Priority to JP2009281167A priority Critical patent/JP2011123693A/en
Publication of JP2011123693A publication Critical patent/JP2011123693A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To determine a period of an integer sequence prepared by using a bijective function based on the set of natural numbers having an arbitrary size. <P>SOLUTION: A permutation preparation part 4 prepares a permutation A(i) which is the array of output data (images corresponding to an original image) with respect to the input of a bijective function (mapping). A permutation storage part 5 stores a permutation S(i, j) indicating an output state with respect to the input of all bijective functions of an arbitrary size m (m is a natural number of ≥2). A period calculation part 6 repeats a procedure for further inputting an output data sequence with respect to the input of an arbitrary bijective function to calculate a period of an integer sequence to be prepared. A period storage part 10 stores the period calculation result of the period calculation part 6 which is specified by a permutation number setting part 11. The permutation number setting part 11 stores the existence number of all bijective functions of the arbitrary number m of data. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は整数系列の周期判定方法、周期判定装置及び周期判定プログラムに係り、特に擬似乱数等に用いられる整数系列の周期判定方法、周期判定装置及び周期判定プログラムに関する。   The present invention relates to an integer sequence period determination method, a period determination apparatus, and a period determination program, and more particularly to an integer sequence period determination method, a period determination apparatus, and a period determination program used for pseudorandom numbers and the like.

近年、暗号やモンテカルロ法等に用いられる擬似乱数系列は、暗号解析の困難性を高めるために、周期の長い系列が要求される。また、これまで系列長が保証された擬似乱数系列として、M系列等が使用されることが多かったが、それ以外の手段として、カオスや帰還関数等を用いた生成方法を利用することが考えられる(例えば、非特許文献1、非特許文献2参照)。非特許文献1には、シフトレジスタを用いて周期の長い擬似乱数系列を発生することが開示されている。また、非特許文献2には擬似乱数系列を発生させる暗号理論一般について開示されている。   In recent years, pseudo-random number sequences used in cryptography, the Monte Carlo method, and the like are required to have a long cycle in order to increase the difficulty of cryptographic analysis. In addition, an M-sequence or the like has often been used as a pseudo-random sequence with a guaranteed sequence length so far, but it is considered to use a generation method using a chaos, a feedback function, or the like as other means. (See, for example, Non-Patent Document 1 and Non-Patent Document 2). Non-Patent Document 1 discloses that a pseudo-random number sequence having a long period is generated using a shift register. Non-Patent Document 2 discloses general cryptography that generates a pseudo-random number sequence.

また、暗号解析の困難性を高め、安全性の高い擬似乱数系列を生成するために、複数の異なるSボックスを利用した処理を行う構成の暗号処理装置(例えば、特許文献1参照)や、線形フィードバックシフトレジスタを利用したM系列の出力に非線形関数をフィルタとして用いることで、出力擬似乱数系列を推定困難にする構成の擬似乱数系列生成装置が知られている(例えば、特許文献2参照)。   Further, in order to increase the difficulty of cryptographic analysis and generate a highly secure pseudo-random number sequence, a cryptographic processing device configured to perform processing using a plurality of different S boxes (see, for example, Patent Document 1), linear There is known a pseudo-random number generation device configured to make it difficult to estimate an output pseudo-random number sequence by using a nonlinear function as a filter for M-sequence output using a feedback shift register (see, for example, Patent Document 2).

更に、擬似乱数系列の利用可能性に基づいて、システム内の乱数生成器の系列反復周期を拡張するために、複数の互いに素となる数を法としてRNS(Residue Number System)剰余値を求め、それを組み合わせて出力系列とすることで系列長を拡張する方法も知られている(例えば、特許文献3参照)。   Further, in order to extend the sequence repetition period of the random number generator in the system based on the availability of the pseudo-random number sequence, an RNS (Residue Number System) residue value is obtained using a plurality of relatively prime numbers as a modulus, A method of extending the sequence length by combining them into an output sequence is also known (see, for example, Patent Document 3).

Solomon Wolf Golomb,“Shift Register Sequences”,San Francisco,Holden-Day,1967.Solomon Wolf Golomb, “Shift Register Sequences”, San Francisco, Holden-Day, 1967. Bruce Schneier,“Applied Cryptography”,Second Edition,John Wiley & Sons,Inc.1996.Bruce Schneier, “Applied Cryptography”, Second Edition, John Wiley & Sons, Inc. 1996.

特開2008−58828号公報JP 2008-58828 A 特開平8−202535号公報JP-A-8-202535 特開2009−3925号公報JP 2009-3925 A

しかしながら、カオスや帰還関数等を用いた生成方法を利用して擬似乱数系列を生成する場合は、生成した擬似乱数系列長が明らかでない場合があり、また生成された擬似乱数系列が短周期等の理由より使用目的によっては適さない擬似乱数系列を使用せざるを得ない場合もある。   However, when generating a pseudo-random number sequence using a generation method using chaos, a feedback function, etc., the generated pseudo-random number sequence length may not be clear, and the generated pseudo-random number sequence may be There is a case where a pseudo-random number sequence that is not suitable for the purpose of use must be used for some reason.

また、特許文献1及び2各記載の装置では、生成した擬似乱数系列の周期を判定して、その周期の長さや周期の個数を求める機能は有しておらず、周期に使用した値を使用済みとして区別する機能を有していない。更に、特許文献3記載の方法も、擬似乱数系列の周期を判定して、その周期の長さや個数を求める機能や、剰余を利用することなく完全擬似乱数を求めることについては全く開示されていない。   In addition, the devices described in Patent Documents 1 and 2 do not have a function of determining the period of the generated pseudorandom number sequence and obtaining the length of the period or the number of periods, and use the values used for the period. It does not have a function to distinguish as finished. Furthermore, the method described in Patent Document 3 also does not disclose a function for determining the period and number of the pseudo-random number sequence and obtaining a complete pseudo-random number without using a remainder. .

このように、従来は擬似乱数系列の周期を判定することは知られておらず、このことから系列長の保証された完全擬似乱数を得ることは容易でなかった。   Thus, conventionally, it is not known to determine the period of a pseudo-random number sequence. From this, it is not easy to obtain a complete pseudo-random number with a guaranteed sequence length.

本発明は以上の点に鑑みなされたもので、擬似乱数系列の生成のために、任意の大きさの自然数の集合による全単射関数を用いて生成された整数系列の周期を判定し得る整数系列の周期判定方法、周期判定装置及び周期判定プログラムを提供することを目的とする。   The present invention has been made in view of the above points, and in order to generate a pseudo-random number sequence, an integer that can determine the period of an integer sequence generated using a bijection function based on a set of natural numbers of an arbitrary size. It is an object of the present invention to provide a sequence period determination method, a period determination apparatus, and a period determination program.

また、本発明の他の目的は、自然数を入出力とする全単射関数及び変換表もしくはSボックス等の出力フィードバックにおいて、周期長の合計を求める演算を行い、各周期長が幾つ存在するかの結果や、最大長の周期を保有するかどうかの判定が可能である整数系列の周期判定方法、周期判定装置及び周期判定プログラムを提供することにある。   Another object of the present invention is to perform a calculation to obtain the sum of the cycle lengths in a bijection function using a natural number as input / output and an output feedback such as a conversion table or S box, and how many each cycle length exists. It is another object of the present invention to provide an integer sequence period determination method, a period determination apparatus, and a period determination program that can determine whether or not the result has a maximum length period.

上記の目的を達成するため、第1の発明の整数系列の周期判定方法は、制御部が、0からm−1(ただし、mは2以上の整数)までの値の重複しないm個の整数からなる整数系列の入力(原像)と出力(像)とを持つm!(m!はmの階乗。即ち1×2×・・・×(m−1)×mを表す。)個の全単射関数(写像)についての前記m種類の入力に対する出力の状態を全て順列として生成して第1の記憶部に記憶する第1のステップと、制御部が、第1の記憶部に記憶されたm!個の全単射関数についての順列のそれぞれについて、或る入力値を与えたときの出力値を求め、更にその出力値を入力値とすることを、最初の入力値と同じ出力値が得られるまで繰り返し変換を行い、その変換回数を周期として求め、周期がmより小さいときは、未出現の入力値が存在するものと判定し、未出現の入力値を順列に与えたときの出力値を求め、更にその出力値を入力値とすることを、未出現の入力値と同じ出力値が得られるまで繰り返し変換を行い、その変換回数を周期として求めることを、全ての入力値及び全ての未出現の入力値に対して順次行う第2のステップと、制御部が、第2のステップで求められたm!個の全単射関数の最小周期から最大周期までの周期を第2の記憶部に記憶する第3のステップとを含むことを特徴とする。   In order to achieve the above object, the integer sequence period determining method according to the first aspect of the present invention is such that the control unit has m integers whose values from 0 to m-1 (where m is an integer of 2 or more) do not overlap. M with an integer sequence input (original image) and output (image)! (M! Is the factorial of m. That is, 1 × 2 ×... X (m−1) × m.) The state of the output for the m types of inputs for the bijection function (mapping). The first step of generating all as permutations and storing them in the first storage unit, and the control unit stored in the first storage unit m! For each permutation of each bijection function, an output value when a certain input value is given is obtained, and the output value is set as the input value, and the same output value as the first input value is obtained. The number of conversions is calculated as a cycle, and when the cycle is smaller than m, it is determined that there is a non-appearing input value, and the output value when the non-appearing input value is given to the permutation is In addition, converting the output value as an input value is repeated until the same output value as the input value that has not yet appeared is obtained, and obtaining the number of conversions as a cycle means that all the input values and all the unconverted values are obtained. The second step is sequentially performed on the input values that appear, and the control unit obtains m! And a third step of storing the period from the minimum period to the maximum period of each bijective function in the second storage unit.

また、上記の目的を達成するため、第2の発明の整数系列の周期判定方法は、制御部が、0からm−1(ただし、mは2以上の整数)までの値の重複しないm個の整数からなる整数系列の入力(原像)と出力(像)とを持つm!個の全単射関数(写像)のうち、所望の1個の前記全単射関数の前記m個の整数からなる整数系列の入力に対する出力の状態を順列として第1の記憶部に記憶する第1のステップと、制御部が、前記m個の入力のうち最初の入力を与えたときの出力値を求め、更にその出力値を入力値とすることを、最初の入力値と同じ出力値が得られるまで繰り返すと共に、その繰り返し回数を周期として第2の記憶部に記憶することを、前記m個の入力のすべてについて行う第2のステップと、制御部が、前記第2の記憶部に記憶された周期が前記mであるか否かを判定し、前記周期が前記mであるとき、その周期を前記所望の1個の前記全単射関数の最大周期であると決定する第3のステップとを含むことを特徴とする。   In order to achieve the above object, the integer sequence period determining method according to the second aspect of the invention is such that the control unit has m number of values from 0 to m−1 (where m is an integer equal to or greater than 2). M with an input (original image) and an output (image) of an integer sequence of integers! Among the plurality of bijection functions (mappings), the first storage unit stores in the first storage unit the output state of the desired one bijection function with respect to the input of the integer series consisting of the m integers as a permutation. 1 and the control unit obtains an output value when the first input is given among the m inputs, and further sets the output value as an input value. The second step is performed for all of the m inputs, and the control unit stores in the second storage unit that the number of repetitions is repeated as a cycle and stored in the second storage unit. A third step of determining whether or not the generated period is the m, and determining that the period is the maximum period of the desired one bijective function when the period is the m. It is characterized by including.

また、上記の目的を達成するため、第3の発明の整数系列の周期判定装置は、第1及び第2の記憶部と、0からm−1(ただし、mは2以上の整数)までの値の重複しないm個の整数からなる整数系列の入力(原像)と出力(像)とを持つm!個の全単射関数(写像)についての前記m種類の入力に対する出力の状態を全て順列として生成して前記第1の記憶部に記憶する順列生成及び記憶手段と、第1の記憶部に記憶されたm!個の全単射関数についての順列のそれぞれについて、或る入力値を与えたときの出力値を求め、更にその出力値を入力値とすることを、最初の入力値と同じ出力値が得られるまで繰り返し変換を行い、その変換回数を周期として求め、周期がmより小さいときは、未出現の入力値が存在するものと判定し、未出現の入力値を順列に与えたときの出力値を求め、更にその出力値を入力値とすることを、未出現の入力値と同じ出力値が得られるまで繰り返し変換を行い、その変換回数を周期として求めることを、全ての入力値及び全ての未出現の入力値に対して順次行う周期計算及び累計手段と、前記周期計算及び累計手段で得られた前記m!個の全単射関数の最小周期から最大周期までの周期を第2の記憶部に記憶する記憶手段とを有することを特徴とする。   In order to achieve the above object, an integer sequence period determining apparatus according to a third aspect of the present invention includes a first and second storage unit, and 0 to m−1 (where m is an integer of 2 or more). M having an input (original image) and an output (image) of an integer sequence consisting of m integers whose values do not overlap. Permutation generation and storage means for generating all the states of outputs for the m kinds of inputs for the bijection functions (mappings) as permutations and storing them in the first storage unit, and storing them in the first storage unit M done! For each permutation of each bijection function, an output value when a certain input value is given is obtained, and the output value is set as the input value, and the same output value as the first input value is obtained. The number of conversions is calculated as a cycle, and when the cycle is smaller than m, it is determined that there is a non-appearing input value, and the output value when the non-appearing input value is given to the permutation is In addition, converting the output value as an input value is repeated until the same output value as the input value that has not yet appeared is obtained, and obtaining the number of conversions as a cycle means that all the input values and all the unconverted values are obtained. Period calculation and accumulation means sequentially performed for the input value of appearance, and the m! Obtained by the period calculation and accumulation means. Storage means for storing a period from the minimum period to the maximum period of each bijective function in the second storage unit.

また、上記の目的を達成するため、第4の発明の整数系列の周期判定装置は、第1及び第2の記憶部と、0からm−1(ただし、mは2以上の整数)までの値の重複しないm個の整数からなる整数系列の入力(原像)と出力(像)とを持つm!個の全単射関数(写像)のうち、所望の1個の前記全単射関数の前記m個の整数からなる整数系列の入力に対する出力の状態を順列として第1の記憶部に記憶する順列記憶手段と、m個の入力のうち最初の入力を与えたときの出力値を求め、更にその出力値を入力値とすることを、最初の入力値と同じ出力値が得られるまで繰り返すと共に、その繰り返し回数を周期として第2の記憶部に記憶することを、前記m個の入力のすべてについて行う周期計算及び累計手段と、第2の記憶部に記憶された周期が前記mであるか否かを判定し、前記周期が前記mであるとき、その周期を前記所望の1個の前記全単射関数の最大周期であると決定する最大周期判定手段とを有することを特徴とする。   In order to achieve the above object, an integer sequence period determining apparatus according to a fourth aspect of the present invention includes first and second storage units, and 0 to m−1 (where m is an integer of 2 or more). M having an input (original image) and an output (image) of an integer sequence consisting of m integers whose values do not overlap. A permutation that stores, in the first storage unit, a state of an output with respect to an input of an integer sequence composed of the m integers of a desired one of the bijection functions (mapping) among a plurality of bijection functions (mappings). The storage means and the output value when the first input is given among the m inputs are obtained, and the output value is further set as the input value until the same output value as the first input value is obtained, and Storing the repetition count as a cycle in the second storage unit, the cycle calculation and accumulation means for all the m inputs, and whether the cycle stored in the second storage unit is m Maximum period determining means for determining whether or not the period is the maximum period of the desired one-shot bijection function when the period is m.

また、上記の目的を達成するため、第5の発明の整数系列の周期判定プログラムは、コンピュータに、第1の発明の整数系列の周期判定方法の第1乃至第3のステップを実行させることを特徴とする。   In order to achieve the above object, an integer sequence period determination program according to a fifth invention causes a computer to execute the first to third steps of the integer sequence period determination method according to the first invention. Features.

更に、上記の目的を達成するため、第6の発明の整数系列の周期判定プログラムは、コンピュータに、第2の発明の整数系列の周期判定方法の第1乃至第3のステップを実行させることを特徴とする。   Furthermore, in order to achieve the above object, an integer sequence period determination program according to a sixth aspect causes a computer to execute the first to third steps of the integer sequence period determination method according to the second aspect. Features.

本発明によれば、任意の大きさの自然数の集合を入力(原像)と出力(像)とした全単射関数(写像)を用いて出力を入力に帰還することで生成された整数系列の帰還周期の判定が行え、また、その整数系列の最大周期を判定することができる。   According to the present invention, an integer sequence generated by feeding back an output to an input using a bijection function (mapping) having a set of natural numbers of an arbitrary size as an input (original image) and an output (image). And the maximum period of the integer series can be determined.

本発明の整数系列の周期判定装置の第1の実施形態のブロック図である。1 is a block diagram of a first embodiment of an integer sequence period determination device of the present invention. FIG. 全単射関数の一例の説明図である。It is explanatory drawing of an example of a bijection function. 本発明による擬似乱数作成の概要の説明図である。It is explanatory drawing of the outline | summary of pseudorandom number preparation by this invention. 本発明の第1の実施形態の概要説明用フローチャートである。It is a flowchart for outline | summary description of the 1st Embodiment of this invention. 本発明の第1の実施形態の全単射関数の入出力データの順列作成の概要説明用フローチャートである。It is a flowchart for outline | summary description of permutation creation of the input-output data of the bijection function of the 1st Embodiment of this invention. 本発明の第1の実施形態の作成した各々の順列データから各周期を判定する概要説明用フローチャートである。It is a flowchart for outline | summary description which determines each period from each permutation data which the 1st Embodiment of this invention produced. 本発明の第1の実施形態の動作を説明するフローチャート(その1)である。It is a flowchart (the 1) explaining operation | movement of the 1st Embodiment of this invention. 本発明の第1の実施形態の動作を説明するフローチャート(その2)である。It is a flowchart (the 2) explaining operation | movement of the 1st Embodiment of this invention. 図7中のステップS1の詳細動作を説明するフローチャートである。It is a flowchart explaining the detailed operation | movement of step S1 in FIG. 本発明による周期の判定動作のための関数帰還を説明する図である。It is a figure explaining the function feedback for the determination operation | movement of the period by this invention. 本発明の整数系列の周期判定装置の第2、第3の実施形態のブロック図である。It is a block diagram of 2nd, 3rd embodiment of the period determination apparatus of the integer series of this invention. 本発明の第2の実施形態の動作を説明するフローチャート(その1)である。It is a flowchart (the 1) explaining operation | movement of the 2nd Embodiment of this invention. 本発明の第2の実施形態の動作を説明するフローチャート(その2)である。It is a flowchart (the 2) explaining operation | movement of the 2nd Embodiment of this invention. 本発明の第3の実施形態の動作を説明するフローチャートである。It is a flowchart explaining the operation | movement of the 3rd Embodiment of this invention.

次に、本発明の各実施形態について、図面と共に詳細に説明する。   Next, each embodiment of the present invention will be described in detail with reference to the drawings.

(第1の実施形態)
図1は、本発明になる整数系列の周期判定装置の第1の実施形態のブロック図を示す。同図に示すように、本実施形態の整数系列の周期判定装置1Aは、装置1A全体を統括的に制御する制御部2A、データ数記憶部3、順列作成部4、順列記憶部5、周期計算部6、入力指定部7、出力記憶部8、周期累計部9、周期記憶部10、順列数設定部11、検索位置指定部12から構成されている。
(First embodiment)
FIG. 1 shows a block diagram of a first embodiment of an integer sequence period determining apparatus according to the present invention. As shown in the figure, the integer sequence period determining apparatus 1A of the present embodiment includes a control unit 2A that centrally controls the entire apparatus 1A, a data number storage unit 3, a permutation creation unit 4, a permutation storage unit 5, a period The calculation unit 6, the input designation unit 7, the output storage unit 8, the cycle accumulation unit 9, the cycle storage unit 10, the permutation number setting unit 11, and the search position designation unit 12 are configured.

制御部2A、順列作成部4、周期計算部6、順列数設定部11及び検索位置指定部12は、例えば中央処理装置(CPU)により構成される。また、データ数記憶部3、出力記憶部8、周期累計部9及び周期記憶部10は記憶装置により構成され、入力指定部7は所定の入力装置により構成される。   The control unit 2A, the permutation creation unit 4, the period calculation unit 6, the permutation number setting unit 11, and the search position designation unit 12 are configured by, for example, a central processing unit (CPU). Further, the data number storage unit 3, the output storage unit 8, the cycle accumulation unit 9, and the cycle storage unit 10 are configured by a storage device, and the input designation unit 7 is configured by a predetermined input device.

データ数記憶部3は、単射で、かつ、全射でもある関数である全単射関数の有する連続した自然数の入出力データ(原像及び像)の数Mを記憶する。順列作成部4は、全単射関数の入力に対する出力データ(原像に対する像)の並びである順列A(i)を作成する。この場合、順列A(i)は、出力データの値は重複せず、全ての値が出現するように作成される。   The data number storage unit 3 stores the number M of continuous natural number input / output data (original image and image) possessed by a bijection function that is a bijection and a bijection function. The permutation creating unit 4 creates a permutation A (i) that is a sequence of output data (images with respect to the original image) with respect to the input of the bijection function. In this case, the permutation A (i) is created so that the values of the output data do not overlap and all values appear.

順列記憶部5は、後述するようにして作成された任意の大きさ(データ数M)m(mは2以上の自然数)の全ての全単射関数(写像)の入力に対する出力(原像に対する像)の状態を示す順列S(i,j)を記憶する第1の記憶部である。周期計算部6は、後述するように任意の全単射関数の入力に対する出力データ(原像に対する像)を更に入力とする手順を繰り返し行って、作成する整数系列の周期Pを計算する。   The permutation storage unit 5 outputs all bijective functions (mappings) of arbitrary size (number of data M) m (m is a natural number of 2 or more) created as described later (for the original image). The first storage unit stores a permutation S (i, j) indicating the state of the image. As will be described later, the period calculation unit 6 repeatedly performs a procedure in which output data (an image for the original image) for an arbitrary bijective function input is further input, and calculates a period P of the integer sequence to be created.

入力指定部7は、入力位置(原像の位置)INPを指定する。出力記憶部8は、入力指定部7で指定された入力位置の周期計算部6の出力データ(像)の値OUTPを記憶する。周期累計部9は、周期計算部6で計算した周期Pの累計結果PSを記憶する。   The input designation unit 7 designates an input position (original image position) INP. The output storage unit 8 stores the value OUTP of the output data (image) of the cycle calculation unit 6 at the input position specified by the input specification unit 7. The period accumulating unit 9 stores the accumulated result PS of the period P calculated by the period calculating unit 6.

周期記憶部10は、順列数設定部11が指定した周期計算部6の周期計算結果PR(PM,M)を記憶する第2の記憶部である。本実施形態では、周期記憶部10は、任意の大きさ(データ数M)mの全ての全単射関数の各々の周期について存在数を記憶する。順列数設定部11は、任意のデータ数mの全ての全単射関数の存在数PMを記憶する。検索位置指定部12は、順列作成部4において作成される任意の順列の値A(i)の既に作成された、それまでの順列の検索位置POSを指定する。   The cycle storage unit 10 is a second storage unit that stores the cycle calculation result PR (PM, M) of the cycle calculation unit 6 specified by the permutation number setting unit 11. In the present embodiment, the cycle storage unit 10 stores the number of existence for each cycle of all bijective functions having an arbitrary size (number of data M) m. The permutation number setting unit 11 stores the existence number PM of all bijection functions of an arbitrary number of data m. The search position designating unit 12 designates the search position POS of the permutation so far created for the value A (i) of any permutation created by the permutation creating unit 4.

上記の構成のうち、制御部2A、データ数記憶部3、順列作成部4、入力指定部7、順列数設定部11、及び検索位置指定部12は、m!個の全単射関数についてのm種類の入出力に対する出力の状態をすべて順列として生成して第1の記憶部である順列記憶部5に記憶する順列生成及び記憶手段を構成する。また、制御部2A、データ数記憶部3、周期計算部6、入力指定部7、出力記憶部8、周期累計部9、及び順列数設定部11は、周期計算及び累計手段と、第2の記憶部である周期記憶部10に判定した周期を記憶する記憶手段とを構成する。   Among the above configurations, the control unit 2A, the data number storage unit 3, the permutation creation unit 4, the input designation unit 7, the permutation number setting unit 11, and the search position designation unit 12 are m! A permutation generation and storage unit is configured to generate all the states of outputs for m types of input / output for each bijection function as permutations and store them in the permutation storage unit 5 as the first storage unit. In addition, the control unit 2A, the data number storage unit 3, the cycle calculation unit 6, the input designation unit 7, the output storage unit 8, the cycle accumulation unit 9, and the permutation number setting unit 11 include a cycle calculation and accumulation unit, The memory | storage means which memorize | stores the determined period in the period memory | storage part 10 which is a memory | storage part is comprised.

ところで、図2に示すように、m個の自然数x(例えば、データの集合X={x|x=natural number,0≦x≦(m-1)})を入力(原像)と出力(像)とする、全ての全単射関数(写像)fの数は、m!存在することが知られている。本発明は、入力データと出力データとが一対一で対応する全単射関数を用いた変換による擬似乱数系列の生成において、図3に示すように、m個の自然数をその関数による変換の写像の原像である入力データ(0〜mー1)と、像となる出力データ(0〜mー1)とし、出力データを更に入力データとして帰還するような帰還系列(擬似乱数系列)について、すべての周期を判定するものである。   By the way, as shown in FIG. 2, m natural numbers x (for example, data set X = {x | x = natural number, 0 ≦ x ≦ (m−1)}) are input (original image) and output (original image). The number of all bijection functions (mappings) f, which is an image), is m! It is known to exist. In the generation of a pseudo-random number sequence by conversion using a bijection function in which input data and output data correspond one-to-one, the present invention maps m natural numbers to conversion by the function as shown in FIG. The input data (0-m-1) that is the original image and the output data (0-m-1) that becomes the image, and the feedback sequence (pseudorandom number sequence) that feeds back the output data as input data, All cycles are determined.

本発明では、m!個の全単射関数についてのm種類の入力に対する出力の状態を、全て順列として列記することで得る。これは、0〜(m−1)を最初の全単射関数の出力の順列とし、それ以降の全単射関数の出力の並びは、1つ前の順列において、その最後の出力の位置からバックトラックとインクリメンタルサーチの手法を用いて行うことで、次の順列を求めることができる。   In the present invention, m! The output states for the m types of inputs for each of the bijection functions are all obtained by listing them as permutations. This means that 0 to (m−1) is the permutation of the output of the first bijection function, and the output sequence of the bijection function after that is the position of the last output in the previous permutation. By using the backtracking and incremental search techniques, the next permutation can be obtained.

次に、本発明では、上記の方法で求めた順列(関数)について、最初の入力値(例えば0)から、その入力と同じ出力値(例えば0)となるまで変換を行い、その変換回数を周期として求める。更に、ここで出力値として出現しないものの入力値についても順に同様な変換を行い、その最初の入力値に戻るまでの変換回数を周期として求める。すべての入力値が出現した場合には、全ての周期とその周期の出現回数が求まる。また、任意の一つの全単射関数について上記と同様の手順により全ての周期とその出現回数を求めることが可能である。   Next, in the present invention, the permutation (function) obtained by the above method is converted from the first input value (for example, 0) to the same output value (for example, 0) as the input, and the number of conversions is calculated. Calculate as a period. Further, similar conversions are sequentially performed for input values that do not appear as output values, and the number of conversions until the first input value is returned is obtained as a cycle. When all the input values appear, all the cycles and the number of appearances of the cycle are obtained. Further, it is possible to obtain all the cycles and the number of appearances of any one bijective function by the same procedure as described above.

本発明における上記の全単射関数は、m個の自然数による任意の並びの単なる順列の表、ラテン方陣のような変換表(換字表)、Sボックス、ブロック暗号、帰還型ストリーム暗号に相当し、本発明で周期が判定される整数系列は、ブロック暗号のOFB(Output Feed Back)モードや帰還型ストリーム暗号の出力系列に相当する。   The bijection function in the present invention corresponds to a simple permutation table of arbitrary arrangements of m natural numbers, a conversion table (substitution table) such as a Latin square, an S box, a block cipher, and a feedback stream cipher. The integer sequence for which the period is determined in the present invention corresponds to an OFB (Output Feed Back) mode of block cipher or an output sequence of feedback stream cipher.

ここで、大きさ2(m=2)の全ての全単射関数の入出力データの関係は、下記に示される。   Here, the relationship between the input and output data of all bijective functions of size 2 (m = 2) is shown below.

f1=[0 1]:0→0,1→1
f2=[1 0]:0→1→0
上記の→の左側の値は入力値、右側の値は出力値を示す(後述する他の例も同様)。従って、1番目の入出力データの関係f1では、0が入力されると0が出力される場合と、1が入力されると1が出力される場合を示しており、周期1が2個である。また、2番目の入出力データの関係f2では、0が入力されると1が出力され、1が入力されると0が出力される場合を示しており、周期2が1個であることを示す。従って、m=2の整数系列の全ての全単射関数は、周期1が2個と周期2(最大周期)が1個を有すると結論することができる。この例は次のような表で表すこともできる。
f1 = [0 1]: 0 → 0, 1 → 1
f2 = [1 0]: 0 → 1 → 0
The value on the left side of the above → indicates an input value, and the value on the right side indicates an output value (the same applies to other examples described later). Therefore, the relationship f1 of the first input / output data shows a case where 0 is output when 0 is input, and a case where 1 is output when 1 is input. is there. The second input / output data relationship f2 indicates that 1 is output when 0 is input, and 0 is output when 1 is input, and the period 2 is one. Show. Therefore, it can be concluded that all bijective functions of an integer sequence of m = 2 have two periods 1 and one period 2 (maximum period). This example can also be represented by the following table.

Figure 2011123693
同様に、大きさ3(m=3)の全ての全単射関数の入出力データの関係は、下記に示される。
Figure 2011123693
Similarly, the relationship between input and output data of all bijective functions of size 3 (m = 3) is shown below.

f1=[0 1 2]:0→0,1→1,2→2(ゆえに、周期1が3個)
f2=[0 2 1]:0→0,1→2→1(ゆえに、周期1が1個と周期2が1個)
f3=[1 0 2]:0→1→0,2→2(ゆえに周期1が1個と周期2が1個)
f4=[1 2 0]:0→1→2→0(ゆえに周期3が1個)
f5=[2 0 1]:0→2→1→0(ゆえに周期3が1個)
f6=[2 1 0]:0→2→0,1→1(ゆえに周期1が1個と周期2が1個)
よって、m=3の場合では、全ての全単射関数は、周期1が6個と周期2が3個と周期3(最大周期)が2個を有すると結論できる。この例は次のような表で表すこともできる。
f1 = [0 1 2]: 0 → 0,1 → 1,2 → 2 (hence three periods 1)
f2 = [0 2 1]: 0 → 0, 1 → 2 → 1 (hence, 1 period 1 and 1 period 2)
f3 = [1 0 2]: 0 → 1 → 0,2 → 2 (hence, 1 period 1 and 1 period 2)
f4 = [1 2 0]: 0 → 1 → 2 → 0 (hence one cycle 3)
f5 = [2 0 1]: 0 → 2 → 1 → 0 (hence one cycle 3)
f6 = [2 1 0]: 0 → 2 → 0,1 → 1 (hence, 1 period 1 and 1 period 2)
Therefore, in the case of m = 3, it can be concluded that all bijective functions have 6 periods 1, 3 periods 2, and 2 periods 3 (maximum period). This example can also be represented by the following table.

Figure 2011123693
同様に、m個の自然数(整数)からなる整数系列の全ての全単射関数の入出力データの関係は、下記の表3で表すことができる。
Figure 2011123693
Similarly, the relationship of input / output data of all bijection functions of an integer series consisting of m natural numbers (integers) can be expressed in Table 3 below.

Figure 2011123693
図1に示す第1の実施形態の整数系列の周期判定装置1Aは、入出力データの大きさが任意のmの場合の全ての全単射関数の全ての整数系列の作成とその系列の全周期を判定する装置の例である。まず、本実施形態の動作の概要について説明する。
Figure 2011123693
The integer sequence period determining apparatus 1A of the first embodiment shown in FIG. 1 creates all integer sequences of all bijection functions when the size of input / output data is an arbitrary m, and all the sequences of the sequences. It is an example of the apparatus which determines a period. First, an outline of the operation of the present embodiment will be described.

図4は、本実施形態の概要のフローチャートを示す。同図に示すように、整数系列の周期判定装置1Aは、まず1つの全単射関数の出力の順列データを作成する(ステップS151)。続いて、整数系列の周期判定装置1Aは、ステップS151で作成した順列データから、全単射関数の出力から入力への帰還を繰り返すことによる帰還系列の周期について部分周期最大周期の全ての周期(長)を判定する(ステップS152)。   FIG. 4 shows a flowchart of the outline of the present embodiment. As shown in the figure, the integer sequence period determining apparatus 1A first creates permutation data of the output of one bijection function (step S151). Subsequently, the integer sequence period determination apparatus 1A determines all the periods of the maximum partial period for the period of the feedback sequence by repeating the feedback from the output of the bijection function to the input from the permutation data created in step S151. Long) is determined (step S152).

図5は、図4のステップS151の順列データ作成動作の詳細を示す。図5に示すように、順列データ作成処理では、最初の関数の順列データを作成し(ステップS201)、続いて、二番目の関数の順列データを最初のデータから作成する(ステップS202)。以下、同様にして、m!番目の関数の順列データをm!−1番目の順列データから作成する(ステップS203)。   FIG. 5 shows details of the permutation data creation operation in step S151 of FIG. As shown in FIG. 5, in the permutation data creation process, permutation data of the first function is created (step S201), and then permutation data of the second function is created from the first data (step S202). In the same manner, m! The permutation data of the second function is m! -Created from the first permutation data (step S203).

図6は、図4のステップS152の作成した順列データから周期を判定する動作の詳細を示す。図6に示すように、周期判定処理では、最初の関数の順列データの各周期を累計し、周期記憶部10に加算する(ステップS301)。続いて、二番目の関数の順列データの各周期を累計し、周期記憶部10に加算する(ステップS302)。以下、同様にして、m!番目の関数の順列データの各周期を累計し周期記憶部10に加算する(ステップS303)。   FIG. 6 shows details of the operation for determining the period from the permutation data created in step S152 of FIG. As shown in FIG. 6, in the period determination process, the periods of the permutation data of the first function are accumulated and added to the period storage unit 10 (step S301). Subsequently, each period of the permutation data of the second function is accumulated and added to the period storage unit 10 (step S302). In the same manner, m! The respective periods of the permutation data of the th function are accumulated and added to the period storage unit 10 (step S303).

次に、本実施形態の整数系列の周期判定装置1Aによる動作について、更に詳細に説明する。図7及び図8は、図4で説明した本実施形態の概要動作を更に詳細に説明するフローチャートを示す。図9は、図7中のステップS1で作成する順列(整数系列データ)の作成方法の詳細動作説明用フローチャートを示す。図7のステップS1は、図5のフローチャートで概要動作を説明した処理ステップであり、図7のステップS2以降と図8の各ステップは、図6のフローチャートで概要動作を説明した処理の詳細動作を説明するものである。   Next, the operation of the integer series period determination device 1A of the present embodiment will be described in more detail. 7 and 8 are flowcharts for explaining the outline operation of the present embodiment described in FIG. 4 in more detail. FIG. 9 is a flowchart for explaining the detailed operation of the permutation (integer series data) creation method created in step S1 in FIG. Step S1 in FIG. 7 is a processing step whose outline operation has been described with reference to the flowchart of FIG. 5. Step S2 and subsequent steps in FIG. 7 and each step in FIG. 8 are detailed operations of the process whose outline operation has been described with reference to the flowchart of FIG. Is described.

まず、図1の制御部2Aは、順列作成部4にて作成したm!(ここでは、m=2)個の順列A(0)〜A(m-1)を順列記憶部5に設定する(図7のステップS1)。このステップS1による順列の作成は、出力データの最初の位置として順列作成部4のA(0)から最後の位置A(m-1)に未設定の昇順の自然数(0〜m-1)を重複が発生しないように順に設定してゆく図9のバックトラック技法とインクリメンタルサーチ技法により作成可能である。   First, the control unit 2A in FIG. (Here, m = 2) permutations A (0) to A (m-1) are set in the permutation storage unit 5 (step S1 in FIG. 7). The creation of the permutation in step S1 is performed by setting an ascending natural number (0 to m-1) not set from A (0) to the last position A (m-1) of the permutation creation unit 4 as the first position of the output data. It can be created by the backtrack technique and the incremental search technique of FIG. 9, which are set in order so that no overlap occurs.

周期を判定すべき関数の出力データの順列が完成したら、順列作成部4の順列A(0)〜A(m-1)のデータをm!番目の順列記憶部5の順列S(m!,0)〜S(m!,m-1)に設定する。更に、m!個のうちの残りのm!-1個の全ての系列S(m!-1,0)〜S(m!-1,m-1)、・・・、S(1,0)〜S(1,m-1)についても、一つ前の系列データS(m!,0)〜S(m!,m-1)のセットを用いて、その最後の位置m-1のデータからバックトラックすることで新たな次のm!-1番目の系列S(m!-1,0)〜S(m!-1,m-1)を求めることが可能であり、これを順次行うことでm個の系列のデータを各々有する全てのm!組の関数の系列データS(m!,0)〜S(m!,m-1)、・・・、S(1,0)〜S(1,m-1)を作成することが可能である。   When the permutation of the output data of the function whose period is to be determined is completed, the data of permutations A (0) to A (m-1) of the permutation creation unit 4 is m! Set to permutations S (m!, 0) to S (m!, M-1) in the first permutation storage unit 5. Furthermore, m! The remaining m! -1 of all the sequences S (m! -1,0) to S (m! -1, m-1), ..., S (1,0) to S ( 1, m-1) also uses the set of the previous series data S (m!, 0) to S (m!, M-1) and backtracks from the data at the last position m-1. By doing so, it is possible to obtain a new next m! -1st sequence S (m! -1,0) to S (m! -1, m-1). All m with each series of data! It is possible to create series data S (m!, 0) to S (m!, M-1), ..., S (1,0) to S (1, m-1) for a set of functions is there.

なお、この順列記憶部5に設定した判定用の順列は事前にm!-1個全てを作成し準備しておくものとしているが、他の方法として一つの周期判定の前に各々順に同様の手法で作成することにより系列データの記憶場所である順列記憶部5に1つだけ事前に設定することで使用する記憶場所として順列記憶部を一つ分のみ重複して使用し記憶部の使用量をm!−1個削減することも可能である。   Note that all the permutations for determination set in the permutation storage unit 5 are prepared and prepared in advance. However, as another method, the same permutation may be performed in order before one cycle determination. By using only one permutation storage unit as a storage location to be used by setting in advance one permutation storage unit 5 that is a storage location of the series data by creating the method, the amount of storage unit used M! It is also possible to reduce by -1.

ここでは全単射関数の入出力データの大きさ(サイズ)mが2の場合についての例を説明する。   Here, an example in which the input / output data size (size) m of the bijection function is 2 will be described.

このステップS1による順列(整数系列データ)の作成方法について、図9のフローチャートと共に説明する。まず、制御部2Aは、順列数設定部11に全単射関数の系列の数(順列数)m!(ここでは、m!=2)を設定する(ステップS101)。続いて、制御部2Aは、データ数記憶部3にデータ数m(ここではm=2)を設定し(ステップS102)、更に入力指定部7の値INPをデータの先頭の位置を示すものとして0に初期化した後(ステップS103)、入力指定部7が示す位置の順列作成部4の順列データの値A(INP)を0に設定する(ステップS104)。これにより、最初の設定位置の順列データはA(INP)=A(0)=0となる。   A method for creating a permutation (integer series data) in step S1 will be described with reference to the flowchart of FIG. First, the control unit 2A causes the permutation number setting unit 11 to include the number of sequences of the bijection function (number of permutations) m! (Here, m! = 2) is set (step S101). Subsequently, the control unit 2A sets the data number m (here, m = 2) in the data number storage unit 3 (step S102), and further sets the value INP of the input designation unit 7 to indicate the head position of the data. After initialization to 0 (step S103), the permutation data value A (INP) of the permutation creation unit 4 at the position indicated by the input designation unit 7 is set to 0 (step S104). As a result, the permutation data at the first set position is A (INP) = A (0) = 0.

次に、制御部2Aは、入力指定部7の値INPがデータの先頭の設定位置である0かどうかを判断し(ステップS105)、先頭の設定位置0であればステップS106へ進み、先頭の位置0でなければデータの重複有無のチェックのためステップS108へ進む。ここでは、入力指定部7の値INPがステップS103により先頭の設定位置0とされているので、ステップS106に進み、入力指定部7の値INPが最後の設定位置m−1(=1)かどうかを判断する。ここでは、入力指定部7の値INPが先頭の設定位置0であり最後の設定位置m−1(=1)ではないので、入力指定部7の値INPを次のデータの設定位置として1だけ加算した後(ステップS107)、順列作成部4の値A(INP)(ここでは、A(1))に設定データとして0を設定する(ステップS104)。これにより、A(INP)=A(1)=0となる。   Next, the control unit 2A determines whether or not the value INP of the input specifying unit 7 is 0, which is the first setting position of the data (step S105). If the first setting position is 0, the control unit 2A proceeds to step S106. If it is not the position 0, the process proceeds to step S108 to check for data duplication. Here, since the value INP of the input designation unit 7 is set to the first setting position 0 in step S103, the process proceeds to step S106, and whether the value INP of the input designation unit 7 is the last setting position m-1 (= 1). Judge whether. Here, since the value INP of the input designation unit 7 is the first setting position 0 and not the last setting position m−1 (= 1), the value INP of the input designation unit 7 is set to 1 as the next data setting position. After the addition (step S107), 0 is set as setting data to the value A (INP) (here, A (1)) of the permutation creation unit 4 (step S104). As a result, A (INP) = A (1) = 0.

次に、制御部2Aは、入力指定部7の値INPが先頭のデータの位置として0かどうかを判断する(ステップS105)。ここでは、INPはステップS107により1とされており、先頭の位置0ではないのでステップS108へ進み、検索位置指定部12が示す検索位置POSを0に初期化する。続いて、制御部2Aは、入力指定部7が示す順列作成部4の値A(INP)が、検索位置指定部12が示す順列作成部4の値A(POS)と等しいかどうかを判定する(ステップS109)。ここでは、設定されているデータの値A(INP)がA(1)=0であり、検索位置のデータA(POS)がA(0)であり、A(0)は最初のステップS104の処理で0とされているため、両者は等しく、重複していると判定される(ステップS109のYes)。   Next, the control unit 2A determines whether or not the value INP of the input specifying unit 7 is 0 as the position of the top data (step S105). Here, INP is set to 1 in step S107 and is not the leading position 0, so the process proceeds to step S108, and the search position POS indicated by the search position specifying unit 12 is initialized to 0. Subsequently, the control unit 2A determines whether the value A (INP) of the permutation creation unit 4 indicated by the input designation unit 7 is equal to the value A (POS) of the permutation creation unit 4 indicated by the search position designation unit 12. (Step S109). Here, the value A (INP) of the set data is A (1) = 0, the data A (POS) at the search position is A (0), and A (0) is the first step S104. Since it is set to 0 in the process, it is determined that both are equal and overlap (Yes in step S109).

制御部2Aは、これにより、入力指定部7が示す順列作成部4の値A(INP)がデータの最大の設定値m−1と等しいかどうか判定する(ステップS115)。この時点では、A(INP)=A(1)=0であり、1(=mー1)と等しくないため、入力指定部7が示す順列作成部4の値A(INP)を1だけ加算して(ステップS119)、ステップS105に戻る。これにより、A(1)=1となる。   Thereby, the control unit 2A determines whether or not the value A (INP) of the permutation creation unit 4 indicated by the input designation unit 7 is equal to the maximum set value m−1 of the data (step S115). At this time point, A (INP) = A (1) = 0 and is not equal to 1 (= m−1), so the value A (INP) of the permutation creation unit 4 indicated by the input designation unit 7 is incremented by 1. Then (step S119), the process returns to step S105. As a result, A (1) = 1.

続いて、制御部2Aは、入力指定部7の値INPが先頭の設定位置0であるかどうかを判定し(ステップS105)、ここでは先頭の設定位置0ではないので、ステップS108に進んで検索位置指定部12が示す検索位置POSを先頭の設定位置0に初期化した後、再び入力指定部7が示す順列作成部4の値A(INP)が、検索位置指定部12が示す順列作成部4の値A(POS)と等しいかどうかを判定する(ステップS109)。この時点では、A(INP)がA(1)=1であり、A(POS)がA(0)=0であるため、両者は等しくないと判定される(ステップS109のNo)。   Subsequently, the control unit 2A determines whether or not the value INP of the input designating unit 7 is the head setting position 0 (step S105). Here, since the head setting position 0 is not 0, the process proceeds to step S108. After the search position POS indicated by the position specifying unit 12 is initialized to the first set position 0, the value A (INP) of the permutation generating unit 4 indicated by the input specifying unit 7 is again the permutation generating unit indicated by the search position specifying unit 12. It is determined whether or not it is equal to the value A (POS) of 4 (step S109). At this time, since A (INP) is A (1) = 1 and A (POS) is A (0) = 0, it is determined that they are not equal (No in step S109).

これにより、制御部2Aは、検索位置指定部12の検索位置の値POSを1だけ加算した後(ステップS110)、検索位置指定部12の値POSと入力指定部7の値INPとが等しいかどうかを判定する(ステップS111)。ステップS111の判定の結果、上記のPOSとINPとが等しいときには、全てのデータに重複が無いということになり、ステップS106に進み、等しくないときにはステップS109に進む。この時点では、上記のPOSとINPとは共に1であるので、両者は等しいと判定される。これにより、制御部2AはステップS106に進み、入力指定部7の値INPがデータの最後の設定位置1(=m−1)かどうかを判定する。   Thereby, the control unit 2A adds 1 to the search position value POS of the search position specifying unit 12 (step S110), and then whether the value POS of the search position specifying unit 12 and the value INP of the input specifying unit 7 are equal to each other. It is determined whether or not (step S111). If the result of determination in step S111 is that POS and INP are equal, it means that there is no duplication in all data, and the process proceeds to step S106, and if not, the process proceeds to step S109. At this time, since both POS and INP are 1, it is determined that both are equal. Thereby, the control unit 2A proceeds to step S106, and determines whether the value INP of the input designating unit 7 is the last setting position 1 (= m−1) of the data.

ステップS106では、等しいと判定されるため、一つの関数のデータの作成が完了したことになり、続いて制御部2Aは順列数設定部11のPM(これはステップS101で設定されたm!=2である)の示す順列記憶部5の順列S(PM,0)〜S(PM,m-1)、すなわちS(2,0)、S(2,1)に、作成済みの関数のデータが設定された順列作成部4の値A(0)〜A(m-1)、すなわち、1番目の関数データの順列の値としてA(0)=0、A(1)=1を設定する(ステップS112)。   In step S106, since it is determined that they are equal, creation of data of one function is completed, and then the control unit 2A performs PM of the permutation number setting unit 11 (this is m! = Set in step S101). 2), the function data already created in the permutations S (PM, 0) to S (PM, m-1), that is, S (2,0) and S (2,1). Is set as values A (0) to A (m−1) of the permutation creation unit 4 in which A is set, that is, A (0) = 0 and A (1) = 1 as the permutation values of the first function data (Step S112).

続いて、制御部2Aは、順列数設定部11の示す値PMが最後の関数の数列の設定数の1かどうかを判定するが、1であれば全ての関数のデータm!−1個を作成済みとなり、もし1で無ければさらに残りの関数のデータの作成を行う(ステップS113)。この時点では、順列数設定部11の示す値PMは2であり、最後の関数データの値1ではないので、順列数設定部11の示す値PMを1だけ減算し次の関数データの設定位置を示すようにした後(ステップS114)、入力指定部7が示す順列作成部4の値A(INP)がデータの最大の設定値m−1であるかどうかを判定する(ステップS115)。   Subsequently, the control unit 2A determines whether or not the value PM indicated by the permutation number setting unit 11 is 1, which is the set number of the last function sequence. -1 has been created. If it is not 1, data for the remaining functions is created (step S113). At this time point, the value PM indicated by the permutation number setting unit 11 is 2, not the value 1 of the last function data, so the value PM indicated by the permutation number setting unit 11 is subtracted by 1, and the setting position of the next function data (Step S114), it is determined whether or not the value A (INP) of the permutation creation unit 4 indicated by the input designation unit 7 is the maximum set value m-1 of the data (step S115).

この時点では、入力指定部7が示す順列作成部4の値A(INP)がA(1)=1であり、最大の値m−1に等しいので、続いて入力指定部7の値INPを1だけ減算し順列作成部の設定位置を戻した後(ステップS116)、入力指定部7の値INPはデータの先頭の設定位置0かどうか判定する(ステップS117)。この時点では入力指定部7の値INPは0で先頭であるので、制御部2Aは続いて入力指定部7の示す順列作成部4の値A(INP)、すなわちA(0)が最大の値m−1であるかどうかを判定する(ステップS118)。この時点では、A(0)は0であり、最大の値m−1(=1)に等しくないので、制御部2Aは入力指定部7の示す順列作成部4の値である関数の設定データA(INP)を次の順序の値として1だけ加算して(ステップS119)、ステップS105に戻る。これにより、関数データの設定値A(0)は1とされる。   At this time, the value A (INP) of the permutation creation unit 4 indicated by the input designation unit 7 is A (1) = 1 and is equal to the maximum value m−1. After subtracting 1 and returning the setting position of the permutation creating unit (step S116), it is determined whether or not the value INP of the input designating unit 7 is the first setting position 0 of the data (step S117). At this time, since the value INP of the input designating unit 7 is 0 and leading, the control unit 2A continues to the value A (INP) of the permutation creating unit 4 indicated by the input designating unit 7, that is, A (0) is the maximum value. It is determined whether or not m-1 (step S118). At this time point, A (0) is 0, which is not equal to the maximum value m−1 (= 1), so the control unit 2A sets the function setting data that is the value of the permutation creation unit 4 indicated by the input designation unit 7 A (INP) is incremented by 1 as the next order value (step S119), and the process returns to step S105. Thereby, the set value A (0) of the function data is set to 1.

制御部2Aは、ステップS105において、入力指定部7の値INPが先頭のデータの設定位置0であると判定し、続いてステップS106において入力指定部7の値INPがデータの最大の設定値1(=m−1)と等しくないと判定し、ステップS107において入力指定部7のデータの設定位置の値INPを1だけ加算して次の設定データの位置の値として1とした後、ステップS104に戻り、入力指定部7の示す順列作成部4の関数データの設定値A(INP)を0に設定する。これにより、2番目の設定データA(INT)=A(1)=0となる。   In step S105, the control unit 2A determines that the value INP of the input designation unit 7 is the setting position 0 of the first data, and then in step S106, the value INP of the input designation unit 7 is the maximum set value 1 of the data. In step S107, the data setting position value INP of the input designation unit 7 is incremented by 1 to set it to 1 as the next setting data position value, and then in step S104. Returning to FIG. 4, the function data setting value A (INP) of the permutation creation unit 4 indicated by the input designation unit 7 is set to zero. As a result, the second setting data A (INT) = A (1) = 0.

続いて、制御部2Aは、入力指定部7のデータの設定位置の値INPが先頭の位置0かどうかを判定し(ステップS105)、この時点ではINPは1であり、先頭の位置の値0ではないので、検索位置指定部12の検索位置の値POSを0に設定し(ステップS108)、入力指定部7が示す順列作成部4の値A(INP)が、検索位置指定部12が示す順列作成部4の値A(POS)と等しいかどうかを判定する(ステップS109)。ここでは、設定されたデータA(INP)がA(1)=0であり、検索位置のデータはA(POS)=A(0)=1であり、両者は等しくないため、ステップS110へ進んで検索位置指定部12の検索位置の値POSを次の値1にした後、ステップS111において検索位置の値POSが入力指定部7の値INPと等しいかどうかを判定する。この時点では、POS=INP=1であるので、ステップS106に進んで入力指定部7のデータ設定位置の値INPが1(=m−1)と等しいかどうかを判定する。この時点では、データの設定位置INP=1で最後の位置であるので、ステップS112に進んで順列記憶部5の順列S(PM,0)〜S(PM,m-1)、すなわち2番目の関数データの順列の値としてS(1,0)、S(1,1)に、順列作成部4の設定データの値A(0)=1、A(1)=0を設定する。   Subsequently, the control unit 2A determines whether or not the data setting position value INP of the input specifying unit 7 is the leading position 0 (step S105). At this time, INP is 1, and the leading position value is 0. Therefore, the search position value POS of the search position specifying unit 12 is set to 0 (step S108), and the value A (INP) of the permutation creating unit 4 indicated by the input specifying unit 7 is indicated by the search position specifying unit 12. It is determined whether it is equal to the value A (POS) of the permutation creation unit 4 (step S109). Here, since the set data A (INP) is A (1) = 0 and the data at the search position is A (POS) = A (0) = 1, and they are not equal, the process proceeds to step S110. After the search position value POS of the search position specifying unit 12 is set to the next value 1, it is determined whether or not the search position value POS is equal to the value INP of the input specifying unit 7 in step S111. At this time, since POS = INP = 1, the process proceeds to step S106 to determine whether or not the value INP of the data setting position of the input designating unit 7 is equal to 1 (= m−1). At this time, since the data setting position INP = 1 is the last position, the process proceeds to step S112, and the permutations S (PM, 0) to S (PM, m-1) of the permutation storage unit 5, that is, the second position. The values A (0) = 1 and A (1) = 0 of the setting data of the permutation creation unit 4 are set in S (1,0) and S (1,1) as permutation values of the function data.

そして、制御部2Aは順列数設定部11の値PMが最後の関数の数列の設定数の1であるかどうかを判定する(ステップS113)。この時点では順列数設定部11の値PMが最後の関数の設定数1であるので、制御部2Aは全数列を作成したことになるので、処理を終了する。   Then, the control unit 2A determines whether or not the value PM of the permutation number setting unit 11 is 1 of the set number of the last function sequence (step S113). At this time, since the value PM of the permutation number setting unit 11 is the setting number 1 of the last function, the control unit 2A has created all the number sequences, and thus ends the processing.

このようにして、順列記憶部5の順列S(PM,0)〜S(PM,m-1)、すなわちS(2,0)、S(2,1)、S(1,0)、S(1,1)に、順列作成部4の値(順列)が記憶される。   In this way, the permutations S (PM, 0) to S (PM, m-1) of the permutation storage unit 5, that is, S (2,0), S (2,1), S (1,0), S The value (permutation) of the permutation creation unit 4 is stored in (1,1).

再び図7及び図8に戻って説明する。上記のステップS1の処理後、制御部2Aは、順列数設定部11に任意のデータ数mの全ての全単射関数の存在数(出力系列の数)PMとしてm!(=2)を設定した後(図7のステップS2)、データ数記憶部3に入出力データ(原像及び像)の数M(=m=2)を設定する(図7のステップS3)。   Returning to FIG. 7 and FIG. After the processing in step S1, the control unit 2A sets the permutation number setting unit 11 to m! As the existence number (number of output series) PM of all bijection functions having an arbitrary number of data m. After setting (= 2) (step S2 in FIG. 7), the number M (= m = 2) of input / output data (original image and image) is set in the data number storage unit 3 (step S3 in FIG. 7). .

続いて、制御部2Aは、周期記憶部10の各周期の個数を設定するPR(1,1)〜PR(m!,m)に各系列(1からm!)の各周期(1からm)の初期値として0を設定した後(図7のステップS4)、順列記憶部5に記憶され、順列数設定部11が示す全単射関数の1番目(PM=2)の系列データである順列S(2,0)〜S(2,m-1)の値(S(2,0)=0、S(2,1)=1)を周期計算部6にm個(m=2)の周期の計算用データP(0)〜P(m-1)として各々設定する(P(0)=0、P(1)=1)(図7のステップS5)。   Subsequently, the control unit 2A sets each cycle (1 to m!) Of each sequence (1 to m!) To PR (1,1) to PR (m!, M) for setting the number of each cycle in the cycle storage unit 10. ) Is set as 0 as the initial value (step S4 in FIG. 7), and is the first (PM = 2) series data of the bijection function stored in the permutation storage unit 5 and indicated by the permutation number setting unit 11. The permutation S (2,0) to S (2, m-1) values (S (2,0) = 0, S (2,1) = 1) in the period calculation unit 6 m (m = 2) Are respectively set as calculation data P (0) to P (m-1) (P (0) = 0, P (1) = 1) (step S5 in FIG. 7).

続いて、制御部2Aは、周期累計部9の値PSを0に設定した後(図7のステップS6)、最初の入力データに相当する先頭の位置(先頭のデータとして0)を入力指定部7の値INPに設定する(INP=0)(図7のステップS7)。次に、制御部2Aは、入力指定部7の値INPが示す、周期計算部6の周期の配列P(1)〜P(m)の位置の入力データ(データは0)に対応する出力データP(INP)(データは0)を出力記憶部8の値OUTPとして設定する(図7のステップS8)。   Subsequently, the control unit 2A sets the value PS of the period accumulating unit 9 to 0 (step S6 in FIG. 7), and then sets the head position corresponding to the first input data (0 as the head data) as the input designation unit. 7 is set to the value INP (INP = 0) (step S7 in FIG. 7). Next, the control unit 2A outputs the output data corresponding to the input data (data is 0) at the position of the period array P (1) to P (m) of the period calculation unit 6 indicated by the value INP of the input designation unit 7. P (INP) (data is 0) is set as the value OUTP of the output storage unit 8 (step S8 in FIG. 7).

続いて、制御部2Aは、出力記憶部8の出力データの値OUTPが既に系列に使用済みかどうかを判定する(図7のステップS9)。使用済みの場合は、使用済みのマークとして−1の値となっている。使用済みであれば図7のステップS10に進み、使用済みでなければ図8のステップS15に進む。この時点では、OUTPは0であり、−1(使用済み)ではないので、制御部2AはステップS15に進み、入力指定部7が示す値INP(ここでは0)の位置の周期計算部6の値P(INP)を、使用済みのマークとして−1に更新し、系列に使用済みであることを示す。   Subsequently, the control unit 2A determines whether or not the value OUTP of the output data in the output storage unit 8 has already been used for the series (step S9 in FIG. 7). When used, the value is -1 as a used mark. If it has been used, the process proceeds to step S10 in FIG. 7, and if it has not been used, the process proceeds to step S15 in FIG. At this time, since OUTP is 0 and not −1 (used), the control unit 2A proceeds to step S15, and the period calculation unit 6 at the position of the value INP (here, 0) indicated by the input designation unit 7 The value P (INP) is updated to -1 as a used mark to indicate that it has been used for the series.

続いて、制御部2Aは、出力記憶部8の出力データの値OUTP(ここでは0)を入力指定部7の値INPに設定する(図8のステップS16)。続いて、制御部2Aは、周期累計部9の値PSに1を加算して周期数を1に更新した後(図8のステップS17)、入力指定部7の値INP(ここでは0)が示す周期計算部6の位置の入力データに対応する出力データの値P(INP)(ここでは−1)を出力記憶部8の値OUTPに設定する(図8のステップS18)。   Subsequently, the control unit 2A sets the value OUTP (here, 0) of the output data in the output storage unit 8 to the value INP of the input designating unit 7 (step S16 in FIG. 8). Subsequently, the control unit 2A adds 1 to the value PS of the cycle accumulating unit 9 to update the number of cycles to 1 (step S17 in FIG. 8), and then the value INP (0 in this case) of the input designating unit 7 is changed. The value P (INP) (here, −1) of the output data corresponding to the input data at the position of the cycle calculation unit 6 shown is set to the value OUTP of the output storage unit 8 (step S18 in FIG. 8).

次に、制御部2Aは、出力記憶部8の値OUTPが、既に系列に使用済みであることを示す−1であるかどうかを判定し(図8のステップS19)、使用済み(ー1)であればステップS23に進み、使用済みでなければステップS20に進む。ここでは、使用済みであるので、ステップS23に進み、順列数設定部11の値PMが示す周期記憶部10のm個の値PR(PM,1)〜PR(PM,m)のうち、周期累計部9の値PSに相当する位置PR(PM,PS)の周期の値に1を加算し(ここでは、周期1の位置に1を加算するPR(2,1)=PR(2,1)+1)、周期数を更新した後、次の周期の計算のために図7のステップS6に進む。   Next, the control unit 2A determines whether or not the value OUTP of the output storage unit 8 is −1 indicating that the value has already been used for the series (step S19 in FIG. 8), and has been used (−1). If so, the process proceeds to step S23, and if not used, the process proceeds to step S20. Here, since it has been used, the process proceeds to step S23, and among the m values PR (PM, 1) to PR (PM, m) in the period storage unit 10 indicated by the value PM of the permutation number setting unit 11, the period 1 is added to the period value of the position PR (PM, PS) corresponding to the value PS of the accumulating unit 9 (here, PR (2,1) = PR (2,1 +1) After updating the number of periods, the process proceeds to step S6 in FIG. 7 for calculation of the next period.

ステップS6において、制御部2Aは、周期累計部9の値PSを0にクリアする。その後、制御部2Aは、最初の入力データに相当する先頭の位置(先頭のデータとして0)を入力指定部7の値INPに設定する(図7のステップS5)。続いて、制御部2Aは、入力指定部7の値INP(ここでは0)が示す周期計算部6の位置の入力データに対応する出力データの値P(INP)(ここでは−1)を出力記憶部8の値OUTPに設定する(図7のステップS8)。   In step S6, the control unit 2A clears the value PS of the period accumulating unit 9 to zero. Thereafter, the control unit 2A sets the head position corresponding to the first input data (0 as the head data) as the value INP of the input specifying unit 7 (step S5 in FIG. 7). Subsequently, the control unit 2A outputs the output data value P (INP) (here, -1) corresponding to the input data at the position of the period calculation unit 6 indicated by the value INP (here, 0) of the input designation unit 7. The value OUTP of the storage unit 8 is set (step S8 in FIG. 7).

次に、制御部2Aは、出力記憶部8の値OUTPが、既に系列に使用済みであることを示す−1であるかどうかを判定し(図7のステップS9)、使用済み(ー1)であれば図7のステップS10に進み、使用済みでなければ図8のステップS15に進む。この時点では、使用済みであるので、制御部2AはステップS10に進み、入力指定部7の値INPが系列の最後の位置を示す値(m-1)かどうかを判定する。この時点では、上記の値INPは0であり、最後の位置1(=m-1)ではないので、値INPを1に更新した後(図7のステップS11)、ステップS8に戻り、再び入力指定部7の値INP(ここでは1)が示す周期計算部6の位置の入力データに対応する出力データの値P(INP)(ここでは1)を出力記憶部8の値OUTPに設定する。   Next, the control unit 2A determines whether or not the value OUTP in the output storage unit 8 is −1 indicating that the value has already been used for the series (step S9 in FIG. 7), and has been used (−1). If so, the process proceeds to step S10 in FIG. 7, and if not used, the process proceeds to step S15 in FIG. Since it is already used at this point, the control unit 2A proceeds to step S10 and determines whether or not the value INP of the input designating unit 7 is a value (m-1) indicating the last position of the sequence. At this time, the value INP is 0 and not the last position 1 (= m−1). Therefore, after updating the value INP to 1 (step S11 in FIG. 7), the process returns to step S8 and is input again. The value P (INP) (here 1) of the output data corresponding to the input data at the position of the period calculation unit 6 indicated by the value INP (here 1) of the designation unit 7 is set as the value OUTP of the output storage unit 8.

続いて、制御部2Aは、ステップS9において、出力記憶部8の値OUTPが、既に系列に使用済みであるかどうかを判定する。ここでは、出力記憶部8の値OUTPは1であり、−1ではないので、制御部2Aは図8のステップS15に進み、出力記憶部8の値OUTPが示す位置(ここでは1)の周期計算部6のデータの値P(INP)を使用済みのマークとして−1に更新し、系列に使用済みであることを記す。続いて、制御部2Aは、出力記憶部8の値OUTP(ここでは1)を入力指定部7の値INPに設定した後(ステップS16)、周期累計部9の値PSに1を加算して周期数を更新する(ステップS17)。これにより、周期数は1となる。続いて、制御部2Aは、入力指定部7の値INP(ここでは1)が示す周期計算部6の位置の入力データに対応する出力データの値P(INP)(ここでは−1)を出力記憶部8の値OUTPに設定する(ステップS18)。   Subsequently, in step S9, the control unit 2A determines whether or not the value OUTP in the output storage unit 8 has already been used for the series. Here, since the value OUTP of the output storage unit 8 is 1 and not −1, the control unit 2A proceeds to step S15 in FIG. 8 and the cycle of the position (here, 1) indicated by the value OUTP of the output storage unit 8. The data value P (INP) of the calculation unit 6 is updated to -1 as a used mark to indicate that it has been used in the series. Subsequently, the control unit 2A sets the value OUTP (here, 1) in the output storage unit 8 to the value INP in the input designating unit 7 (step S16), and then adds 1 to the value PS in the period accumulating unit 9. The number of cycles is updated (step S17). As a result, the number of periods becomes 1. Subsequently, the control unit 2A outputs the output data value P (INP) (here, -1) corresponding to the input data at the position of the period calculation unit 6 indicated by the value INP (here, 1) of the input designation unit 7. The value OUTP of the storage unit 8 is set (step S18).

続いて、制御部2Aは、出力記憶部8の値OUTPが−1かどうかを判定する(ステップS19)。この時点では、上記のステップS18により上記の値OUTPは−1とされているので、制御部2AはステップS19において−1である(使用済みである)と判定し、続いてステップS23において順列数設定部11の値PMが示す周期記憶部10のm個の値PR(PM,1)〜PR(PM,m)のうち、周期累計部9の値PSに相当する位置PR(PM,PS)の周期の値に1を加算し(ここでは、周期1の位置に1を加算し周期1が2個となるPR(2,1)=PR(2,1)+1)、周期数を更新し図7のステップS6に進む。   Subsequently, the control unit 2A determines whether or not the value OUTP of the output storage unit 8 is −1 (step S19). At this time, since the value OUTP is set to −1 in step S18, the control unit 2A determines that it is −1 (used) in step S19, and then in step S23, the number of permutations. Of the m values PR (PM, 1) to PR (PM, m) of the period storage unit 10 indicated by the value PM of the setting unit 11, a position PR (PM, PS) corresponding to the value PS of the period accumulating unit 9 1 is added to the value of the period (here, PR (2,1) = PR (2,1) +1) in which 1 is added to the position of period 1 and the period 1 becomes two, and the number of periods is updated. Then, the process proceeds to step S6 in FIG.

続いて、制御部2Aは、ステップS6で周期累計部9の値PSを0にクリアし、ステップS7で先頭の位置(先頭のデータとして0)を入力指定部7の値INPに設定し、ステップS8で入力指定部7の値INPが示す、周期計算部6の位置の入力データに対応する出力データP(INP)(ここでは−1)を出力記憶部8の値OUTPとして設定する。   Subsequently, the control unit 2A clears the value PS of the period accumulating unit 9 to 0 in step S6, sets the leading position (0 as the leading data) to the value INP of the input designation unit 7 in step S7, In S8, the output data P (INP) (here, −1) corresponding to the input data at the position of the period calculation unit 6 indicated by the value INP of the input designating unit 7 is set as the value OUTP of the output storage unit 8.

続いて、制御部2Aは、ステップS9において、出力記憶部8の値OUTPは−1であるかどうかを判定する。この時点では、値OUTPは−1であるので、制御部2AはステップS9において−1である(使用済みである)と判定し、次にステップS10に進んで入力指定部7の値INPが系列の最終の位置を示す値1(=m-1)であるかどうかを判定する。この時点では、入力指定部7の値INPは先頭の位置0であり、最後の位置1ではないので、制御部2Aは次にステップS11に進んで入力指定部7の値INPに1を加算して次の位置としステップS8に進む。これにより、上記の値INPは1となる。   Subsequently, in step S9, the control unit 2A determines whether or not the value OUTP of the output storage unit 8 is -1. At this time, since the value OUTP is −1, the control unit 2A determines that it is −1 (used) in step S9, and then proceeds to step S10 where the value INP of the input designating unit 7 is a series. It is determined whether or not the value is 1 (= m−1) indicating the final position. At this time, since the value INP of the input designation unit 7 is the first position 0 and not the last position 1, the control unit 2A proceeds to step S11 and adds 1 to the value INP of the input designation unit 7. Then, the process proceeds to step S8. As a result, the value INP becomes 1.

続いて、制御部2Aは、ステップS8において入力指定部7の値INPが示す、周期計算部6の位置の入力データに対応する出力データP(INP)(ここでは−1)を出力記憶部8の値OUTPとして設定した後、ステップS9において、出力記憶部8の値OUTPは−1であるかどうかを判定する。この時点では、値OUTPは−1であるので、制御部2AはステップS9において−1である(使用済みである)と判定し、次にステップS10に進んで入力指定部7の値INPが系列の最後の位置を示す値1(=m-1)であるかどうかを判定する。   Subsequently, the control unit 2A outputs output data P (INP) (here, -1) corresponding to the input data at the position of the period calculation unit 6 indicated by the value INP of the input designation unit 7 in step S8. In step S9, it is determined whether the value OUTP of the output storage unit 8 is -1. At this time, since the value OUTP is −1, the control unit 2A determines that it is −1 (used) in step S9, and then proceeds to step S10 where the value INP of the input designating unit 7 is a series. It is determined whether or not the value is 1 (= m−1) indicating the last position.

この時点では、入力指定部7の値INPは1であり、系列の最後の位置を示す値1と等しいので一つの関数に存在する全ての周期が求められたこととなり、制御部2Aは次にステップS12に進んで順列数設定部11の値PMが最後の関数に相当する値1であるかどうかを判定する。この時点では、順列数設定部11の値PMはステップS2で設定された2(=m!)であり、1ではないので、制御部2Aは順列数設定部11の値PMを1減算して1とした後(図7のステップS13)、ステップS5に戻り、再び順列数設定部11の値PMの示す順列記憶部5に記憶されている全単射関数の全ての系列データである順列S(PM,0)〜S(PM,m-1)に設定されたm個のデータ(ここでは、PM=1であるので、前述したように2番目の関数の2個のデータS(1,0)=1,S(1,1)=0)を、周期計算部6の周期の計算用データP(0)〜P(m-1)、すなわちP(0)=1、P(1)=0として各々設定する。   At this time, the value INP of the input designating unit 7 is 1, which is equal to the value 1 indicating the last position of the sequence, so all the periods existing in one function have been obtained. It progresses to step S12 and it is determined whether the value PM of the permutation number setting part 11 is the value 1 corresponding to the last function. At this time, the value PM of the permutation number setting unit 11 is 2 (= m!) Set in step S2 and not 1. Therefore, the control unit 2A subtracts 1 from the value PM of the permutation number setting unit 11. After setting to 1 (step S13 in FIG. 7), the process returns to step S5, and the permutation S which is all series data of the bijection function stored in the permutation storage unit 5 indicated by the value PM of the permutation number setting unit 11 again. M data set in (PM, 0) to S (PM, m-1) (here, PM = 1, so as described above, the two data S (1, 0) = 1, S (1,1) = 0), the calculation data P (0) to P (m-1) for the period of the period calculation unit 6, that is, P (0) = 1, P (1) Set each as = 0.

制御部2Aは続いてステップS6で周期累計部9の値PSを0にクリアし、ステップS7で先頭の位置(先頭のデータとして0)を入力指定部7の値INPに設定した後、ステップS8へ進み、ここで入力指定部7の値INPが示す周期計算部6の位置の入力データに対応する出力データP(INP)(ここでは1)を出力記憶部8の値OUTPに設定する。続いて、制御部2AはステップS9に進んで値OUTPが−1(使用済み)ではないと判定した後、図8のステップS15へ進んで入力指定部7が示す値INPの位置の周期計算部6の値P(INP)を、使用済みのマークとして−1に更新し、系列に使用済みであることを示す。   Subsequently, the control unit 2A clears the value PS of the period accumulating unit 9 to 0 in step S6, sets the head position (0 as the head data) to the value INP of the input designation unit 7 in step S7, and then performs step S8. Here, the output data P (INP) (here 1) corresponding to the input data at the position of the period calculation unit 6 indicated by the value INP of the input designation unit 7 is set to the value OUTP of the output storage unit 8. Subsequently, the control unit 2A proceeds to step S9 to determine that the value OUTP is not −1 (used), and then proceeds to step S15 in FIG. 8 to calculate the cycle of the position of the value INP indicated by the input designation unit 7 The value P (INP) of 6 is updated to -1 as a used mark to indicate that it has been used for the series.

続いて、制御部2Aは、ステップS16で出力記憶部8の出力データの値OUTP(ここでは1)を入力指定部7の値INPに設定し、次のステップS17で周期累計部9の値PSに1を加算して周期数を1に更新し(周期数は1となる)、次のステップS18で入力指定部7の値INP(ここでは1)が示す、周期計算部6の位置の入力データに対応する出力データP(INP)(ここでは0)を出力記憶部8の値OUTPに設定する。   Subsequently, the control unit 2A sets the value OUTP (here, 1) of the output data in the output storage unit 8 to the value INP of the input designating unit 7 in step S16, and the value PS of the period accumulating unit 9 in the next step S17. 1 is added to update the number of periods to 1 (the number of periods becomes 1), and the position input of the period calculation unit 6 indicated by the value INP (here, 1) of the input designation unit 7 in the next step S18. The output data P (INP) (here, 0) corresponding to the data is set to the value OUTP of the output storage unit 8.

次に、制御部2Aは、出力記憶部8の値OUTPが、既に系列に使用済みであることを示す−1であるかどうかを判定し、使用済み(ー1)であればステップS23に進み、使用済みでなければステップS20に進む。ここでは、OUTPは0であり−1ではない(使用済みでない)ので、ステップS20に進み、入力指定部7の値INP(ここでは1)が示す位置の周期計算部6の出力データの値P(INP)である0を入力指定部7の値INPに設定する。   Next, the control unit 2A determines whether or not the value OUTP of the output storage unit 8 is −1 indicating that the value has already been used for the series, and if it is used (−1), the process proceeds to step S23. If not used, the process proceeds to step S20. Here, since OUTP is 0 and not −1 (not used), the process proceeds to step S20, and the value P of the output data of the period calculation unit 6 at the position indicated by the value INP (here, 1) of the input designation unit 7 is reached. Set 0 which is (INP) to the value INP of the input designation unit 7.

続いて、制御部2Aは、入力指定部7の値INP(ここでは0)が示す位置の周期計算部6の出力データの値P(0)を、−1に更新して系列に使用済みであることを記した後(図8のステップS21)、周期累計部9の値PSを1加算し周期数を更新し、ステップS18に進む。これにより、周期の値PSは2となる。   Subsequently, the control unit 2A updates the output data value P (0) of the cycle calculation unit 6 at the position indicated by the value INP (here, 0) of the input designating unit 7 to −1 and has already been used for the series. After a certain fact (step S21 in FIG. 8), the value PS of the cycle accumulating unit 9 is incremented by 1 to update the cycle number, and the process proceeds to step S18. As a result, the period value PS becomes 2.

ステップS18では入力指定部7の値INPが示す、周期計算部6の位置P(INP)の入力データに対応する出力データの値(INP=0でP(INP)は−1)を出力記憶部8の値OUTPに設定する。続いて、制御部2Aは、ステップS19において出力記憶部8の値OUTPが−1であるかどうかを判定する。ここでは、出力記憶部8の値OUTPが−1であるので、ステップS23に進み、順列数設定部11の値PMが示す周期記憶部10のm個の周期の値PR(PM,1)〜PR(PM,m)のうち、周期累計部9の値PSに相当する値PR(PM,PS)に1を加算し(ここでは、周期2の位置に1を加算しPR(1,2)=1となり、周期2が1個となる)、周期数を更新した後、図7のステップS5に進む。   In step S18, the value of the output data (INP = 0 and P (INP) is -1) corresponding to the input data at the position P (INP) of the period calculation unit 6 indicated by the value INP of the input designating unit 7 is an output storage unit. Set the value 8 to OUTP. Subsequently, the control unit 2A determines whether or not the value OUTP of the output storage unit 8 is −1 in step S19. Here, since the value OUTP of the output storage unit 8 is −1, the process proceeds to step S23, and the m period values PR (PM, 1) ˜ of the period storage unit 10 indicated by the value PM of the permutation number setting unit 11. Of PR (PM, m), 1 is added to the value PR (PM, PS) corresponding to the value PS of the period accumulating unit 9 (here, 1 is added to the position of period 2 and PR (1,2) After the number of periods is updated, the process proceeds to step S5 in FIG.

続いて、制御部2Aは、再び前述したステップS6、S7を経てステップS8へ進み、ここで入力指定部7の値INPが示す周期計算部6の値P(INP)の位置の入力データ(ここでは0)に対応する出力データ(ここでは−1)を出力記憶部8の値OUTPに設定する。続いて、制御部2AはステップS9に進んで出力記憶部8の値OUTPが−1であり、使用済みであると判定した後、ステップS10に進んで入力指定部7の値INPが0であり、系列の最終の位置1(=m−1)ではないと判定するので、ステップS11に進んで入力指定部7の値INPを1加算してINPを1とする。   Subsequently, the control unit 2A proceeds again to the step S8 through the above-described steps S6 and S7, where the input data of the position of the value P (INP) of the period calculation unit 6 indicated by the value INP of the input specifying unit 7 (here In this case, the output data corresponding to 0) (here, -1) is set to the value OUTP of the output storage unit 8. Subsequently, the control unit 2A proceeds to step S9, determines that the value OUTP of the output storage unit 8 is −1 and has been used, then proceeds to step S10, and the value INP of the input designating unit 7 is 0. Therefore, since it is determined that the position is not the final position 1 (= m−1) in the series, the process proceeds to step S11, and the value INP of the input designating unit 7 is incremented by 1 to set INP to 1.

続いて、制御部2Aは、ステップS8において入力指定部7の値INP(ここでは1)が示す周期計算部6の値P(INP)の位置の入力データ(ここでは1)に対応する出力データ(ここでは−1)を出力記憶部8の値OUTPに設定した後、ステップS9に進んで出力記憶部8の値OUTPが−1であり、使用済みであると判定した後、ステップS10に進んで入力指定部7の値INPが1であり、系列の最後の位置1(=m−1)であると判定する。   Subsequently, the control unit 2A outputs the output data corresponding to the input data (here 1) of the position of the value P (INP) of the period calculation unit 6 indicated by the value INP (here 1) of the input designation unit 7 in step S8. After setting (here, -1) to the value OUTP of the output storage unit 8, the process proceeds to step S9, where the value OUTP of the output storage unit 8 is -1 and determined to be used, and then the process proceeds to step S10. Thus, it is determined that the value INP of the input designating unit 7 is 1, and that it is the last position 1 (= m−1) in the series.

これにより、制御部2Aは、順列数設定部11が示す値PMがデータの最後の位置の1かどうかを判定する(図8のステップS12)。この時点では、前述したステップS13の処理によりPMは1となっているので、ステップS12でPMが1であると判定され、全ての系列の処理が行われたと判断して処理を終了する(図8のステップS14)。全ての処理を終了した場合には、周期記憶部10には、この全単射関数の各々の系列の各周期長の全ての存在数が求まっている。ここでは、m=2であり、周期記憶部10には、周期1が2個、周期2が1個を示す値が記憶されている。   Thus, the control unit 2A determines whether the value PM indicated by the permutation number setting unit 11 is 1 at the last position of the data (step S12 in FIG. 8). At this point, since PM is 1 by the process in step S13 described above, it is determined in step S12 that PM is 1, and it is determined that all series of processes have been performed, and the process ends (FIG. 8 step S14). When all the processes are completed, the number of all the existences of each period length of each series of the bijection function is obtained in the period storage unit 10. Here, m = 2, and the cycle storage unit 10 stores a value indicating that two cycles 1 and one cycle 2 are stored.

このように、本実施形態によれば、図10に示すような関数の帰還により周期を求めることができる。図10において、m!個の全単射関数の作成した順列データのそれぞれについて、各全単射関数の0からm−1までのm個の入力データのうちの最小のものである0の値を最初の入力データとし、その出力データを更に入力データとして帰還し、入力データが最初の入力データである0に戻るまでの帰還回数を求めて系列周期とする。このとき出現した出力データには出現済みと判断できるように−1等の出力データに存在しない値を周期計算部6に設定することで、未出現の出力データと区別する。   Thus, according to the present embodiment, the period can be obtained by the feedback of the function as shown in FIG. In FIG. 10, m! For each permutation data created by each of the bijection functions, the first input data is a value of 0 which is the smallest of m input data from 0 to m−1 of each bijection function. The output data is further fed back as input data, and the number of feedbacks until the input data returns to 0, which is the first input data, is obtained as a sequence period. A value that does not exist in the output data, such as −1, is set in the period calculation unit 6 so that it can be determined that the output data that has appeared at this time has appeared.

もし、m個の全てのデータが系列に出現した場合には最大周期となり、完全擬似乱数の系列が作成されたことになる。しかし、未出現の出力データが残存する場合には、周期は部分的な系列のものであり、未出現の残りのデータに更に部分的な別の周期が存在することになる。未出現の出力データが残存する場合には、更に未出現の出力データのうちの入力データの最小のものを新たな周期の最初の入力データとし、その入力データに戻るまでの新たな系列周期を求め、全ての出力データが系列に出現し尽すまでこの手順を繰り返す。そして、m!個の全ての順列データ(関数)について、この手順でそれぞれの周期数とその各周期の存在数を求める。   If all m data appear in the sequence, the maximum period is reached, and a complete pseudo-random sequence is created. However, when output data that does not appear remains, the period is of a partial series, and another partial period exists in the remaining data that does not appear. If unappeared output data remains, the smallest input data among the non-appearing output data is set as the first input data of a new period, and a new sequence period until the input data is returned to This procedure is repeated until all output data appears in the series. And m! With respect to all permutation data (functions), the number of periods and the number of existence of each period are obtained by this procedure.

このようにして、本実施形態によれば、全ての全単射関数の全ての整数系列の全周期を判定することができる。そして、任意の周期の全単射関数を用いた擬似乱数系列や変換表などを作成することができる。   In this way, according to the present embodiment, it is possible to determine the entire period of all integer series of all bijective functions. Then, it is possible to create a pseudo-random number sequence or conversion table using a bijection function with an arbitrary period.

(第2の実施形態)
図11は、本発明になる整数系列の周期判定装置の第2の実施形態のブロック図を示す。同図に示すように、本実施形態の整数系列の周期判定装置1Bは、装置1B全体を統括的に制御する制御部2B、データ数記憶部3、順列作成部4、順列記憶部5、周期計算部6、入力指定部7、出力記憶部8、周期累計部9、周期記憶部10から構成されており、第1の実施形態の整数系列の周期判定装置1Aと比較すると、順列数設定部11と検索位置指定部12を有しない。
(Second Embodiment)
FIG. 11 shows a block diagram of a second embodiment of the integer sequence period determining apparatus according to the present invention. As shown in the figure, the integer sequence period determination device 1B of the present embodiment includes a control unit 2B that centrally controls the entire apparatus 1B, a data number storage unit 3, a permutation creation unit 4, a permutation storage unit 5, and a cycle. The calculation unit 6, the input designation unit 7, the output storage unit 8, the cycle accumulation unit 9, and the cycle storage unit 10, and when compared with the integer series cycle determination device 1 A of the first embodiment, a permutation number setting unit 11 and the search position designation unit 12 are not provided.

制御部2B、順列作成部4及び周期計算部6は、例えば中央処理装置(CPU)により構成される。また、データ数記憶部3、出力記憶部8、周期累計部9及び周期記憶部10は記憶装置により構成され、入力指定部7は所定の入力装置により構成される。   The control unit 2B, the permutation creation unit 4, and the cycle calculation unit 6 are configured by, for example, a central processing unit (CPU). Further, the data number storage unit 3, the output storage unit 8, the cycle accumulation unit 9, and the cycle storage unit 10 are configured by a storage device, and the input designation unit 7 is configured by a predetermined input device.

データ数記憶部3は、単射で、かつ、全射でもある関数である全単射関数の有する連続した自然数の入出力データ(原像及び像)の数Mを記憶する。順列作成部4は、周期を判定するために予め事前に用意されたデータである、全単射関数の入力に対する出力データ(原像に対する像)の並びである順列A(i)を設定する。この場合、順列A(i)は、出力データの値に重複せず、全ての値が出現するように作成されたものとする。順列記憶部5は、任意のデータ数mの全単射関数の入力に対する出力データ(原像に対する像)の並びである順列S(j)を予め記憶している第1の記憶部である。周期計算部6は、後述するように任意の全単射関数の入力に対する出力データ(原像に対する像)を更に入力とする手順を繰り返し行って、判定する整数系列の周期Pを計算する。   The data number storage unit 3 stores the number M of continuous natural number input / output data (original image and image) possessed by a bijection function that is a bijection and a bijection function. The permutation creating unit 4 sets a permutation A (i), which is data prepared in advance for determining the period, and is an array of output data (images relative to the original image) with respect to the input of the bijective function. In this case, it is assumed that the permutation A (i) is created so that all values appear without overlapping the values of the output data. The permutation storage unit 5 is a first storage unit that stores in advance a permutation S (j) that is an array of output data (images with respect to the original image) with respect to the input of a bijection function having an arbitrary number of data m. As will be described later, the period calculation unit 6 repeatedly performs a procedure in which output data (an image with respect to the original image) with respect to an input of an arbitrary bijection function is further input, and calculates the period P of the integer series to be determined.

入力指定部7は、入力位置(原像の位置)INPを指定する。出力記憶部8は、入力指定部7で指定された入力位置の周期計算部6の出力データ(像)の値OUTPを記憶する。周期累計部9は、周期計算部6で計算した周期Pの累積結果PSを記憶する。周期記憶部10は、周期計算部6の周期計算結果PR(PM,M)を記憶する第2の記憶部である。本実施形態では、周期記憶部10は、任意のデータ数m(ここでは、m=3とする)の全単射関数の部分周期を含めた全ての周期について存在数を記憶する。   The input designation unit 7 designates an input position (original image position) INP. The output storage unit 8 stores the value OUTP of the output data (image) of the cycle calculation unit 6 at the input position specified by the input specification unit 7. The period accumulating unit 9 stores the accumulated result PS of the period P calculated by the period calculating unit 6. The cycle storage unit 10 is a second storage unit that stores the cycle calculation result PR (PM, M) of the cycle calculation unit 6. In the present embodiment, the cycle storage unit 10 stores the existence numbers for all cycles including a partial cycle of a bijection function having an arbitrary number of data m (here, m = 3).

上記の構成のうち、制御部2B、データ数記憶部3、順列作成部4、周期計算部6、入力指定部7、及び周期累計部9は、m!個の全単射関数のうち、所望の1個の全単射関数のm個の整数からなる整数系列の入力に対する出力の状態を順列として生成して第1の記憶部である順列記憶部5に記憶する順列記憶手段を構成する。また、制御部2B、周期計算部6、入力指定部7、出力記憶部8及び周期累計部9は、順列記憶部5に記憶された順列の周期を計算して第2の記憶部である周期記憶部10に記憶する周期計算及び累計手段を構成する。   Among the above configurations, the control unit 2B, the data number storage unit 3, the permutation creation unit 4, the cycle calculation unit 6, the input designation unit 7, and the cycle accumulation unit 9 are m! Among the bijective functions, a permutation storage unit 5 which is a first storage unit by generating an output state for an input of an integer sequence consisting of m integers of a desired bijective function as a permutation. The permutation storage means for storing the information is configured. In addition, the control unit 2B, the cycle calculation unit 6, the input designation unit 7, the output storage unit 8, and the cycle accumulation unit 9 calculate the cycle of the permutation stored in the permutation storage unit 5 and serve as the second storage unit. The period calculation and accumulation means stored in the storage unit 10 is configured.

次に、本実施形態の動作について、図12及び図13のフローチャートを併せ参照して説明する。   Next, the operation of this embodiment will be described with reference to the flowcharts of FIGS.

図11において、制御部2Bは、まず、データ数記憶部3にデータ数m(ここでは、m=3)を設定する(図12のステップS31)。続いて、制御部2Bは、周期記憶部10に記憶されている周期PR(0)〜PR(m-1)の各値を0に設定した後(図12のステップS32)、順列作成部4に全単射関数の入出力データとして、入力データ(0からm−1までの自然数)に対応する出力系列データA(0)〜A(m-1)を設定する(図12のステップS33)。具体的には、この出力系列データA(0)〜A(m-1)は、0からm−1までの重複しない自然数の任意の組み合わせのデータで、ここではm=3であるので、例えば、A(0)=2,A(1)=0,A(2)=1の3個のデータである。   In FIG. 11, the control unit 2B first sets the data number m (here, m = 3) in the data number storage unit 3 (step S31 in FIG. 12). Subsequently, the control unit 2B sets each value of the periods PR (0) to PR (m-1) stored in the period storage unit 10 to 0 (step S32 in FIG. 12), and then the permutation creation unit 4 Are set as output series data A (0) to A (m-1) corresponding to input data (natural numbers from 0 to m-1) as input / output data of the bijection function (step S33 in FIG. 12). . Specifically, the output series data A (0) to A (m-1) is data of arbitrary combinations of non-overlapping natural numbers from 0 to m-1, and here m = 3. , A (0) = 2, A (1) = 0, A (2) = 1.

続いて、制御部2Bは、順列作成部4に設定した上記の3個の出力系列データA(0)〜A(2)を順列記憶部5の順列S(0)〜S(m-1)にそれぞれ格納する(図12のステップS34)。ここでは、上記の順列記憶部5には、S(0)=2,S(1)=0,S(2)=1の3個の順列が格納されることになる。   Subsequently, the control unit 2B converts the three output series data A (0) to A (2) set in the permutation creation unit 4 into the permutations S (0) to S (m-1) in the permutation storage unit 5. (Step S34 in FIG. 12). Here, the above-described permutation storage unit 5 stores three permutations of S (0) = 2, S (1) = 0, and S (2) = 1.

続いて、制御部2Bは、順列記憶部5に格納された順列S(0)〜S(m-1)を、周期計算部6に計算用のデータP(0)〜P(m-1)としてそれぞれ関数の出力データを設定する(図12のステップS35)。ここでは、上記の周期計算部6には、P(0)=2,P(1)=0,P(2)=1の3個が設定されることになる。   Subsequently, the control unit 2B sends the permutations S (0) to S (m-1) stored in the permutation storage unit 5 to the cycle calculation unit 6 for calculation data P (0) to P (m-1). As shown in FIG. 12, the function output data is set (step S35 in FIG. 12). Here, three values of P (0) = 2, P (1) = 0, and P (2) = 1 are set in the period calculation unit 6 described above.

続いて、制御部2Bは、周期累計部6の周期の値PSを0に設定(クリア)した後(図12のステップS36)、最初の入力データに相当する先頭のデータの位置(例えば0)を入力指定部7の値INPとして設定する(図12のステップS37)。次に、制御部2Bは、入力指定部7の値INPが示す周期計算部6の入力データに対応する出力データの値P(INP)を出力記憶部8の値OUTPに設定する(図12のステップS38)。ここでは、INPは0であるので、入力データはP(0)であり、それに対応する出力データは前述したように2であるから、OUTPは2に設定される。   Subsequently, the control unit 2B sets (clears) the cycle value PS of the cycle accumulating unit 6 to 0 (step S36 in FIG. 12), and then the position of the leading data corresponding to the first input data (for example, 0). Is set as the value INP of the input designation unit 7 (step S37 in FIG. 12). Next, the control unit 2B sets the value P (INP) of the output data corresponding to the input data of the cycle calculation unit 6 indicated by the value INP of the input designating unit 7 as the value OUTP of the output storage unit 8 (FIG. 12). Step S38). Here, since INP is 0, the input data is P (0), and the output data corresponding to it is 2 as described above, so OUTP is set to 2.

続いて、制御部2Bは、出力記憶部8の値OUTPが既に系列に使用済みかどうかを比較する(図12のステップS39)。使用済みなら使用済みのマークとして−1の値となっている。ここでは、OUTPは2であり、−1ではないので、制御部2Bは使用済みでないと判定し、図13のステップS43に進んで、入力指定部7の値INPが示す周期計算部6の入力データに対応する出力データの値P(INP)を−1に設定し、系列に使用済みであることを示す。これにより、P(0)=−1となる。   Subsequently, the control unit 2B compares whether or not the value OUTP in the output storage unit 8 has already been used for the series (step S39 in FIG. 12). If it is used, it is -1 as a used mark. Here, since OUTP is 2 and not −1, the control unit 2B determines that it has not been used, and proceeds to step S43 of FIG. 13 to input the period calculation unit 6 indicated by the value INP of the input designation unit 7 The value P (INP) of the output data corresponding to the data is set to -1, indicating that it has been used for the series. As a result, P (0) = − 1.

次に、制御部2Bは、出力記憶部8の値OUTP(ここでは2)を入力指定部7の値INPに設定する(図13のステップS44)。続いて、制御部2Bは、周期累計部9の値PSに1を加算し周期数を更新する(図13のステップS45)。これにより、周期数PSは1となる。続いて、制御部2Bは、入力指定部7の値INP(ここでは2)が示す、周期計算部6の入力データに対応する出力データの値P(INP)を出力記憶部8の値OUTPに設定する(図13のステップS46)。ここでは、INPは2であるから、P(2)に対応する出力データは前述したように1であるから、OUTPは1に設定される。   Next, the control unit 2B sets the value OUTP (here, 2) in the output storage unit 8 to the value INP in the input designating unit 7 (step S44 in FIG. 13). Subsequently, the control unit 2B adds 1 to the value PS of the cycle accumulating unit 9 to update the number of cycles (step S45 in FIG. 13). As a result, the cycle number PS becomes 1. Subsequently, the control unit 2B sets the value P (INP) of the output data corresponding to the input data of the period calculation unit 6 indicated by the value INP (here, 2) of the input designating unit 7 as the value OUTP of the output storage unit 8. Setting is made (step S46 in FIG. 13). Here, since INP is 2, the output data corresponding to P (2) is 1, as described above, so OUTP is set to 1.

次に、制御部2Bは、出力記憶部8の値OUTPが使用済みであることを示す−1であるかどうかを判定する(図13のステップS47)。ここでは、上記のようにOUTPは1であり、−1ではないので、制御部2Bは、入力指定部7の値INP(ここでは2)が示す、周期計算部6の位置の入力データの値P(INP)に対応する出力データ(ここでは1)を入力指定部7の値INPに設定する(図13のステップS48)。続いて、制御部2Bは、入力指定部7の値INP(ここでは1)が示す、周期計算部6の入力データに対応する出力データの値P(INP)を−1に設定し、系列に使用済みであることを示す(図13のステップS49)。これにより、P(1)=−1となる。   Next, the control unit 2B determines whether or not the value OUTP in the output storage unit 8 is −1 indicating that it has been used (step S47 in FIG. 13). Here, since OUTP is 1 and not −1 as described above, the control unit 2B determines the value of the input data at the position of the period calculation unit 6 indicated by the value INP (here, 2) of the input designation unit 7. Output data (here, 1) corresponding to P (INP) is set to the value INP of the input designating unit 7 (step S48 in FIG. 13). Subsequently, the control unit 2B sets the value P (INP) of the output data corresponding to the input data of the period calculation unit 6 indicated by the value INP (here, 1) of the input designating unit 7 to -1, and It shows that it has been used (step S49 in FIG. 13). As a result, P (1) = − 1.

次に、制御部2Bは、周期累計部9の周期の値PSに1を加算して2とし、周期数を更新した後(図13のステップS50)、ステップS46に戻り、入力指定部7の値INP(ここでは1)が示す、周期計算部6の位置の入力データに対応する出力データの値P(INP)を出力記憶部8の値OUTPに設定する。ここでは、INPは1であるから、P(1)に対応する出力データは−1であるから、OUTPは−1に設定される。   Next, the control unit 2B adds 1 to the cycle value PS of the cycle accumulating unit 9 to 2 and updates the number of cycles (step S50 in FIG. 13), and then returns to step S46. The value P (INP) of the output data corresponding to the input data at the position of the period calculation unit 6 indicated by the value INP (here 1) is set as the value OUTP of the output storage unit 8. Here, since INP is 1, the output data corresponding to P (1) is -1, so OUTP is set to -1.

次に、制御部2Bは、出力記憶部8の値OUTPが使用済みであることを示す−1であるかどうかを判定する(図13のステップS47)。ここでは、上記のようにOUTPは−1であるから、制御部2Bは使用済みと判断し、周期累計部9の示す値PS(ここでは2)に相当する、周期記憶部10の位置の周期の値PR(PS)に1を加算して、周期数を更新した後(図13のステップS51)、図12のステップS36に進む。これにより、PR(2)は1になる。つまり、周期2の周期数が1個と判定される。   Next, the control unit 2B determines whether or not the value OUTP in the output storage unit 8 is −1 indicating that it has been used (step S47 in FIG. 13). Here, since OUTP is −1 as described above, the control unit 2B determines that it has been used, and the cycle of the position of the cycle storage unit 10 corresponding to the value PS (2 here) indicated by the cycle accumulation unit 9 After adding 1 to the value PR (PS) and updating the number of periods (step S51 in FIG. 13), the process proceeds to step S36 in FIG. As a result, PR (2) becomes 1. That is, the number of periods of period 2 is determined to be one.

続いて、制御部2BはステップS36において、周期累計部6の値PSを0に設定(クリア)した後、最初の入力データに相当する先頭の位置(例えば0)を入力指定部7の値INPとして設定し(ステップS37)、更に、入力指定部7の値INPが示す周期計算部6の位置の入力データに対応する出力データP(INP)を出力記憶部8の値OUTPに設定する(ステップS38)。ここでは、INPは0であるので、入力データはP(0)であり、それに対応する出力データは前述したように−1であるから、OUTPは−1に設定される。   Subsequently, in step S36, the control unit 2B sets (clears) the value PS of the period accumulating unit 6 to 0, and then sets the leading position (for example, 0) corresponding to the first input data to the value INP of the input designating unit 7. (Step S37), and further, the output data P (INP) corresponding to the input data at the position of the cycle calculation unit 6 indicated by the value INP of the input designation unit 7 is set as the value OUTP of the output storage unit 8 (step S37). S38). Here, since INP is 0, the input data is P (0), and the output data corresponding to it is −1 as described above, so OUTP is set to −1.

続いて、制御部2Bは、ステップS39において、出力記憶部8の値OUTPが−1であり、既に系列に使用済みであると判定してステップS40に進む。ステップS40では、制御部2Bは、入力指定部7の値INPが系列の最後の位置(m-1)を示す2であるかどうかを判定する。ここでは、INPは0であり2ではないので、制御部2Bは入力指定部7の値INPを1加算して1とした後(図12のステップS42)、ステップS38に進み入力指定部7の値INPが示す周期計算部6の位置の入力データに対応する出力データP(INP)を出力記憶部8の値OUTPに設定する。ここでは、INPは1であるので、入力データはP(1)であり、それに対応する出力データは前述したように1であるので、OUTPは1に設定される。   Subsequently, in step S39, the control unit 2B determines that the value OUTP of the output storage unit 8 is −1 and has already been used for the series, and proceeds to step S40. In step S40, the control unit 2B determines whether or not the value INP of the input specifying unit 7 is 2 indicating the last position (m-1) in the sequence. Here, since INP is 0 and not 2, the control unit 2B adds 1 to the value INP of the input designating unit 7 to 1 (step S42 in FIG. 12), and then proceeds to step S38 and proceeds to step S38. The output data P (INP) corresponding to the input data at the position of the period calculation unit 6 indicated by the value INP is set as the value OUTP of the output storage unit 8. Here, since INP is 1, the input data is P (1), and the output data corresponding to it is 1 as described above, so OUTP is set to 1.

続いて、制御部2Bは出力記憶部8の値OUTPが使用済みであることを示す−1であるかどうか判定する(ステップS39)。ここでは、OUTPは1であり、−1ではないので、制御部2Bは使用済みでないと判定し、図13のステップS43に進んで、入力指定部7の値INPが示す周期計算部6の位置の入力データの値に対応する出力データP(INP)を−1に設定し、系列に使用済みであることを示す。これにより、P(1)=−1となる。   Subsequently, the control unit 2B determines whether or not the value OUTP in the output storage unit 8 is −1 indicating that it has been used (step S39). Here, since OUTP is 1 and not −1, the control unit 2B determines that it has not been used, and proceeds to step S43 in FIG. 13 to indicate the position of the period calculation unit 6 indicated by the value INP of the input designation unit 7 The output data P (INP) corresponding to the input data value is set to -1 to indicate that it has been used for the series. As a result, P (1) = − 1.

以後、制御部2Bは、前述したステップS44、S45、S46の各処理を行った後、ステップS47で出力記憶部8の値OUTPが使用済みであることを示す−1であると判定し、ステップS51に進んで周期累計部9の示す値PS(ここでは1)に相当する、周期記憶部10の位置の周期の値PR(PS)に1を加算して、周期数を更新する。これにより、PR(1)は1になる。つまり、周期1の周期数が1と判定される。   Thereafter, the control unit 2B determines that the value OUTP of the output storage unit 8 is −1 indicating that it has been used in step S47 after performing the above-described processing of steps S44, S45, and S46. Proceeding to S51, 1 is added to the period value PR (PS) of the position of the period storage unit 10 corresponding to the value PS (1 in this case) indicated by the period accumulating unit 9 to update the number of periods. As a result, PR (1) becomes 1. That is, it is determined that the number of periods 1 is 1.

その後、制御部2Bは、前述したステップS36、S37、S38の各処理を行った後、ステップS39で出力記憶部8の値OUTPが使用済みであることを示す−1であると判定し、ステップS40に進んで入力指定部7の値INPが系列の最後の位置(m-1)を示す2であるかどうかを判定する。ここでは、INPは0であり2ではないので、制御部2Bは入力指定部7の値INPを1加算して1とした後(ステップS42)、ステップS38に進み入力指定部7の値INPが示す周期計算部6の位置の入力データP(INP)に対応する出力データを出力記憶部8の値OUTPに設定する。ここでは、INPは1であるので、入力データはP(1)であり、それに対応する出力データは前述したように−1であるので、OUTPは−1に設定される。   Thereafter, the control unit 2B determines that the value OUTP of the output storage unit 8 is −1 indicating that the value has been used in step S39 after performing the above-described processes of steps S36, S37, and S38. Proceeding to S40, it is determined whether or not the value INP of the input specifying unit 7 is 2 indicating the last position (m-1) of the sequence. Here, since INP is 0 and not 2, the control unit 2B adds 1 to the value INP of the input specifying unit 7 to 1 (step S42), and then proceeds to step S38, where the value INP of the input specifying unit 7 is The output data corresponding to the input data P (INP) at the position of the cycle calculation unit 6 shown is set to the value OUTP of the output storage unit 8. Here, since INP is 1, the input data is P (1), and the output data corresponding to it is −1 as described above, so OUTP is set to −1.

続いて、制御部2Bは、ステップS39において、出力記憶部8の値OUTPが−1であり、既に系列に使用済みであると判定してステップS40に進む。ステップS40では、制御部2Bは、入力指定部7の値INPが系列の最後の位置(m-1)を示す2であるかどうかを判定する。ここでは、INPは1であり2ではないので、制御部2Bは入力指定部7の値INPを1加算して2とした後(ステップS42)、ステップS38に進み入力指定部7の値INPが示す周期計算部6の位置の入力データに対応する出力データP(INP)を出力記憶部8の値OUTPに設定する。ここでは、INPは2であるので、入力データはP(2)であり、それに対応する出力データは前述したように−1であるので、OUTPは−1に設定される。   Subsequently, in step S39, the control unit 2B determines that the value OUTP of the output storage unit 8 is −1 and has already been used for the series, and proceeds to step S40. In step S40, the control unit 2B determines whether or not the value INP of the input specifying unit 7 is 2 indicating the last position (m-1) in the sequence. Here, since INP is 1 and not 2, the control unit 2B adds 1 to the value INP of the input specifying unit 7 to 2 (step S42), and then proceeds to step S38, where the value INP of the input specifying unit 7 is The output data P (INP) corresponding to the input data at the position of the cycle calculation unit 6 shown is set to the value OUTP of the output storage unit 8. Here, since INP is 2, the input data is P (2), and the corresponding output data is −1 as described above, so OUTP is set to −1.

続いて、制御部2Bは、ステップS39において、出力記憶部8の値OUTPが−1であり、既に系列に使用済みであると判定してステップS40に進む。ステップS40では、制御部2Bは、入力指定部7の値INPが系列の最後の位置(m-1)を示す2であるかどうかを判定する。ここでは、INPは2であるので、制御部2Bは入力指定部7の値INPが系列の最後の位置に達し、全ての入出力データの処理を行ったと判断して、全ての処理を終了する(図12のステップS41)。このようにして、周期記憶部10に格納されている周期PR(1)〜PR(3)には、この関数の各周期長の全ての存在数が設定された状態となる。本実施形態では、m=3の場合であり、上記のようにこの全単射関数の有する各周期数として周期数1を示すPR(1)が1個と、周期数2を示すPR(2)が1個と求まる。   Subsequently, in step S39, the control unit 2B determines that the value OUTP of the output storage unit 8 is −1 and has already been used for the series, and proceeds to step S40. In step S40, the control unit 2B determines whether or not the value INP of the input specifying unit 7 is 2 indicating the last position (m-1) in the sequence. Here, since INP is 2, the control unit 2B determines that the value INP of the input designation unit 7 has reached the last position in the sequence and has processed all input / output data, and ends all processing. (Step S41 in FIG. 12). In this way, in the periods PR (1) to PR (3) stored in the period storage unit 10, all existing numbers of each period length of this function are set. In this embodiment, m = 3. As described above, one PR (1) indicating the period number 1 as each period number of the bijective function and PR (2) indicating the period number 2 are provided. ) Is one.

このようにして、本実施形態によれば、任意の入出力データ数の全単射関数の任意のデータ系列についての部分周期を含めた全ての周期を求めることができる。   In this way, according to the present embodiment, it is possible to obtain all the periods including a partial period for an arbitrary data series of a bijective function having an arbitrary number of input / output data.

(第3の実施形態)
次に、本発明になる整数系列の周期判定装置の第3の実施形態について説明する。本実施形態の周期判定装置のハードウェア構成は、図11に示した整数系列の周期判定装置1Bと同じ構成であるが、制御部2Bによるソフトウェア動作が以下説明するように第2の実施形態と異なる。
(Third embodiment)
Next, a third embodiment of the integer sequence period determining apparatus according to the present invention will be described. The hardware configuration of the cycle determination device of this embodiment is the same as that of the integer sequence cycle determination device 1B shown in FIG. 11, but the software operation by the control unit 2B is the same as that of the second embodiment as described below. Different.

本実施形態は、大きさ3(m=3)の自然数からなる全単射関数が与えられた場合、その全単射関数が最大周期3(=m)を有するかの確認方法として、或る初期値(例えば0)を入力値として全単射関数に与えて、その出力(例えば0)が初期値に戻るまで全単射関数の変換を繰り返し、その繰り返しの回数である周期が3(=m)となった場合には、全ての入出力値を網羅し、最大周期であると判定し、変換の繰り返し回数が3(=m)より小さかった場合には最大周期ではないと判断する。   In the present embodiment, when a bijection function including a natural number of size 3 (m = 3) is given, a method for confirming whether the bijection function has a maximum period 3 (= m) is a certain method. The initial value (for example, 0) is given as an input value to the bijection function, and the conversion of the bijection function is repeated until the output (for example, 0) returns to the initial value, and the cycle that is the number of repetitions is 3 (= If m), all input / output values are covered and determined to be the maximum cycle, and if the number of conversion iterations is less than 3 (= m), it is determined not to be the maximum cycle.

次に、本実施形態のハードウェア資源を利用したソフトウェア動作について、図14のフローチャートと共に説明する。前述したように、m=3の場合の最大周期は3である。本実施形態は、例えば、前記f5のように入力0のとき出力2、入力1のとき出力0、入力2のとき出力1のデータが最大周期3となるかどうかの判定を行う。   Next, a software operation using the hardware resources of this embodiment will be described with reference to the flowchart of FIG. As described above, the maximum period when m = 3 is 3. In the present embodiment, for example, it is determined whether or not the data of the output 2 when the input is 0, the output 0 when the input is 1, and the output 1 when the input is 2 is the maximum period 3 as in the case of f5.

図11において、制御部2Bは、まず、データ数記憶部3にデータ数m(ここでは、m=3)を設定する(図14のステップS61)。続いて、制御部2Bは、周期累計部9の値PSを0に設定(クリア)した後(ステップS62)、順列作成部4に全単射関数の入出力データとして、入力データ(0からm−1までの自然数)に対応する出力系列データA(0)〜A(m-1)を設定する(ステップS63)。具体的には、この出力系列データA(0)〜A(m-1)は、0からm−1までの重複しない自然数の任意の組み合わせのデータで、ここではm=3であるので、例えば、A(0)=2,A(1)=0,A(2)=1の3個のデータである。ここで、A(0)=2は、入力0のとき出力2、A(1)=0は入力1のとき出力0、A(2)=1は入力2のとき出力1を示す。   In FIG. 11, the control unit 2B first sets the number of data m (here, m = 3) in the data number storage unit 3 (step S61 in FIG. 14). Subsequently, the control unit 2B sets (clears) the value PS of the period accumulating unit 9 to 0 (step S62), and then inputs the input data (0 to m as input / output data of the bijection function to the permutation generation unit 4). Output series data A (0) to A (m-1) corresponding to natural numbers up to -1 is set (step S63). Specifically, the output series data A (0) to A (m-1) is data of arbitrary combinations of non-overlapping natural numbers from 0 to m-1, and here m = 3. , A (0) = 2, A (1) = 0, A (2) = 1. Here, A (0) = 2 indicates output 2 when input 0, A (1) = 0 indicates output 0 when input 1, and A (2) = 1 indicates output 1 when input 2.

続いて、制御部2Bは、順列作成部4に設定した上記の3個の出力系列データA(0)〜A(2)を順列記憶部5の順列S(0)〜S(m-1)にそれぞれ格納する(ステップS64)。ここでは、上記の順列記憶部5には、S(0)=2,S(1)=0,S(2)=1の3個の順列が格納されることになる。これら3個の順列は、所望の1個の全単射関数の3つの入力値に対する出力の状態を記述したものである。   Subsequently, the control unit 2B converts the three output series data A (0) to A (2) set in the permutation creation unit 4 into the permutations S (0) to S (m-1) in the permutation storage unit 5. (Step S64). Here, the above-described permutation storage unit 5 stores three permutations of S (0) = 2, S (1) = 0, and S (2) = 1. These three permutations describe the output states for the three input values of a desired bijective function.

続いて、制御部2Bは、順列記憶部5に格納された順列S(0)〜S(m-1)を、周期計算部6に周期P(0)〜P(m-1)としてそれぞれ設定する(ステップS65)。ここでは、上記の周期計算部6には、P(0)=2,P(1)=0,P(2)=1の3個の周期が設定されることになる。ここで、P(0)=2は、入力0のとき出力2の周期、P(1)=0は入力1のとき出力0の周期、P(2)=1は入力2のとき出力1の周期を示す。   Subsequently, the control unit 2B sets the permutations S (0) to S (m-1) stored in the permutation storage unit 5 as the periods P (0) to P (m-1) in the period calculation unit 6, respectively. (Step S65). Here, three cycles of P (0) = 2, P (1) = 0, and P (2) = 1 are set in the cycle calculation unit 6 described above. Here, P (0) = 2 is the period of output 2 when input 0, P (1) = 0 is the period of output 0 when input 1 and P (2) = 1 is the period of output 1 when input 2 Indicates the period.

続いて、制御部2Bは、最初の入力データに相当する先頭の位置(この場合、入力位置0)を示す値を入力指定部7の値INPに設定する(ステップS66)。これにより、INPは0となる。続いて、制御部2Bは、入力指定部7の値INP(ここでは0)が示す、周期計算部6の位置の入力データに対応する、出力データP(INP)を出力記憶部8の値OUTPに設定する(ステップS67)。ここでは、INPは0であるので、入力データは0であり、それに対応する出力データP(0)は前述したように2であるから、OUTPは2に設定される。   Subsequently, the control unit 2B sets a value indicating the head position (in this case, the input position 0) corresponding to the first input data to the value INP of the input specifying unit 7 (step S66). As a result, INP becomes zero. Subsequently, the control unit 2B outputs the output data P (INP) corresponding to the input data at the position of the period calculation unit 6 indicated by the value INP (here, 0) of the input designation unit 7 to the value OUTP of the output storage unit 8. (Step S67). Here, since INP is 0, the input data is 0, and the output data P (0) corresponding to it is 2 as described above, so OUTP is set to 2.

続いて、制御部2Bは、出力記憶部8の値OUTP(ここでは2)を入力指定部7の値INPに設定した後(ステップS68)、周期累計部9の周期の値PSに1を加算して周期数を更新する(ステップS69)。これにより、INPは2、PSは1となる。   Subsequently, the control unit 2B sets the value OUTP (here, 2) in the output storage unit 8 to the value INP in the input designation unit 7 (step S68), and then adds 1 to the cycle value PS of the cycle accumulating unit 9. Then, the number of cycles is updated (step S69). As a result, INP becomes 2 and PS becomes 1.

次に、制御部2Bは、出力記憶部8の値OUTP(ここでは2)が最初の入力データの値0であるかどうかを判定する(ステップS70)。OUTPの値が最初の入力データの値と等しければステップS71に進み、等しくなければステップS67に戻る。この時点では、OUTPは2であり、0ではないので制御部2BはステップS67に戻り、入力指定部7の値INP(ここでは2)が示す、周期計算部6の位置の入力データに対応する、出力データP(INP)を出力記憶部8の値OUTPに設定する。ここでは、入力データINPは2であるので、それに対応する出力データは前述したように1であるから、OUTPは1に設定される。   Next, the control unit 2B determines whether or not the value OUTP (here, 2) in the output storage unit 8 is the value 0 of the first input data (step S70). If the value of OUTP is equal to the value of the first input data, the process proceeds to step S71, and if not equal, the process returns to step S67. At this time, since OUTP is 2 and not 0, the control unit 2B returns to step S67 and corresponds to the input data at the position of the period calculation unit 6 indicated by the value INP (here, 2) of the input designating unit 7. The output data P (INP) is set to the value OUTP of the output storage unit 8. Here, since the input data INP is 2, the output data corresponding to it is 1 as described above, so OUTP is set to 1.

続いて、制御部2Bは、出力記憶部8の値OUTP(ここでは1)を入力指定部7の値INPに設定した後(ステップS68)、周期累計部9の値PSに1を加算して周期数を更新する(ステップS69)。これにより、INPは1、PSは2となる。   Subsequently, the control unit 2B sets the value OUTP (here, 1) in the output storage unit 8 to the value INP in the input designating unit 7 (step S68), and then adds 1 to the value PS in the cycle accumulating unit 9. The number of cycles is updated (step S69). As a result, INP becomes 1 and PS becomes 2.

次に、制御部2Bは、出力記憶部8の値OUTP(ここでは1)が最初の入力データの値0であるかどうかを再び判定する(ステップS70)。この時点では、OUTPは1であり、0ではないので制御部2BはステップS67に戻り、再び入力指定部7の値INP(ここでは1)が示す、周期計算部6の位置の入力データINPに対応する、出力データP(INP)を出力記憶部8の値OUTPに設定する。ここでは、INPは1であるので、入力データに対応する出力データP(1)は前述したように0であるから、OUTPは0に設定される。   Next, the control unit 2B determines again whether or not the value OUTP (here, 1) in the output storage unit 8 is the value 0 of the first input data (step S70). At this time, since OUTP is 1 and not 0, the control unit 2B returns to step S67 and again enters the input data INP at the position of the period calculation unit 6 indicated by the value INP (here, 1) of the input designation unit 7. Corresponding output data P (INP) is set to the value OUTP of the output storage unit 8. Here, since INP is 1, the output data P (1) corresponding to the input data is 0 as described above, so OUTP is set to 0.

続いて、制御部2Bは、出力記憶部8の値OUTP(ここでは0)を入力指定部7の値INPに設定した後(ステップS68)、周期累計部9の値PSに1を加算して周期数を更新する(ステップS69)。これにより、INPは0、PSは3となる。   Subsequently, the control unit 2B sets the value OUTP (here, 0) in the output storage unit 8 to the value INP in the input designating unit 7 (step S68), and then adds 1 to the value PS in the period accumulating unit 9. The number of cycles is updated (step S69). As a result, INP becomes 0 and PS becomes 3.

次に、制御部2Bは、出力記憶部8の値OUTP(ここでは0)が最初の入力データの値0であるかどうかを再び判定する(ステップS70)。この時点でOUTPが0であり、最初の入力値であると判定される。続いて、制御部2Bは周期累計部9の周期の値PSは系列長mであるかどうかを判定する(ステップS71)。この時点では、累計計算部9の値PSは系列長m(=3)に等しいので、制御部2Bは最大長(最大周期)であると判定する(ステップS72)。すなわち、m=3の場合、入力0のとき出力2、入力1のとき出力0、入力2のとき出力1のデータが最大周期であると判定され、その周期長PSは3と求められる。   Next, the control unit 2B determines again whether or not the value OUTP (here, 0) in the output storage unit 8 is the value 0 of the first input data (step S70). At this time, OUTP is 0, and it is determined that it is the first input value. Subsequently, the control unit 2B determines whether or not the cycle value PS of the cycle accumulating unit 9 is the sequence length m (step S71). At this time, since the value PS of the cumulative calculation unit 9 is equal to the sequence length m (= 3), the control unit 2B determines that it is the maximum length (maximum cycle) (step S72). That is, in the case of m = 3, it is determined that the data of the output 2 when the input is 0, the output 0 when the input is 1, and the output 1 when the input is 2 is the maximum cycle, and the cycle length PS is obtained as 3.

なお、ステップS71において、周期累計部9の値PSが系列長mでないと判定されたときは、そのときの入力データは最大長ではないと判定される(ステップS73)。   When it is determined in step S71 that the value PS of the period accumulating unit 9 is not the sequence length m, it is determined that the input data at that time is not the maximum length (step S73).

このようにして、本実施形態によれば、任意の入出力データの大きさの全単射関数の最大周期長を判定することができる。そして、最大周期となる全単射関数を用いて、擬似乱数系列や変換表などを作成することができる。   In this way, according to the present embodiment, it is possible to determine the maximum period length of the bijective function having an arbitrary input / output data size. Then, a pseudo random number sequence, a conversion table, or the like can be created using a bijective function having a maximum period.

ところで、以上の実施形態では、データ数(系列長)mが2又は3の場合について説明したが、mが9までの周期長の個数は表4に示される。   By the way, in the above embodiment, the case where the number of data (sequence length) m is 2 or 3 has been described.

Figure 2011123693
この表4から分るように、入出力データ数(系列長)mを有する全単射関数の平均周期長はm/2となる。これにより、mが2128の場合では、全単射関数の数は2128!個となり、周期長は1が2128!個で、2が2128!/2個、3が2128!/3個で、最大周期となる周期長2128は2128!/2128個存在する。ここで、平均周期長は2128/2となる。
Figure 2011123693
As can be seen from Table 4, the average period length of the bijection function having the number of input / output data (sequence length) m is m / 2. Thus, in the case m is 2 128, the number of bijective functions 2 128! The cycle length is 1 128 128 ! 2 with 2 128 ! / 2 pieces, 3 are 2 128 ! / 3, the maximum cycle length 2 128 is 2 128 ! / 2 There are 128 pieces. Here, the average period length is 2 128/2 .

また、128ビットブロック暗号の場合について考えると、128ビット鍵の数は2128個であることから、128ビットブロック暗号はm=2128の全単射関数全ての関数2128!個のうちの2128個を鍵で選択して用いているといえる。そして、m=2128の全単射関数の最大周期2128は2128!/2128個存在することから、128ビットブロック暗号の鍵の総数から考慮して、全ての鍵から最大周期となるものは、
128!/2128×2128/2128!=1
と記述できることから全ての鍵のうちで最大周期となるものの確率は、高々1個である。
Further, 128-bit Considering the case of a block cipher, since the number of 128-bit key is 2 128, 128-bit block cipher m = 2 128 bijective functions all functions 2 128! 2 128 of the number said to be used to select the key. The maximum period 2128 bijective function of m = 2 128 2 128! / 2 Since there are 128, considering the total number of keys for 128-bit block ciphers, all keys have the maximum period.
2 128 ! / 2 128 × 2 128/2 128 ! = 1
The probability of the maximum period among all keys is at most one.

ただし、ここで述べている最大周期とは128ビットの出力データの組み合わせが各々1回出現することであり、その出力データの任意の1ビットをそれぞれ抽出した場合に、その系列としてM系列のような最大長のビット系列が必ず得られるものではなく、そのためには最大周期となる系列から更に選択が必要である。   However, the maximum cycle described here means that each combination of 128-bit output data appears once, and when one arbitrary bit of the output data is extracted, the sequence is M-sequence. Therefore, it is not always possible to obtain a bit sequence having a maximum length. For this purpose, further selection from a sequence having the maximum period is necessary.

なお、以上の実施形態で判定した最大周期を持つ全単射関数の整数系列を2種類以上組み合わせて用いることで、更に長い周期の擬似乱数系列を生成することもできる。例えば、m1とm2の2つの周期の異なる最大長系列において、1以外の約数を持たない互いに素となる周期の組み合わせとなるものを組み合わせれば、最大周期はm1×m2となる。   Note that a pseudo-random number sequence having a longer period can be generated by using a combination of two or more integer sequences of bijection functions having the maximum period determined in the above embodiment. For example, if the maximum length sequences having different periods of m1 and m2 are combined with a combination of disjoint periods having no divisor other than 1, the maximum period is m1 × m2.

なお、本発明は以上の実施形態に限定されるものではなく、例えば、図7、図8、図9と共に説明した第1の実施形態の各ステップの処理や、図12及び図13と共に説明した第2の実施形態の各ステップの処理や、図14と共に説明した第3の実施形態の各ステップの処理をコンピュータによるソフトウェア処理により実行させる整数系列の周期判定プログラムも本発明は包含するものである。この整数系列の周期判定プログラムは、図1の制御部2Aや図11の制御部2Bにより実行される。   The present invention is not limited to the above embodiment. For example, the processing of each step of the first embodiment described with reference to FIGS. 7, 8, and 9 and the description with reference to FIGS. The present invention also includes an integer series period determination program that executes the processing of each step of the second embodiment and the processing of each step of the third embodiment described with reference to FIG. 14 by software processing by a computer. . The integer series period determination program is executed by the control unit 2A in FIG. 1 or the control unit 2B in FIG.

1A、1B 整数系列の周期判定装置
2A、2B 制御部
3 データ数記憶部
4 順列作成部
5 順列記憶部
6 周期計算部
7 入力指定部
8 出力記憶部
9 周期累計部
10 周期記憶部
11 順列数設定部
12 検索位置指定部
1A, 1B Integer period determination device 2A, 2B Control unit 3 Data number storage unit 4 Permutation creation unit 5 Permutation storage unit 6 Period calculation unit 7 Input designation unit 8 Output storage unit 9 Period accumulation unit 10 Period storage unit 11 Number of permutations Setting section
12 Search position specification part

Claims (9)

制御部が、0からm−1(ただし、mは2以上の整数)までの値の重複しないm個の整数からなる整数系列の入力(原像)と出力(像)とを持つm!個の全単射関数(写像)についての前記m種類の入力に対する出力の状態のデータを全て順列として作成して第1の記憶部に記憶する第1のステップと、
前記制御部が、前記第1の記憶部に記憶された前記m!個の全単射関数についての前記順列のそれぞれについて、或る入力値を与えたときの出力値を求め、更にその出力値を入力値とすることを、最初の入力値と同じ出力値が得られるまで繰り返し変換を行い、その変換回数を周期として求め、前記周期が前記mより小さいときは、未出現の入力値が存在するものと判定し、未出現の入力値を前記順列に与えたときの出力値を求め、更にその出力値を入力値とすることを、未出現の入力値と同じ出力値が得られるまで繰り返し変換を行い、その変換回数を周期として求めることを、全ての前記入力値及び全ての前記未出現の入力値に対して順次行う第2のステップと、
前記制御部が、前記第2のステップで求められた前記m!個の全単射関数の最小周期から最大周期までの前記周期を第2の記憶部に記憶する第3のステップと
を含むことを特徴とする整数系列の周期判定方法。
The control unit m has an input (original image) and an output (image) of an integer sequence composed of m integers with non-overlapping values from 0 to m−1 (where m is an integer of 2 or more). A first step of creating all permutations of output state data for the m types of inputs for a plurality of bijection functions (mappings) and storing them in a first storage unit;
The control unit stores the m! Stored in the first storage unit. For each of the permutations of the bijection function, an output value when a certain input value is given is obtained, and the output value is set as the input value, and the same output value as the first input value is obtained. Until the number of conversions is calculated as a period, and when the period is smaller than the m, it is determined that there is an unappeared input value, and an unappeared input value is given to the permutation All the above inputs are obtained by repeatedly converting until the same output value as the input value that does not appear is obtained, and obtaining the number of conversions as a cycle. A second step for sequentially performing the value and all said unoccurring input values;
The control unit determines the m! Determined in the second step. And a third step of storing, in a second storage unit, the period from the minimum period to the maximum period of each bijective function.
前記第1のステップは、
前記m!個の全単射関数(写像)のうち、最初の全単射関数の順列データのデータを作成した後、2番目からm!番目までの全単射関数の順列データは、それぞれその1つ前の順番の全単射関数の順列データから作成することを特徴とする請求項1記載の整数系列の周期判定方法。
The first step includes
Said m! After creating the permutation data of the first bijection function among the bijection functions (mappings), the second to m! 2. The integer sequence period determining method according to claim 1, wherein the permutation data of the bijection function up to the th is created from the permutation data of the bijection function of the immediately preceding bijection function.
制御部が、0からm−1(ただし、mは2以上の整数)までの値の重複しないm個の整数からなる整数系列の入力(原像)と出力(像)とを持つm!個の全単射関数(写像)のうち、所望の1個の前記全単射関数の前記m個の整数からなる整数系列の入力に対する出力の状態を順列として第1の記憶部に記憶する第1のステップと、
前記制御部が、前記m個の入力のうち最初の入力を与えたときの出力値を求め、更にその出力値を入力値とすることを、最初の入力値と同じ出力値が得られるまで繰り返すと共に、その繰り返し回数を周期として第2の記憶部に記憶することを、前記の周期に未出現の入力値の全てに行う第2のステップと、
前記制御部が、前記第2の記憶部に記憶された周期が前記mであるか否かを判定し、前記周期が前記mであるとき、その周期を前記所望の1個の前記全単射関数の最大周期であると決定する第3のステップと
を含むことを特徴とする整数系列の周期判定方法。
The control unit m has an input (original image) and an output (image) of an integer sequence composed of m integers with non-overlapping values from 0 to m−1 (where m is an integer of 2 or more). Among the plurality of bijection functions (mappings), the first storage unit stores in the first storage unit the output state of the desired one bijection function with respect to the input of the integer series consisting of the m integers as a permutation. 1 step,
The control unit obtains an output value when the first input is given out of the m inputs, and further sets the output value as an input value until the same output value as the first input value is obtained. And storing the number of repetitions as a cycle in the second storage unit for all input values not appearing in the cycle;
The control unit determines whether the cycle stored in the second storage unit is the m, and when the cycle is the m, the cycle is set to the desired one bijection. And a third step of determining that the cycle is the maximum cycle of the function.
第1及び第2の記憶部と、
0からm−1(ただし、mは2以上の整数)までの値の重複しないm個の整数からなる整数系列の入力(原像)と出力(像)とを持つm!個の全単射関数についての前記m種類の入出力に対する出力の状態を全て順列として生成して前記第1の記憶部に記憶する順列生成及び記憶手段と、
前記第1の記憶部に記憶された前記m!個の全単射関数についての前記順列のそれぞれについて、或る入力値を与えたときの出力値を求め、更にその出力値を入力値とすることを、最初の入力値と同じ出力値が得られるまで繰り返し変換を行い、その変換回数を周期として求め、前記周期が前記mより小さいときは、未出現の入力値が存在するものと判定し、未出現の入力値を前記順列に与えたときの出力値を求め、更にその出力値を入力値とすることを、未出現の入力値と同じ出力値が得られるまで繰り返し変換を行い、その変換回数を周期として求めることを、全ての前記入力値及び全ての前記未出現の入力値に対して順次行う周期計算及び累計手段と、
前記第2のステップで求められた前記m!個の全単射関数の最小周期から最大周期までの前記周期を第2の記憶部に記憶する記憶手段と
を有することを特徴とする整数系列の周期判定装置。
First and second storage units;
M having an input (original image) and an output (image) of an integer sequence consisting of m integers with non-overlapping values from 0 to m-1 (where m is an integer of 2 or more). Permutation generation and storage means for generating all permutations of the output states for the m types of input / output for a single bijection function and storing them in the first storage unit;
The m! Stored in the first storage unit. For each of the permutations of the bijection function, an output value when a certain input value is given is obtained, and the output value is set as the input value, and the same output value as the first input value is obtained. Until the number of conversions is calculated as a period, and when the period is smaller than the m, it is determined that there is an unappeared input value, and an unappeared input value is given to the permutation All the above inputs are obtained by repeatedly converting until the same output value as the input value that does not appear is obtained, and obtaining the number of conversions as a cycle. Periodic calculation and accumulation means for sequentially performing values and all the non-appearing input values;
The m determined in the second step! And a storage unit that stores the period from the minimum period to the maximum period of each bijective function in a second storage unit.
前記順列生成及び記憶手段は、
前記m!個の全単射関数(写像)のうち、最初の全単射関数の順列データのデータを作成した後、2番目からm!番目までの全単射関数の順列データは、それぞれその1つ前の順番の全単射関数の順列データから作成し、作成した順列データを前記第1の記憶部に記憶することを特徴とする請求項4記載の整数系列の周期判定装置。
The permutation generation and storage means includes
Said m! After creating the permutation data of the first bijection function among the bijection functions (mappings), the second to m! The permutation data of the first bijection function up to the second is created from the permutation data of the bijection function of the immediately preceding one, and the created permutation data is stored in the first storage unit. The integer sequence period determining apparatus according to claim 4.
第1及び第2の記憶部と、
0からm−1(ただし、mは2以上の整数)までの値の重複しないm個の整数からなる整数系列の入力(原像)と出力(像)とを持つm!個の全単射関数のうち、所望の1個の前記全単射関数の前記m個の整数からなる整数系列の入力に対する出力の状態を順列として第1の記憶部に記憶する順列記憶手段と、
前記m個の入力のうち最初の入力を与えたときの出力値を求め、更にその出力値を入力値とすることを、最初の入力値と同じ出力値が得られるまで繰り返すと共に、その繰り返し回数を周期として第2の記憶部に記憶することを、前記の周期に未出現の入力値の全てに行う周期計算及び累計手段と、
前記第2の記憶部に記憶された周期が前記mであるか否かを判定し、前記周期が前記mであるとき、その周期を前記所望の1個の前記全単射関数の最大周期であると決定する最大周期判定手段と
を有することを特徴とする整数系列の周期判定装置。
First and second storage units;
M having an input (original image) and an output (image) of an integer sequence consisting of m integers with non-overlapping values from 0 to m-1 (where m is an integer of 2 or more). Permutation storage means for storing, in the first storage unit, a state of an output with respect to an input of an integer sequence composed of the m integers of one desired bijection function among the plurality of bijection functions as a permutation; ,
Obtaining an output value when the first input is given among the m inputs, and further setting the output value as an input value is repeated until the same output value as the first input value is obtained, and the number of repetitions. A period calculation and accumulating unit for storing all of the input values that have not appeared in the period as a period in the second storage unit;
It is determined whether or not the period stored in the second storage unit is the m, and when the period is the m, the period is the maximum period of the desired single bijection function. An integer sequence period determining device comprising: a maximum period determining unit that determines that there is an integer sequence.
コンピュータに、
0からm−1(ただし、mは2以上の整数)までの値の重複しないm個の整数からなる整数系列の入力(原像)と出力(像)とを持つm!個の全単射関数についての前記m種類の入出力に対する出力の状態を全て順列として生成して第1の記憶部に記憶する第1のステップと、
前記第1の記憶部に記憶された前記m!個の全単射関数についての前記順列のそれぞれについて、或る入力値を与えたときの出力値を求め、更にその出力値を入力値とすることを、最初の入力値と同じ出力値が得られるまで繰り返し変換を行い、その変換回数を周期として求めることを全ての入力値に対して順次行い、得られた周期を第2の記憶部に記憶する第2のステップと、
前記第2のステップで求めた前記周期が前記mより小さいと判定したときは、未出現の入力値が存在するものと判定し、未出現の入力値を前記順列に与えたときの出力値を求め、更にその出力値を入力値とすることを、未出現の入力値と同じ出力値が得られるまで繰り返し変換を行い、その変換回数を周期として求めることを全ての未出現の入力値に対して順次行い、得られた周期を前記第2の記憶部に記憶する第3のステップと、
前記第2の記憶部に記憶された前記第2及び第3のステップで得られた周期に基づいて、前記m!個の全単射関数の最小周期から最大周期までの周期の判定を行う第4のステップと
を実行させることを特徴とする整数系列の周期判定プログラム。
On the computer,
M having an input (original image) and an output (image) of an integer sequence consisting of m integers with non-overlapping values from 0 to m-1 (where m is an integer of 2 or more). A first step of generating all permutations of output states for the m types of input / output for the bijective functions and storing them in a first storage unit;
The m! Stored in the first storage unit. For each of the permutations of the bijection function, an output value when a certain input value is given is obtained, and the output value is set as the input value, and the same output value as the first input value is obtained. A second step of repeatedly performing conversion until it is obtained, performing the conversion as a cycle for all input values, and storing the obtained cycle in the second storage unit;
When it is determined that the period obtained in the second step is smaller than the m, it is determined that there is an input value that does not appear, and an output value when an input value that does not appear is given to the permutation is obtained. Obtaining the output value as an input value, iteratively transforming until the same output value as the non-appearing input value is obtained, and obtaining the number of conversions as a period for all the non-appearing input values And a third step of sequentially storing the obtained period in the second storage unit;
Based on the period obtained in the second and third steps stored in the second storage unit, the m! And a fourth step of determining a period from the minimum period to the maximum period of each bijection function.
前記第1のステップは、
前記m!個の全単射関数(写像)のうち、最初の全単射関数の順列データのデータを作成した後、2番目からm!番目までの全単射関数の順列データは、それぞれその1つ前の順番の全単射関数の順列データから作成することを特徴とする請求項1記載の整数系列の周期判定プログラム。
The first step includes
Said m! After creating the permutation data of the first bijection function among the bijection functions (mappings), the second to m! 2. The program for determining a period of an integer sequence according to claim 1, wherein the permutation data of the bijection function up to the th is created from the permutation data of the bijection function in the immediately preceding order.
コンピュータに、
0からm−1(ただし、mは2以上の整数)までの値の重複しないm個の整数からなる整数系列の入力(原像)と出力(像)とを持つm!個の全単射関数のうち、所望の1個の前記全単射関数の前記m個の整数からなる整数系列の入力に対する出力の状態を順列として第1の記憶部に記憶する第1のステップと、
前記第1の記憶部に記憶された前記m!個の全単射関数についての前記順列のそれぞれについて、或る入力値を与えたときの出力値を求め、更にその出力値を入力値とすることを、最初の入力値と同じ出力値が得られるまで繰り返し変換を行い、その変換回数を周期として求め、前記周期が前記mより小さいときは、未出現の入力値が存在するものと判定し、未出現の入力値を前記順列に与えたときの出力値を求め、更にその出力値を入力値とすることを、未出現の入力値と同じ出力値が得られるまで繰り返し変換を行い、その変換回数を周期として求めることを、前記の周期に未出現の入力値の全てに行う第2のステップと、
前記第2のステップで求められた前記m!個の全単射関数の最小周期から最大周期までの前記周期を第2の記憶部に記憶する第3のステップと
を実行させることを特徴とする整数系列の周期判定プログラム。
On the computer,
M having an input (original image) and an output (image) of an integer sequence consisting of m integers with non-overlapping values from 0 to m-1 (where m is an integer of 2 or more). A first step of storing, in the first storage unit, a state of an output for an input of an integer sequence composed of the m integers of a desired one of the bijective functions among a plurality of bijective functions as a permutation; When,
The m! Stored in the first storage unit. For each of the permutations of the bijection function, an output value when a certain input value is given is obtained, and the output value is set as the input value, and the same output value as the first input value is obtained. Until the number of conversions is calculated as a period, and when the period is smaller than the m, it is determined that there is an unappeared input value, and an unappeared input value is given to the permutation To obtain the output value of the output, and further to convert the output value as the input value until the same output value as the input value that does not appear is obtained, and to obtain the number of conversions as the cycle A second step for all unoccurring input values;
The m determined in the second step! And a third step of storing the period from the minimum period to the maximum period of each bijective function in a second storage unit.
JP2009281167A 2009-12-11 2009-12-11 Method, apparatus and program for determining period of integer sequence Pending JP2011123693A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009281167A JP2011123693A (en) 2009-12-11 2009-12-11 Method, apparatus and program for determining period of integer sequence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009281167A JP2011123693A (en) 2009-12-11 2009-12-11 Method, apparatus and program for determining period of integer sequence

Publications (1)

Publication Number Publication Date
JP2011123693A true JP2011123693A (en) 2011-06-23

Family

ID=44287519

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009281167A Pending JP2011123693A (en) 2009-12-11 2009-12-11 Method, apparatus and program for determining period of integer sequence

Country Status (1)

Country Link
JP (1) JP2011123693A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011145464A (en) * 2010-01-14 2011-07-28 Nihon Univ Device and program for generation of pseudo-random number
JP2016053570A (en) * 2014-09-03 2016-04-14 有限会社ファインチューン Absolute type encoder

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008003937A (en) * 2006-06-23 2008-01-10 Technical Research & Development Institute Ministry Of Defence Method and device for analyzing state transition in pseudo random number generating mechanism, and period length measuring device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008003937A (en) * 2006-06-23 2008-01-10 Technical Research & Development Institute Ministry Of Defence Method and device for analyzing state transition in pseudo random number generating mechanism, and period length measuring device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CSNG201000113001; 伊東 徹 Toru ITO: '全単射関数の帰還周期長について The feedback period length of Bijective function' 電子情報通信学会技術研究報告 Vol.109 No.337 IEICE Technical Report , 20091209, p.1-6, 社団法人電子情報通信学会 The Institute of Electro *
JPN6013055365; 伊東 徹 Toru ITO: '全単射関数の帰還周期長について The feedback period length of Bijective function' 電子情報通信学会技術研究報告 Vol.109 No.337 IEICE Technical Report , 20091209, p.1-6, 社団法人電子情報通信学会 The Institute of Electro *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011145464A (en) * 2010-01-14 2011-07-28 Nihon Univ Device and program for generation of pseudo-random number
JP2016053570A (en) * 2014-09-03 2016-04-14 有限会社ファインチューン Absolute type encoder

Similar Documents

Publication Publication Date Title
JP4871944B2 (en) Crypto system configured to extend the repetition period of a random number sequence
JP4559505B2 (en) Extending the repetition period of random sequences
US10359996B2 (en) Random number generator and stream cipher
JP5000365B2 (en) Hash value generation device, program, and hash value generation method
JP2020537191A5 (en)
JPWO2013094056A1 (en) Device specific information generation apparatus and device specific information generation method
Das et al. Generation of AES S-boxes with various modulus and additive constant polynomials and testing their randomization
JP6607257B2 (en) Secret calculation system, secret calculation device, and secret calculation method
JP2011123693A (en) Method, apparatus and program for determining period of integer sequence
JP6368051B2 (en) Electron generator
Fúster-Sabater et al. An efficient algorithm to generate binary sequences for cryptographic purposes
US20140289295A1 (en) Method for generating a random output bit sequence
JP4709685B2 (en) Pseudorandom number generation device, pseudorandom number generation method, pseudorandom number generation program, encryption device, and decryption device
JP4629300B2 (en) Cryptographic pseudorandom number generator and program
JP2007124610A (en) Confidential information distribution apparatus, confidential information restoration apparatus, method and program
JP5101253B2 (en) Random error generator, M-sequence generator, and design method thereof
JP2007004268A (en) Random number series generation device, random number series generation method, arithmetic processing device, arithmetic processing method and program
Kumar et al. Modified Version of Playfair Cipher Using Linear Feedback Shift Register and Transpose Matrix Concept
JP5455664B2 (en) Pseudorandom number generator and pseudorandom number generation program
JP2017058501A (en) Hash function calculation device and method
KR101153880B1 (en) Method for key derivation using galois transformation
KR101649996B1 (en) threshold clock controlled random password generator
JP7406108B2 (en) Encryption/decryption system, encryption/decryption method, and encryption/decryption program
Alhakim et al. De Bruijn Sequences with Varying Combs.
JP5006770B2 (en) Message authenticator generation device, message authenticator verification device, message authenticator generation method, message authenticator verification method, program, and recording medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20121002

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131030

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131112

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20140617