GM/T 0005-2021 PDF EnglishUS$485.00 · In stock · Download in 9 seconds
GM/T 0005-2021: Randomness test specification Delivery: 9 seconds. True-PDF full-copy in English & invoice will be downloaded + auto-delivered via email. See step-by-step procedure Status: Valid GM/T 0005: Historical versions
Similar standardsGM/T 0005-2021: Randomness test specification---This is an excerpt. Full copy of true-PDF in English version (including equations, symbols, images, flow-chart, tables, and figures etc.), auto-downloaded/delivered in 9 seconds, can be purchased online: https://www.ChineseStandard.net/PDF.aspx/GMT0005-2021CRYPTOGRAPHIC INDUSTRY STANDARD ICS 35.030 CCS L 80 Replacing GM/T 0005-2012 Randomness test specification Issued on. OCTOBER 18, 2021 Implemented on. MAY 01, 2022 Issued by. State Cryptography Administration Table of ContentsForeword... 3 1 Scope... 5 2 Normative references... 5 3 Terms and definitions... 5 4 Symbols... 6 5 Randomness test method... 8 5.1 Single-bit frequency test method... 8 5.2 In-block frequency test method... 8 5.3 Poker test method... 9 5.4 Overlapping subsequence test method... 10 5.5 Test method for total number of runs... 11 5.6 Test method for run distribution... 12 5.7 Test method for in-block maximum run... 13 5.8 Binary derivation test method... 14 5.9 Autocorrelation test method... 15 5.10 Matrix rank test method... 16 5.11 Test method for cumulative sum... 17 5.12 Approximate entropy test method... 18 5.13 Linear complexity test method... 19 5.14 Test method for Maurer general statistics... 20 5.15 Discrete Fourier test method... 22 6 Determination of randomness test... 23 6.1 Overview... 23 6.2 Determination of sample passing rate... 23 6.3 Determination of sample distribution uniformity... 23 6.4 Determination of randomness test results... 24 Annex A (normative) Sample length and test setting... 25 Annex B (informative) Principle of randomness test... 27 Annex C (informative) Examples of randomness test results... 381 ScopeThis document specifies the randomness test indicators and test methods applicable to binary sequence.2 Normative referencesThere are no normative references in this document.3 Terms and definitionsFor the purposes of this document, the following terms and definitions apply. 3.1 binary sequence A bit string consisting of "0" and "1". 3.2 randomness hypothesis When testing the randomness of a binary sequence, it is first assumed that the sequence is random. This hypothesis is called the null hypothesis or the null hypothesis, denoted as H0.The hypothesis contrary to the null hypothesis, that is, the sequence is not random, is called the alternative hypothesis, denoted as Hα. 3.3 randomness test A function or procedure for binary sequence test. It can be used to judge whether to accept the randomness null hypothesis. 3.4 significance level The probability of incorrectly judging random sequences as non-random sequences in randomness test. 3.5 sample Binary sequences for randomness test. 3.6 sample group A collection of multiple samples. 3.7 sample length The number of bits in the sample. 3.8 sample size The number of samples in the sample group. 3.9 test parameter Parameters that need to be set for randomness test.4 SymbolsThe following symbols apply to this document. d. The number of bits for the logical left shift of the sequence in autocorrelation test. H0.Original hypothesis (null hypothesis). Hα. Alternative hypothesis. K. The number of L-bit subsequences of the sequence to be tested in the general statistical test. L. General statistical neutron sequence length. Li. The linear complexity of subsequence in the linear complexity test. M. The number of rows of the matrix in the matrix rank test. m. The bit length of the subsequence. N. The number of m-bit subsequences in an n-bit sequence to be tested. n. The bit length of the binary sequence to be tested. Q. The number of columns of the matrix in the matrix rank test, or the number of L-bit subsequences of the initial sequence in the general statistical test. V. Statistical value. Xi. 2εi-1. max. Take the maximum value from several elements. min. Take the minimum value from several elements. Φ(x). Cumulative distribution function of standard normal distribution. P_value. A metric to measure the randomness of a sample, which is used to determine the passing rate of the sample. Q_value. A metric to measure the randomness of samples, which is used to determine the uniformity of sample distribution. erfc. Complementary Error Function. igamc. Incomplete Gamma Function. Vn(obs). The total number of runs in the binary sequence to be tested. ApEn(m). Approximate entropy of the binary sequence to be tested. modulus(x). The operation used to calculate the modulus value of the complex coefficient x. . The first statistic in overlapping subsequence test. . The second statistic in overlapping subsequence test.5 Randomness test method5.1 Single-bit frequency test method 5.1.1 Overview Single-bit frequency test is the most basic test. It is used to test whether the number of 0s and 1s in a binary sequence is similar. 5.1.2 Test steps The single-bit frequency test steps are as follows. Step 1.the test converts 0 and 1 in the sequence ε to be tested into -1 and 1, respectively, 5.1.3 Result determination Compare the result of P_value calculated in 5.1.2 with α. If P_value≥α, it is considered that the sequence to be tested passes the single-bit frequency test, otherwise it fails the single-bit frequency test. 5.2 In-block frequency test method 5.2.1 Overview In-block frequency test is used to test whether the number of 1s in the m-bit subsequence of the sequence to be tested is close to. For a random sequence, the number of 1s in the m-bit subsequence of any length shall be close to. 5.2.2 Test steps The in-block frequency test steps are as follows. Step 1.Divide the sequence to be tested ε into non-overlapping subsequences of which the length is m. Discard the excess bits. 5.2.3 Result determination Compare the result of P_value calculated in 5.2.2 with α. If P_value≥α, it is considered that the sequence to be tested passes the in-block frequency test, otherwise it fails the in-block frequency test. 5.3 Poker test method 5.3.1 Overview Poker test is used to test whether the number of 2m type subsequences of which its length is m is close. For random sequences, the number of 2m type subsequences shall be close. 5.3.2 Test steps The poker test steps are as follows. 5.3.3 Result determination Compare the result of P_value calculated in 5.3.2 with α. If P_value≥α, it is considered that the sequence to be tested passes the poker test, otherwise it fails the poker test. 5.4 Overlapping subsequence test method 5.4.1 Overview For any positive integer m, there are 2m types of binary sequences of length m. The overlapping subsequence test divides a sequence of length n to be tested into n superimposable m-bit subsequences. For a random binary sequence, because of its uniformity, the probability of each type of mode of m-bit superimposable subsequences shall be close. 5.4.2 Test steps The overlapping subsequence test steps are as follows. Step 1.Construct a new sequence ε' from the sequence ε to be tested. The construction method is as follows. Add the m -1 bits of data at the beginning of the sequence ε to the end of the sequence ε to get a new sequence ε'. 5.4.3 Result determination Compare the two results P_value1 and P_value2 calculated in 5.4.2 with α, respectively. If P_value1≥α, the sequence to be tested is considered to pass the overlapping subsequence test of P_value1, otherwise it fails to pass the overlapping subsequence test of P_value1. 5.5 Test method for total number of runs 5.5.1 Overview A run is a subsequence consisting of consecutive "0" or "1" in the sequence. The preceding and succeeding elements of the subsequence are different from their own elements. The test of the total number of runs mainly tests whether the total number of runs in the sequence to be tested obeys the requirement of randomness. 5.5.2 Test steps The steps to test the total number of runs are as follows. Step 1.For the sequence to be tested ε1ε2...εn of length n, calculate. Of which, when εi = εi+1, r(i)=0; otherwise, r(i)=1. 5.5.3 Result determination Compare the P_value result calculated in 5.5.2 with α. If P_value≥α, it is considered that the sequence to be tested passes the teste of total number of runs, otherwise it fails the test of total number of runs. 5.6 Test method for run distribution 5.6.1 Overview Run distribution test is used to test whether the distribution of runs of the same length in a sequence is uniform. In a random sequence, the number of runs of the same length shall be close to the same. The number of runs shall be close to half every time the run length increases by one bit. 5.7 Test method for in-block maximum run 5.7.1 Overview The test method for in-block maximum run tests two modes of the in-block maximum run of "1" and the in-block maximum run of "0", respectively. Divide the sequence to be tested into N subsequences of length m. At this time n=N*m. Count the longest "1" run length and the longest "0" run length in each subsequence. According to the distribution of the maximum "1" run and the maximum "0" run in each subsequence, evaluate the randomness of the sequence to be tested. 5.8 Binary derivation test method 5.8.1 Overview The purpose of binary derivation test is to determine whether the number of 0s and 1s in the kth binary derivation sequence is close to the same. For a binary initial sequence of length n, perform XOR operation on two adjacent bits in the initial sequence in turn to obtain a sequence of binary derivations of this sequence. The length is n-1.Perform the above operations k times in sequence to obtain the k-time binary derivation sequence of the initial sequence. The length is n-k. For a random sequence, no matter how many derivations are made, the number of 0s and 1s shall be close to the same. 5.9 Autocorrelation test method 5.9.1 Overview Autocorrelation test is used to test the degree of correlation between the sequence under test and the new sequence obtained by shifting it left (logically left) by d bits. A random sequence shall be independent of a new sequence obtained by shifting it left by any number of bits. Therefore, the degree of correlation shall also be very low. 5.10 Matrix rank test method 5.10.1 Overview Matrix rank test is used to test linear independence between subsequences of a given length in the sequence to be tested. Construct a matrix from the sequence to be tested. Then test the linear independence between the rows or columns of the matrix. The offset degree of matrix rank can give an understanding of the amount of linear independence, thus affecting the evaluation of the randomness of binary sequences. 5.11 Test method for cumulative sum 5.11.1 Overview The test method for cumulative sum tests the forward cumulative sum and the backward cumulative sum, respectively. The test of the forward cumulative sum starts from the first bit of the sequence to be tested. 5.12 Approximate entropy test method 5.12.1 Overview Approximate entropy test evaluates its randomness by comparing the frequency of m- bit overlapping subsequence modes with the frequency of m+1-bit overlapping subsequence modes. Calculate the frequency difference between the m-bit overlapping subsequence mode and the m+1-bit overlapping subsequence mode. 5.12.2 Test steps The approximate entropy test steps are as follows. 5.13 Linear complexity test method 5.14 Test method for Maurer general statistics 5.14.1 Overview The Maurer general statistical test is used to test whether the sequence to be tested can be compressed losslessly. Because random sequences cannot be significantly compressed, if the sequence to be tested can be significantly compressed, the sequence is considered not random. 5.15 Discrete Fourier test method 5.15.1 Overview Discrete Fourier test uses spectral methods to test randomness in sequences. The peak height can be obtained after the Fourier transform of the sequence to be tested. According to the assumption of randomness, the peak height cannot exceed a certain threshold (related to the sequence length n), otherwise it will be classified into an abnormal range. If the number of abnormal peaks exceeds the allowable value, it can be considered that the sequence to be tested is not random. 5.15.2 Test steps The discrete Fourier test steps are as follows. 5.15.3 Result determination Compare the result of P_value calculated in 5.15.2 with α. If P_value≥α, it is considered that the sequence to be tested passes the discrete Fourier test, otherwise it fails the discrete Fourier test.6 Determination of randomness test6.1 Overview It shall use the 15 randomness test methods specified in Chapter 5 and the test settings specified in Annex A to test the randomness of the binary sequence sample group. A randomness test method corresponds to at least one randomness test item. 6.2 Determination of sample passing rate For each randomness test item, count the number of samples whose P _value is greater than or equal to α in the binary sequence sample group. The significance level determined by this document for sample passing rate test is α=0.01. 6.3 Determination of sample distribution uniformity For each randomness test item, the Q_value value of each sample in the binary sequence sample group shall be uniformly distributed in the interval [0,1]. Let the sample size bes. ......Source: Above contents are excerpted from the full-copy PDF -- translated/reviewed by: www.ChineseStandard.net / Wayne Zheng et al. Tips & Frequently Asked Questions:Question 1: How long will the true-PDF of English version of GM/T 0005-2021 be delivered?Answer: The full copy PDF of English version of GM/T 0005-2021 can be downloaded in 9 seconds, and it will also be emailed to you in 9 seconds (double mechanisms to ensure the delivery reliably), with PDF-invoice.Question 2: Can I share the purchased PDF of GM/T 0005-2021_English with my colleagues?Answer: Yes. The purchased PDF of GM/T 0005-2021_English will be deemed to be sold to your employer/organization who actually paid for it, including your colleagues and your employer's intranet.Question 3: Does the price include tax/VAT?Answer: Yes. Our tax invoice, downloaded/delivered in 9 seconds, includes all tax/VAT and complies with 100+ countries' tax regulations (tax exempted in 100+ countries) -- See Avoidance of Double Taxation Agreements (DTAs): List of DTAs signed between Singapore and 100+ countriesQuestion 4: Do you accept my currency other than USD?Answer: Yes. www.ChineseStandard.us -- GM/T 0005-2021 -- Click this link and select your country/currency to pay, the exact amount in your currency will be printed on the invoice. Full PDF will also be downloaded/emailed in 9 seconds.Question 5: Should I purchase the latest version GM/T 0005-2021?Answer: Yes. Unless special scenarios such as technical constraints or academic study, you should always prioritize to purchase the latest version GM/T 0005-2021 even if the enforcement date is in future. Complying with the latest version means that, by default, it also complies with all the earlier versions, technically.How to buy and download a true PDF of English version of GM/T 0005-2021?A step-by-step guide to download PDF of GM/T 0005-2021_EnglishStep 1: Visit website https://www.ChineseStandard.net (Pay in USD), or https://www.ChineseStandard.us (Pay in any currencies such as Euro, KRW, JPY, AUD).Step 2: Search keyword "GM/T 0005-2021". Step 3: Click "Add to Cart". If multiple PDFs are required, repeat steps 2 and 3 to add up to 12 PDFs to cart. Step 4: Select payment option (Via payment agents Stripe or PayPal). Step 5: Customize Tax Invoice -- Fill up your email etc. Step 6: Click "Checkout". Step 7: Make payment by credit card, PayPal, Google Pay etc. After the payment is completed and in 9 seconds, you will receive 2 emails attached with the purchased PDFs and PDF-invoice, respectively. Step 8: Optional -- Go to download PDF. Step 9: Optional -- Click Open/Download PDF to download PDFs and invoice. See screenshots for above steps: Steps 1~3 Steps 4~6 Step 7 Step 8 Step 9 |