crypto: move crypto buffer helpers

This commit is contained in:
Michael Eischer
2022-06-12 14:48:30 +02:00
parent a0cef9f247
commit 8c11fc3ec9
11 changed files with 29 additions and 26 deletions

View File

@@ -8,6 +8,7 @@ import (
"time"
"github.com/restic/restic/internal/checker"
"github.com/restic/restic/internal/crypto"
"github.com/restic/restic/internal/repository"
"github.com/restic/restic/internal/restic"
rtest "github.com/restic/restic/internal/test"
@@ -22,7 +23,7 @@ func TestMasterIndex(t *testing.T) {
PackID: restic.NewRandomID(),
Blob: restic.Blob{
BlobHandle: bhInIdx1,
Length: uint(restic.CiphertextLength(10)),
Length: uint(crypto.CiphertextLength(10)),
Offset: 0,
},
}
@@ -31,7 +32,7 @@ func TestMasterIndex(t *testing.T) {
PackID: restic.NewRandomID(),
Blob: restic.Blob{
BlobHandle: bhInIdx2,
Length: uint(restic.CiphertextLength(100)),
Length: uint(crypto.CiphertextLength(100)),
Offset: 10,
UncompressedLength: 200,
},
@@ -41,7 +42,7 @@ func TestMasterIndex(t *testing.T) {
PackID: restic.NewRandomID(),
Blob: restic.Blob{
BlobHandle: bhInIdx12,
Length: uint(restic.CiphertextLength(123)),
Length: uint(crypto.CiphertextLength(123)),
Offset: 110,
},
}
@@ -50,7 +51,7 @@ func TestMasterIndex(t *testing.T) {
PackID: restic.NewRandomID(),
Blob: restic.Blob{
BlobHandle: bhInIdx12,
Length: uint(restic.CiphertextLength(123)),
Length: uint(crypto.CiphertextLength(123)),
Offset: 50,
UncompressedLength: 80,
},