diff options
Diffstat (limited to 'tests/benchmarks/hash/scrypt.go')
-rw-r--r-- | tests/benchmarks/hash/scrypt.go | 28 |
1 files changed, 28 insertions, 0 deletions
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) + } + } +} |