diff options
| author | Joseph Richey <joerichey94@gmail.com> | 2018-02-08 02:37:42 -0800 |
|---|---|---|
| committer | Joseph Richey <joerichey94@gmail.com> | 2018-02-09 03:36:11 -0800 |
| commit | 5d71e1d16b069d7f6f22b7978f696af493a3c846 (patch) | |
| tree | 5b70632449c27b0f4e90ff50443c0347157ebe39 /crypto/crypto_test.go | |
| parent | f4ccce6f486c26fdfa8d3d09929d464fc9368ab3 (diff) | |
crypto: Move from libargon2 -> x/crypto/argon2
Use the golang library for the hashing function instead of the reference
C implementation. This removes the dependancy on libargon2. As we are no
longer doing our own error checking, we also eliminate those tests.
Diffstat (limited to 'crypto/crypto_test.go')
| -rw-r--r-- | crypto/crypto_test.go | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index 444f847..2946a59 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -533,65 +533,6 @@ func TestPassphraseHashing(t *testing.T) { } } -func TestBadTime(t *testing.T) { - pk, err := fakePassphraseKey() - if err != nil { - t.Fatal(err) - } - defer pk.Wipe() - - costs := *hashTestCases[0].costs - costs.Time = 0 - _, err = PassphraseHash(pk, fakeSalt, &costs) - if err == nil { - t.Errorf("time cost of %d should be invalid", costs.Time) - } -} - -func TestBadMemory(t *testing.T) { - pk, err := fakePassphraseKey() - if err != nil { - t.Fatal(err) - } - defer pk.Wipe() - - costs := *hashTestCases[0].costs - costs.Memory = 7 - _, err = PassphraseHash(pk, fakeSalt, &costs) - if err == nil { - t.Errorf("memory cost of %d should be invalid", costs.Memory) - } -} - -func TestBadParallelism(t *testing.T) { - pk, err := fakePassphraseKey() - if err != nil { - t.Fatal(err) - } - defer pk.Wipe() - - costs := *hashTestCases[0].costs - costs.Parallelism = 1 << 24 - costs.Memory = 1 << 27 // Running n threads requires at least 8*n memory - _, err = PassphraseHash(pk, fakeSalt, &costs) - if err == nil { - t.Errorf("parallelism cost of %d should be invalid", costs.Parallelism) - } -} - -func TestBadSalt(t *testing.T) { - pk, err := fakePassphraseKey() - if err != nil { - t.Fatal(err) - } - defer pk.Wipe() - - _, err = PassphraseHash(pk, []byte{1, 2, 3, 4}, hashTestCases[0].costs) - if err == nil { - t.Error("too short of salt should be invalid") - } -} - func BenchmarkWrap(b *testing.B) { for n := 0; n < b.N; n++ { Wrap(fakeWrappingKey, fakeValidPolicyKey) |