29 lines
623 B
Go
29 lines
623 B
Go
package ctrrng
|
|
|
|
import (
|
|
_ "crypto/sha256"
|
|
)
|
|
|
|
// func TestSm4CtrDrng(t *testing.T) {
|
|
// rnd := make([]byte, 1280)
|
|
// _, _ = Reader.Read(rnd)
|
|
// fmt.Printf("%x\n", rnd)
|
|
// }
|
|
|
|
// func TestSm4DrngRandomness(t *testing.T) {
|
|
// // 测试Sm4Drng的随机性测试通过率
|
|
// total := 10
|
|
// pass := 0
|
|
// for i := 0; i < total; i++ {
|
|
// fmt.Println("======================================", i)
|
|
// if statistics.SampleSelfTests(Reader) {
|
|
// fmt.Printf("%d-th test: [O]\n", i)
|
|
// pass += 1
|
|
// } else {
|
|
// fmt.Printf("%d-th test: [X]\n", i)
|
|
// }
|
|
// }
|
|
|
|
// fmt.Printf("Pass Rate: %d/%d\n", pass, total)
|
|
// }
|