PayPal, credit cards. Download editable-PDF and invoice in 1 second!
GM/T 0005-2021 English PDF (GMT0005-2021)
GM/T 0005-2021 English PDF (GMT0005-2021)
Precio habitual
$485.00 USD
Precio habitual
Precio de oferta
$485.00 USD
Precio unitario
/
por
Los gastos de envío se calculan en la pantalla de pago.
No se pudo cargar la disponibilidad de retiro
Delivery: 3 seconds. Download true-PDF + Invoice.
Get QUOTATION in 1-minute: Click GM/T 0005-2021
Historical versions: GM/T 0005-2021
Preview True-PDF (Reload/Scroll if blank)
GM/T 0005-2021: Randomness test specification
GM/T 0005-2021
CRYPTOGRAPHIC INDUSTRY STANDARD
OF THE PEOPLE’S REPUBLIC OF CHINA
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 Contents
Foreword ... 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 ... 38
Randomness test specification
1 Scope
This document specifies the randomness test indicators and test methods applicable to
binary sequence.
2 Normative references
There are no normative references in this document.
3 Terms and definitions
For the purposes of this document, the following terms and definitions apply.
3.1 binary sequence
A bit string consisting of "0" and "1".
NOTE: Unless otherwise specified, the sequences referred to in this document are all binary
sequences.
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 Symbols
The 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.
α: Significance level for sample passing rate test.
αT: Significance level used for sample distribution uniformity test.
ε: Binary sequence to be tested.
ε': A new sequence generated according to certain rules on the basis of ε.
π: The proportion of 1 in the binary sequence to be tested.
Σ: Summation symbol.
*: Multiplication, sometimes omitted.
ln(x): The natural logarithm of x.
log2(x): The base 2 logarithm of x.
: The largest integer not greater than x.
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.
Step 5: Calculate .
Test settings are as required in Annex A. See B.11 for the test principle.
5.11.3 Result determination
Compare the result of P_value calculated in 5.11.2 with α. If P_value≥α, it is considered
that the sequence to be tested passes the test of the cumulative sum, otherwise it fails to
pass the test of the cumulative sum.
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. A small difference
value indicates that the sequence to be tested has regularity and continuity. A large
difference value indicates that the sequence to be tested has irregularity and
discontinuity. For any m, the approximate entropy of the random sequence shall be
approximately equal to ln2.
5.12.2 Test steps
The approximate entropy 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 ε'. The length of the new sequence ε' is n'=n+m-1.
Step 2: Count the frequency of occurrence of the sequence mode of m bits for all 2m in
n. Denote the frequency of occurrence of the m-bit mode i1i2…im as vi1i2…im.
Step 3: For all j (0≤j≤2m-1), calculate , of which j is the decimal value
corresponding to the m-bit mode i1i2…im.
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 test
6.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. If a
randomness test method adopts different test parameter settings (see Annex A for details)
or has different test modes (such as the in...
Get QUOTATION in 1-minute: Click GM/T 0005-2021
Historical versions: GM/T 0005-2021
Preview True-PDF (Reload/Scroll if blank)
GM/T 0005-2021: Randomness test specification
GM/T 0005-2021
CRYPTOGRAPHIC INDUSTRY STANDARD
OF THE PEOPLE’S REPUBLIC OF CHINA
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 Contents
Foreword ... 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 ... 38
Randomness test specification
1 Scope
This document specifies the randomness test indicators and test methods applicable to
binary sequence.
2 Normative references
There are no normative references in this document.
3 Terms and definitions
For the purposes of this document, the following terms and definitions apply.
3.1 binary sequence
A bit string consisting of "0" and "1".
NOTE: Unless otherwise specified, the sequences referred to in this document are all binary
sequences.
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 Symbols
The 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.
α: Significance level for sample passing rate test.
αT: Significance level used for sample distribution uniformity test.
ε: Binary sequence to be tested.
ε': A new sequence generated according to certain rules on the basis of ε.
π: The proportion of 1 in the binary sequence to be tested.
Σ: Summation symbol.
*: Multiplication, sometimes omitted.
ln(x): The natural logarithm of x.
log2(x): The base 2 logarithm of x.
: The largest integer not greater than x.
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.
Step 5: Calculate .
Test settings are as required in Annex A. See B.11 for the test principle.
5.11.3 Result determination
Compare the result of P_value calculated in 5.11.2 with α. If P_value≥α, it is considered
that the sequence to be tested passes the test of the cumulative sum, otherwise it fails to
pass the test of the cumulative sum.
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. A small difference
value indicates that the sequence to be tested has regularity and continuity. A large
difference value indicates that the sequence to be tested has irregularity and
discontinuity. For any m, the approximate entropy of the random sequence shall be
approximately equal to ln2.
5.12.2 Test steps
The approximate entropy 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 ε'. The length of the new sequence ε' is n'=n+m-1.
Step 2: Count the frequency of occurrence of the sequence mode of m bits for all 2m in
n. Denote the frequency of occurrence of the m-bit mode i1i2…im as vi1i2…im.
Step 3: For all j (0≤j≤2m-1), calculate , of which j is the decimal value
corresponding to the m-bit mode i1i2…im.
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 test
6.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. If a
randomness test method adopts different test parameter settings (see Annex A for details)
or has different test modes (such as the in...
Share







