mirror of
https://github.com/octoleo/restic.git
synced 2024-11-11 07:41:03 +00:00
repository: remove a few global variables
This commit is contained in:
parent
044e8bf821
commit
3ba1fa3cee
@ -47,7 +47,7 @@ type Key struct {
|
||||
// calibrated on the first run of AddKey().
|
||||
var Params *crypto.Params
|
||||
|
||||
var (
|
||||
const (
|
||||
// KDFTimeout specifies the maximum runtime for the KDF.
|
||||
KDFTimeout = 500 * time.Millisecond
|
||||
|
||||
|
@ -17,13 +17,6 @@ import (
|
||||
"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 {
|
||||
Logf(format string, args ...interface{})
|
||||
}
|
||||
@ -31,7 +24,11 @@ type logger interface {
|
||||
// TestUseLowSecurityKDFParameters configures low-security KDF parameters for testing.
|
||||
func TestUseLowSecurityKDFParameters(t logger) {
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user