repository: remove a few global variables

This commit is contained in:
Michael Eischer 2024-02-24 17:20:10 +01:00
parent 044e8bf821
commit 3ba1fa3cee
2 changed files with 6 additions and 9 deletions

View file

@ -47,7 +47,7 @@ type Key struct {
// calibrated on the first run of AddKey(). // calibrated on the first run of AddKey().
var Params *crypto.Params var Params *crypto.Params
var ( const (
// KDFTimeout specifies the maximum runtime for the KDF. // KDFTimeout specifies the maximum runtime for the KDF.
KDFTimeout = 500 * time.Millisecond KDFTimeout = 500 * time.Millisecond

View file

@ -17,13 +17,6 @@ import (
"github.com/restic/chunker" "github.com/restic/chunker"
) )
// testKDFParams are the parameters for the KDF to be used during testing.
var testKDFParams = crypto.Params{
N: 128,
R: 1,
P: 1,
}
type logger interface { type logger interface {
Logf(format string, args ...interface{}) Logf(format string, args ...interface{})
} }
@ -31,7 +24,11 @@ type logger interface {
// TestUseLowSecurityKDFParameters configures low-security KDF parameters for testing. // TestUseLowSecurityKDFParameters configures low-security KDF parameters for testing.
func TestUseLowSecurityKDFParameters(t logger) { func TestUseLowSecurityKDFParameters(t logger) {
t.Logf("using low-security KDF parameters for test") t.Logf("using low-security KDF parameters for test")
Params = &testKDFParams Params = &crypto.Params{
N: 128,
R: 1,
P: 1,
}
} }
// TestBackend returns a fully configured in-memory backend. // TestBackend returns a fully configured in-memory backend.