Skip to content

Commit

Permalink
根据GMT005更新了10^6数据组检测工具的相关检测参数
Browse files Browse the repository at this point in the history
  • Loading branch information
Trisia committed Oct 28, 2022
1 parent a041a54 commit 6736c66
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 62 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ func main() {

各算法检测参数如下:

序号 | 检测项目 | 参数 |
--- | --- | --- |
1 | 单比特频数检测 | - |
2 | 块内频数检测 | m = 100 |
3 | 扑克检测 | m = 8 |
4 | 重叠子序列检测 | m = 5 |
5 | 游程总数检测 | - |
6 | 游程分布检测 | - |
7 | 块内最大游程检测 | m = 10000 |
8 | 二元推导检测 | k = 7 |
9 | 自相关检测 | d = 16 |
10 | 矩阵秩检测 | M = 32, Q= 32 |
11 | 累加和检测 | - |
12 | 近似熵检测 | m = 5 |
13 | 线型复杂度检测 | m = 500 |
14 | Maurer通用统计检测 | - |
15 | 离散傅里叶检测 | - |
序号 | 检测项目 | 参数 |
--- | --- |--------------|
1 | 单比特频数检测 | - |
2 | 块内频数检测 | m = 10000 |
3 | 扑克检测 | m = 4,8 |
4 | 重叠子序列检测 | m = 3,5 |
5 | 游程总数检测 | - |
6 | 游程分布检测 | - |
7 | 块内最大游程检测 | m = 10000 |
8 | 二元推导检测 | k = 3,7 |
9 | 自相关检测 | d = 1,2,8,16 |
10 | 矩阵秩检测 | - |
11 | 累加和检测 | - |
12 | 近似熵检测 | m = 2,5 |
13 | 线型复杂度检测 | m = 500,1000 |
14 | Maurer通用统计检测 | L=7,Q=1280 |
15 | 离散傅里叶检测 | - |


## 工具
Expand Down
17 changes: 10 additions & 7 deletions overlapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ func OverlappingTemplateMatching(data []byte) *TestResult {
// OverlappingTemplateMatchingTest 重叠子序列检测方法,m=5
// bits: 检测序列
// return:
// p1: P-value1
// p2: P-value2
//
// p1: P-value1
// p2: P-value2
func OverlappingTemplateMatchingTest(bits []bool) (p1 float64, p2 float64, q1 float64, q2 float64) {
return OverlappingTemplateMatchingProto(bits, 5)
}
Expand All @@ -38,18 +39,20 @@ func OverlappingTemplateMatchingTest(bits []bool) (p1 float64, p2 float64, q1 fl
// data: 检测序列
// m: m长度,m=2,5
// return:
// p1: P-value1
// p2: P-value2
//
// p1: P-value1
// p2: P-value2
func OverlappingTemplateMatchingTestBytes(data []byte, m int) (p1 float64, p2 float64, q1 float64, q2 float64) {
return OverlappingTemplateMatchingProto(B2bitArr(data), m)
}

// OverlappingTemplateMatchingProto 重叠子序列检测方法
// bits: 检测序列
// m: m长度,m=2,5
// m: m长度,m=3,5
// return:
// p1: P-value1
// p2: P-value2
//
// p1: P-value1
// p2: P-value2
func OverlappingTemplateMatchingProto(bits []bool, m int) (p1 float64, p2 float64, q1 float64, q2 float64) {
n := len(bits)
if n < 5 {
Expand Down
39 changes: 19 additions & 20 deletions tools/rddetector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,22 @@ rddetector -i 待检测数据目录 [-o 生成报告位置]
```

15中检测方法的监测参数如下:

序号 | 检测项目 | 参数 |
--- | --- | --- |
1 | 单比特频数检测 | - |
2 | 块内频数检测 | m = 100 |
3 | 扑克检测 | m = 8 |
4 | 重叠子序列检测 | m = 5 |
5 | 游程总数检测 | - |
6 | 游程分布检测 | - |
7 | 块内最大游程检测 | m = 10000 |
8 | 二元推导检测 | k = 7 |
9 | 自相关检测 | d = 16 |
10 | 矩阵秩检测 | M = 32, Q= 32 |
11 | 累加和检测 | - |
12 | 近似熵检测 | m = 5 |
13 | 线型复杂度检测 | m = 500 |
14 | 通用统计检测 | - |
15 | 离散傅里叶检测 | - |

15种检测方法的检测参数如下:

序号 | 检测项目 | 参数 |
--- | --- |--------------|
1 | 单比特频数检测 | - |
2 | 块内频数检测 | m = 10000 |
3 | 扑克检测 | m = 4,8 |
4 | 重叠子序列检测 | m = 3,5 |
5 | 游程总数检测 | - |
6 | 游程分布检测 | - |
7 | 块内最大游程检测 | m = 10000 |
8 | 二元推导检测 | k = 3,7 |
9 | 自相关检测 | d = 1,2,8,16 |
10 | 矩阵秩检测 | - |
11 | 累加和检测 | - |
12 | 近似熵检测 | m = 2,5 |
13 | 线型复杂度检测 | m = 500,1000 |
14 | Maurer通用统计检测 | L=7,Q=1280 |
15 | 离散傅里叶检测 | - |
39 changes: 21 additions & 18 deletions tools/rddetector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func worker(jobs <-chan string, out chan<- *R) {
p, _ = randomness.PokerProto(bits, 8)
arr = append(arr, p)

p1, p2, _, _ := randomness.OverlappingTemplateMatchingProto(bits, 2)
p1, p2, _, _ := randomness.OverlappingTemplateMatchingProto(bits, 3)
arr = append(arr, p1, p2)
p1, p2, _, _ = randomness.OverlappingTemplateMatchingProto(bits, 5)
arr = append(arr, p1, p2)
Expand Down Expand Up @@ -71,7 +71,9 @@ func worker(jobs <-chan string, out chan<- *R) {
arr = append(arr, p)
p, _ = randomness.ApproximateEntropyProto(bits, 5)
arr = append(arr, p)
p, _ = randomness.LinearComplexityTest(bits)
p, _ = randomness.LinearComplexityProto(bits, 500)
arr = append(arr, p)
p, _ = randomness.LinearComplexityProto(bits, 1000)
arr = append(arr, p)
p, _ = randomness.MaurerUniversalTest(bits)
arr = append(arr, p)
Expand Down Expand Up @@ -144,26 +146,27 @@ func main() {
_, _ = w.WriteString(
"源数据," +
"单比特频数检测," +
"块内频数检测," +
"扑克检测m=4," +
"扑克检测m=8," +
"重叠子序列检测m=2 P1,重叠子序列检测m=2 P2," +
"重叠子序列检测m=5 P1,重叠子序列检测m=5 P2," +
"块内频数检测 m=10000," +
"扑克检测 m=4," +
"扑克检测 m=8," +
"重叠子序列检测 m=3 P1,重叠子序列检测 m=2 P2," +
"重叠子序列检测 m=5 P1,重叠子序列检测 m=5 P2," +
"游程总数检测," +
"游程分布检测," +
"块内最大”1“游程检测," +
"二元推导检测k=3," +
"二元推导检测k=7," +
"自相关检测d=1," +
"自相关检测d=2," +
"自相关检测d=8," +
"自相关检测d=16," +
"块内最大游程检测 m=10000," +
"二元推导检测 k=3," +
"二元推导检测 k=7," +
"自相关检测 d=1," +
"自相关检测 d=2," +
"自相关检测 d=8," +
"自相关检测 d=16," +
"矩阵秩检测," +
"累加和检测," +
"近似熵检测m=2," +
"近似熵检测m=5," +
"线性复杂度检测," +
"Maurer通用统计检测," +
"近似熵检测 m=2," +
"近似熵检测 m=5," +
"线性复杂度检测 m=500," +
"线性复杂度检测 m=1000," +
"Maurer通用统计检测 L=7 Q=1280," +
"离散傅里叶检测\n")
var wg sync.WaitGroup
var cnt = make([]int32, 25)
Expand Down

0 comments on commit 6736c66

Please sign in to comment.