Update github.com/elithrar/simple-scrypt

For details see #1697
This commit is contained in:
Alexander Neumann 2018-04-02 19:48:25 +02:00
parent 03193e6d92
commit 92f516b1d4
3 changed files with 62 additions and 45 deletions

View file

@ -114,6 +114,9 @@ func TestCalibrate(t *testing.T) {
for testNum, tc := range []struct {
MemMiB int
}{
{512},
{256},
{128},
{64},
{32},
{16},
@ -139,9 +142,9 @@ func TestCalibrate(t *testing.T) {
t.Fatalf("%d. GenerateFromPassword with %#v: %v", testNum, p, err)
}
if dur < timeout/2 {
t.Errorf("%d. GenerateFromPassword was too fast (wanted around %s, got %s) with %#v.", testNum, timeout, dur, p)
} else if timeout*2 < dur {
t.Errorf("%d. GenerateFromPassword took too long (wanted around %s, got %s) with %#v.", testNum, timeout, dur, p)
t.Errorf("%d. GenerateFromPassword was too fast (expected between %s and %s, got %s) with %#v.", testNum, timeout/2, timeout+timeout/2, dur, p)
} else if timeout+timeout/2 < dur {
t.Errorf("%d. GenerateFromPassword took too long (expected between %s and %s, got %s) with %#v.", testNum, timeout/2, timeout+timeout/2, dur, p)
}
}
}