package sm3_test import ( "testing" "xdx.jelly/xgcl/sm/sm3" ) // BenchmarkBlockGeneric 性能测试 func BenchmarkBlockGeneric(b *testing.B) { d := sm3.NewDigest() buf := make([]byte, 10*1024*1024) b.SetBytes(int64(len(buf))) b.ResetTimer() for i := 0; i < b.N; i++ { sm3.BlockGeneric(d, buf) } } // BenchmarkBlockAVX2 性能测试 func BenchmarkBlockAVX2(b *testing.B) { d := sm3.NewDigest() buf := make([]byte, 10*1024*1024) b.SetBytes(int64(len(buf))) b.ResetTimer() for i := 0; i < b.N; i++ { sm3.BlockAsmAVX2(d, buf) } }