Standard ICS number:Information technology, office machinery and equipment >> 35.240 Information technology applications
Standard Classification Number:General>>Standardization Management and General Provisions>>A01 Technical Management
associated standards
Publication information
other information
drafter:Wang Suying, Li Yanbing, Zhang Tong, Zhu Zhixin, Ge Weizhou, He Tianqiong, Zhang Jitao, Han Yi, Cheng Lianghui, Fang Jie, Fu Xiaobing, Li Yinghua, Du Liting
Drafting unit:China Welfare Lottery Issuing and Management Center
Focal point unit:Department of Social Welfare and Charity Promotion, Ministry of Civil Affairs
Proposing unit:China Welfare Lottery Issuing and Management Center
Publishing department:Ministry of Civil Affairs of the People's Republic of China
competent authority:Department of Social Welfare and Charity Promotion, Ministry of Civil Affairs
Standard number: MZ/T 093-2017
Standard name: China Welfare Lottery System Lottery Random Number Test Specification
English name: Specification for Welfare-Lottery System Lottery-Random-Number-Test
Standard format: PDF
Release time: 2017-10-18
Implementation time: 2017-10-18
Standard size: 837K
Standard introduction: This standard specifies the test method, test process and test result of the randomness of the lottery random number sequence of China Welfare Lottery System. This standard is applicable to the test institutions and testers of the lottery random number sequence test of China Welfare Lottery System.
2 Normative reference documents
The clauses in the following documents become the clauses of this specification through reference in this specification. For any referenced document with a date, all subsequent amendments (excluding errata) or revisions are not applicable to this specification. However, it is recommended that parties using this specification explore the possibility of using its latest version. For any referenced document without a date, its latest version is applicable to this specification
M/T079-2017 China Welfare Lottery System Software Test Specification
M/T0005-2012 Randomness Detection Specification
3 Terms and Definitions
Lottery random number sequencelottery random number sequence
The binary random number sequence used in the China Welfare Lottery system. The natural numbers that make up the sequence are composed of 0 and 1, arranged in a row. 3.2
Randomness of lottery random number sequence
The randomness of lottery random number sequence means that it is unpredictable, uniform and measurable.
3
Unpredictability
No matter how many digits the lottery random number sequence has, no matter what the generated digits are, the next generated digit should be unpredictable, and the seed cannot be deduced using the generated digits.
Uniformity
The probability of 0 or 1 appearing in any digit of the lottery random number sequence is equal, both 1/2
3.5
Scalability
The test passed on the lottery random number sequence should be verified in the same way in the subsequence of the sequence
This standard specifies the test method, test process and determination of the randomness of the lottery random number sequence of the China Welfare Lottery System.
This standard is applicable to the test institutions and testers of the lottery random number sequence test of the China Welfare Lottery System.
This standard was drafted in accordance with the rules given in GB/T 1.1-2009.
This standard is proposed by China Welfare Lottery Issuing and Management Center.
This standard is managed by the Department of Social Welfare and Charity Promotion of the Ministry of Civil Affairs.
The drafting unit of this standard: China Welfare Lottery Issuing and Management Center.
The main drafters of this standard: Wang Suying, Li Yanbing, Zhang Tong, Zhu Zhixin, Ge Weizhou, He Tianqiong, Zhang Jitao, Han Yi, Cheng Lianghui, Fang Jie, Fu Xiaobing, Li Yinghua, Du Liting. The clauses in the following documents become the clauses of this specification through reference in this specification. For all dated referenced documents, all subsequent amendments (excluding errata) or revised versions are not applicable to this specification, but it is recommended that all parties using this specification explore the possibility of using its latest version. For all undated referenced documents, the latest version is applicable to this specification.
MZ/T 079-2017 China Welfare Lottery System Software Test Specification
GM/T 0005-2012 Randomness Detection Specification
Some standard content:
ICS35.240 People's Republic of China Civil Affairs Industry Standard MZ/T093—2017 Specification for welfare-lottery system lottery-random-number-tes Industry Standard Information Service Platform 2017-10-18 Release Ministry of Civil Affairs of the People's Republic of China 2017-10-18 Implementation Industry Standard Information Service Platform This standard is drafted in accordance with the rules given in GB/T1.1-2009. This standard is proposed by the China Welfare Lottery Issuing and Management Center. This standard is managed by the Department of Social Welfare and Charity Promotion of the Ministry of Civil Affairs. This standard is drafted by: China Welfare Lottery Issuing and Management Center. MZ/T0932017 The main drafters of this standard: Wang Suying, Li Yanbing, Zhang Tong, Zhu Zhixin, Ge Weizhou, He Tianqiong, Zhang Jitao, Han Yi, Cheng Lianghui, Fang Jie, Fu Xiaobing, Li Yinghua, Du Liting. Industry Standard Information Service Platform Industry Standard Information Service Platform 1 Scope China Welfare Lottery System Lottery Random Number Test Specification MZ/T093—2017 This standard specifies the test method, test process and test result determination of the randomness of the lottery random number sequence of the China Welfare Lottery System. This standard is applicable to the test institutions and testers of the lottery random number sequence test of the China Welfare Lottery System. 2 Normative Reference Documents The clauses in the following documents become the clauses of this specification through reference in this specification. All subsequent amendments (excluding errata) or revisions of dated references are not applicable to this specification, but it is recommended that all parties using this specification explore the possibility of using the latest version. For undated references, the latest version applies to this specification MZ/T079-2017 China Welfare Lottery System Software Test Specification GM/T0005-2012 Randomness Detection Specification 3 Terms and Definitions Lottery Random Number Sequence lotteryrandomnumbersequence The binary random number sequence used in the China Welfare Lottery system. The natural numbers that make up the sequence are composed of 0 and 1 and are arranged continuously. Lottery Random Number Sequence Randomness/trandamnessoflotteryrandomnumbersequence The randomness of the lottery random number sequence represents true unpredictability, uniformity, and measurability. 3.3 Unpredictability At the same time, the seed cannot be deduced using the numbers that have been generated. 3.4 Uniformity The probability of 0 or 1 appearing in any position of the lottery random number sequence is equal, both are 1/2. 3.5 Scalability The test passed on the lottery random number sequence should be verified in the same way in the subsequence of the sequence. 1 Block A continuous section of binary numbers starting from a certain position in the lottery random number sequence. Runs MZ/T0932017 A sequence of continuous bits with the same value, where the bits before and after the run have different values or no content. Template A binary number sequence of a certain length established according to certain rules. Linear feedback shift register, LFSR is a set of fixed-length digital sequences, in which each digit is generated by right-shifting or left-shifting the left or right digit of the digit, and the first or last digit is cyclically entered into the last or first digit. 3.10 Significance level significance level The probability of incorrectly judging a random sequence as a non-random sequence in a randomness test. 4 Collection of randomness test methods for lottery random number sequences 4.1 Overview The randomness test methods for lottery random number sequences include proportion test, block proportion test, total run test, run distribution test, longest run test in a block, binary matrix test, discrete Fourier transform test, poker test, overlapping template matching test, general statistical test, linear complexity test, cumulative sum test, binary derivation test and autocorrelation test, a total of fifteen test methods 4.2 Proportion test Test the number and proportion of 0 and 1 in a lottery random number sequence. The purpose of the test is to determine that the proportion of the number of times each number appears in the tested random number sequence should be close to 1/2. The test method is to convert 0 and 1 of the tested random number sequence into -1 and respectively, calculate the results and compare them with the significance level. 4.3 Block Proportion Test Test the proportion of the number of times 0 and 1 appear in each block of the lottery random number sequence. The purpose of the test is to determine that the proportion of the number of times 0 and 1 appear in the subsequence of the tested random number sequence should be close to 1/2. The test method is to divide the tested random number sequence into multiple non-overlapping subsequences, count the proportion of 1 in each subsequence, calculate the results and compare them with the significance level. 4.4 Total Runs Test Test whether the total number of runs in the lottery random number sequence complies with the randomness requirements. 2 MZ/T093-2017 The test method is to count the total number of runs in the tested random number sequence, count the proportion of the number of times 1 appears in the digital sequence, calculate the results and compare them with the significance level. 4.5 Run distribution test Test the number of occurrences of each run in the lottery random number sequence. The purpose of the test is to determine the degree to which the total number of runs of different lengths in the tested random number sequence conforms to the expected value of the random sequence. The test method is to count the length of each run in the tested random number sequence, record the number of runs, calculate the result and compare it with the significance level. 4.6 Longest run in block test Test the longest run of "1" in the M-bit area block in the lottery random number sequence. The purpose of the test is to determine the degree to which the length of the longest run of "1" in the tested random number sequence conforms to the expected value of the length of the longest run of "1" expected in a random sequence. The test method is to divide the tested random number sequence into multiple subsequences, count the length of the largest "1" run in each subsequence, calculate the result and compare it with the significance level. 4.7 Binary matrix test Test the rank of the submatrix of the lottery random number sequence. The purpose of the test is to determine the linear correlation of fixed-length substrings of the original sequence in the tested random number sequence. The test method is to divide the tested random number sequence into subsequences, form each subsequence into a matrix, count the rank of each matrix, calculate the result and compare it with the significance level. 4.8 Discrete Fourier Transform Test Test the peak value of the discrete Fourier transform of the lottery random number sequence. The purpose of the test is to determine the degree to which the periodic characteristics (i.e., adjacent repeated patterns) in the tested random number sequence are consistent with the characteristics of the expected random number sequence. The test method is to convert the 0 and 1 of the tested random number sequence into -1 and 1 respectively, perform Fourier transform on the obtained new sequence, calculate the result and compare it with the significance level. 4.9 Poker Test Test the number of times a predetermined target template appears in the lottery random number sequence. The purpose of the test is to determine the degree to which the situation in which the specified non-periodic templates can appear multiple times in the tested random number sequence is consistent with the characteristic values of the expected random number sequence. The test should search for the specified m-bit template in the digital sequence. If such a template is not found, the search will continue by moving down one bit; if such a template is found, the search will continue from the bit after the template is found. The test method is to divide the random digital sequence to be tested into multiple non-overlapping columns, count the frequency of occurrence of subsequence templates, calculate the results and compare them with the significance level. 4.10 Overlapping template matching test Test the number of times a pre-specified target template appears in a lottery random number sequence. The purpose of the test is to determine the extent to which the situation in which a specified non-periodic template can appear multiple times in the tested random number sequence is consistent with the characteristic value of the expected random number sequence. In the test, the specified m-bit template should be searched in the digital sequence. If such a template is not found, the search will be continued by moving down one bit; if such a template is found, the search will be continued by moving down one bit. The test method is to add some bits of data at the beginning of the tested random number sequence to the end of the sequence to obtain a new sequence, count the frequency of occurrence of each seed sequence template, calculate the results and compare them with the significance level. 3 4.11 General statistical test MZ/T093-2017 Test the number of bits between matching templates in a lottery random number sequence (this is a measure related to the length of the compressed sequence). The purpose of the test is to determine the extent to which the tested random number sequence can be compressed without information loss. The test method is to divide the tested random number sequence into an initial sequence and a test sequence, create a table for the initial sequence, count the values of the elements in the table, calculate the results and compare them with the significance level. 4.12 Linear complexity test Test the length of LFSR in the lottery random number sequence. The purpose of the test is to judge the randomness of the tested random number sequence based on its complexity. A good random sequence has a longer LFSR, and a shorter LFSR indicates non-randomness. The test method is to divide the tested random number sequence into multiple non-overlapping subsequences, count the linear complexity of each subsequence, calculate the results and compare them with the significance level. 4.13 Approximation test Test the probability of all possible overlapping m-bit templates of the entire sequence in the lottery random number sequence. The purpose of the test is to compare the probability of two consecutive adjacent overlapping data blocks of length (m and m+1) in the tested random mathematical word sequence with the expected result to determine the degree of conformity with the expected random number sequence characteristic value. The test method is to add some bit data at the beginning of the random number sequence to the end of the sequence to obtain a new sequence, count the occurrence frequency of all 2m m-bit subsequence patterns in the new sequence, calculate the results and compare them with the significance level. 4.14 Cumulative sum test Test the random run distance within the maximum range obtained by cumulatively summing the adjusted (-1, +1) numbers in the sequence in the lottery random number sequence. The purpose of the test is to determine the degree of consistency of the cumulative sum of a part of the sequence in the tested random number sequence relative to the cumulative sum of a part of the sequence in the expected random sequence. The test method is to convert the 0 and 1 of the tested random number sequence to -1 and 1 respectively, count the sum, calculate the results and compare them with the significance level. 4.15 Binary derivation test Test a new sequence generated by binary derivation in the lottery random number sequence, which is the result obtained by XORing the adjacent two bits of 0 or 1 in the initial sequence in sequence. The purpose of the binary derivation test is to determine whether the number of 0 and 1 in the k-th binary derivation sequence is close to the same. The test method is to perform XOR operation on the adjacent two 0 or 1 in the initial sequence to obtain a new sequence, and repeat the operation to convert 0 and 1 in the new sequence into -1 and 1 respectively, and then add the sums, calculate the results and compare them with the significance level. 4.16 Autocorrelation test Test the correlation between the lottery random number sequence and the new sequence obtained by logically shifting it to the left by d positions. The test method is to perform statistics on the random number sequence to be tested, calculate the results and compare them with the significance level. 5 The process of randomness test of lottery random number sequence 5.1 Sample preparation The test sample is a binary random number sequence used in the China Welfare Lottery system, and it is advisable to use binary files for collection and storage. The file name is named in the combination of the collection date and time. 4 5.2 Plan MZ/T093—2017 Before the test, a test plan should be formulated and reviewed. The requirements for planning and review shall comply with the requirements for test planning in MZ/T079-2017 "China Welfare Lottery System Software Test Specification". 5.3 Design The design of the test shall be carried out and the design shall be reviewed. The requirements for design and review shall comply with the requirements for test design in MZ/T079-2017 "China Welfare Lottery System Software Test Specification". 5.4 Execution Use all the methods listed in Chapter 4 to test the lottery random number sequence sample according to the test design. The requirements for test execution shall comply with the requirements for test execution in MZ/T079-2017 "China Welfare Lottery System Software Test Specification". The calculation method of the test results shall comply with the requirements of GM/T0005-2012 "Randomness Test Specification". 5.5 Summary After the test is completed, the test shall be summarized and the summary shall be reviewed. The requirements for summary and review shall comply with the requirements for test summary in MZ/T079-2017 "China Welfare Lottery System Software Test Specification". Determination of the randomness of lottery random number sequences 5 For each randomness test method in Chapter 4 of this standard, if the calculated result of a sample is not less than the significance level, it means that the sample passes the test of this method. s(1-a-3 If the sample size is s and the significance level is , the number of samples that pass the test should not be less than a(1-a) The significance level should be between [0.001, 0.01]. Industry Standard Information Service Platform If the number of samples that pass the test is not less than the above value, the lottery random number sequence passes the test of this method; otherwise, it fails the test of this method. References MZ/T0932017 [1]NIST SP800-22 revl, A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications Industry Standard Information Service Platform15 Binary derivation test Tests a new sequence generated by binary derivation in the lottery random number sequence, which is obtained by performing XOR operations on adjacent two bits of 0 or 1 in the initial sequence in sequence. The purpose of the binary derivation test is to determine whether the number of 0 and 1 in the k-th binary derivation sequence is close to the same. The test method is to perform XOR operations on adjacent two bits of 0 or 1 in the initial sequence in sequence to obtain a new sequence, and repeat the operation to convert 0 and 1 in the new sequence into -1 and 1 respectively, and then accumulate the results, calculate the results and compare them with the significance level. 4.16 Autocorrelation test Tests the degree of correlation between the lottery random number sequence and the new sequence obtained by logically shifting it to the left by d bits. The sub-test method is to perform statistics on the random number sequence under test, calculate the results and compare them with the significance level. 5 The process of randomness test of lottery random number sequence 5.1 Sample preparation The test sample is a binary random number sequence used in the China Welfare Lottery system, and it is advisable to use binary files for collection and storage. The file name is named in the combination of the collection date and time. 4 5.2 Planbzxz.net MZ/T093—2017 Before the test, a test plan should be formulated and the plan should be reviewed. The requirements for planning and review should comply with the requirements for test plans in MZ/T079-2017 "China Welfare Lottery System Software Test Specification". 5.3 Design The design of the test should be carried out and the design should be reviewed. The requirements for design and review should comply with the requirements for test design in MZ/T079-2017 "China Welfare Lottery System Software Test Specification". 5.4 Execution Use all the methods listed in Chapter 4 to test the lottery random number sequence samples according to the test design. The requirements for executing the test should comply with the requirements for test execution in MZ/T079-2017 "China Welfare Lottery System Software Test Specification". The calculation method of the test results should comply with the requirements of GM/T0005-2012 "Randomness Detection Specification". 5.5 Summary After the test is completed, the test should be summarized and reviewed. The requirements for summary and review should comply with the requirements for test summary in MZ/T079-2017 "China Welfare Lottery System Software Test Specification". Determination of randomness of lottery random number sequence 5 For each randomness test method in Chapter 4 of this standard, if the calculation result of a sample is not less than the significance level, it means that the sample passes the test of this method. s(1-a-3 If the sample size is s and the significance level is , the number of samples that pass the test should not be less than a(1-a) The significance level should be between [0.001, 0.01]. Industry Standard Information Service Platform If the number of samples that pass the test is not less than the above value, the lottery random number sequence passes the test of this method; otherwise, it fails the test of this method. References MZ/T0932017 [1]NIST SP800-22 revl, A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications Industry Standard Information Service Platform15 Binary derivation test Tests a new sequence generated by binary derivation in the lottery random number sequence, which is obtained by performing XOR operations on adjacent two 0s or 1s in the initial sequence in sequence. The purpose of the binary derivation test is to determine whether the number of 0s and 1s in the kth binary derivation sequence is close to the same. The test method is to perform XOR operations on adjacent two 0s or 1s in the initial sequence in sequence to obtain a new sequence, and repeat the operation to convert 0s and 1s in the new sequence into -1s and 1s respectively, and then add the sums, calculate the results and compare them with the significance level. 4.16 Autocorrelation test Tests the degree of correlation between the lottery random number sequence and the new sequence obtained by logically shifting it to the left by d positions. The sub-test method is to perform statistics on the random number sequence under test, calculate the results and compare them with the significance level. 5 The process of randomness test of lottery random number sequence 5.1 Sample preparation The test sample is a binary random number sequence used in the China Welfare Lottery system, and it is advisable to use binary files for collection and storage. The file name is named in the combination of the collection date and time. 4 5.2 Plan MZ/T093—2017 Before the test, a test plan should be formulated and the plan should be reviewed. The requirements for planning and review should comply with the requirements for test plans in MZ/T079-2017 "China Welfare Lottery System Software Test Specification". 5.3 Design The design of the test should be carried out and the design should be reviewed. The requirements for design and review should comply with the requirements for test design in MZ/T079-2017 "China Welfare Lottery System Software Test Specification". 5.4 Execution Use all the methods listed in Chapter 4 to test the lottery random number sequence samples according to the test design. The requirements for executing the test should comply with the requirements for test execution in MZ/T079-2017 "China Welfare Lottery System Software Test Specification". The calculation method of the test results should comply with the requirements of GM/T0005-2012 "Randomness Detection Specification". 5.5 Summary After the test is completed, the test should be summarized and reviewed. The requirements for summary and review should comply with the requirements for test summary in MZ/T079-2017 "China Welfare Lottery System Software Test Specification". Determination of randomness of lottery random number sequence 5 For each randomness test method in Chapter 4 of this standard, if the calculation result of a sample is not less than the significance level, it means that the sample passes the test of this method. s(1-a-3 If the sample size is s and the significance level is , the number of samples that pass the test should not be less than a(1-a) The significance level should be between [0.001, 0.01]. Industry Standard Information Service Platform If the number of samples that pass the test is not less than the above value, the lottery random number sequence passes the test of this method; otherwise, it fails the test of this method. References MZ/T0932017 [1]NIST SP800-22 revl, A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications Industry Standard Information Service Platform Tip: This standard content only shows part of the intercepted content of the complete standard. If you need the complete standard, please go to the top to download the complete standard document for free.