diff options
Diffstat (limited to 'tests/benchmarks')
l--------- | tests/benchmarks/hash/main.go | 1 | ||||
-rw-r--r-- | tests/benchmarks/hash/scrypt.go | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/benchmarks/hash/main.go b/tests/benchmarks/hash/main.go new file mode 120000 index 0000000..f67563d --- /dev/null +++ b/tests/benchmarks/hash/main.go @@ -0,0 +1 @@ +../../main.go
\ No newline at end of file diff --git a/tests/benchmarks/hash/scrypt.go b/tests/benchmarks/hash/scrypt.go new file mode 100644 index 0000000..82f9ed5 --- /dev/null +++ b/tests/benchmarks/hash/scrypt.go @@ -0,0 +1,28 @@ +package scrypt + +import ( + "flag" +) + + + +var nFlag = flag.Int( + "n", + 100, + "The number of iterations to execute", +) + +func MainTest() { + flag.Parse() + n := *nFlag + + password := []byte("password") + salt := []byte("salt0123456789abcdef0123456789abcdef") + + for i := 0; i < n; i++ { + _, err := Hash(password, salt) + if err != nil { + panic(err) + } + } +} |