Files
kopia/internal/blobcrypto/static_crypter.go
Jarek Kowalski c478141bbf refactor(repository): refactor internal/repolog package to support writing metrics in the future (#3610)
* renamed internal/repolog to internal/repodiag

* refactored initialization

* additional tests

* linter fixes
2024-02-02 22:19:24 -08:00

25 lines
576 B
Go

package blobcrypto
import (
"github.com/kopia/kopia/repo/encryption"
"github.com/kopia/kopia/repo/hashing"
)
// StaticCrypter implements Crypter interface with static hash and encryption functions.
type StaticCrypter struct {
Hash hashing.HashFunc
Encryption encryption.Encryptor
}
// Encryptor returns the encryption algorithm.
func (p StaticCrypter) Encryptor() encryption.Encryptor {
return p.Encryption
}
// HashFunc returns the hashing algorithm.
func (p StaticCrypter) HashFunc() hashing.HashFunc {
return p.Hash
}
var _ Crypter = (*StaticCrypter)(nil)