From a303e00289ede6398e02526789aa4ca183793231 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 25 Nov 2020 07:56:37 +0100 Subject: [PATCH] fingerprint: add new() method --- src/backup/crypt_config.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backup/crypt_config.rs b/src/backup/crypt_config.rs index 67482a75..711f90f6 100644 --- a/src/backup/crypt_config.rs +++ b/src/backup/crypt_config.rs @@ -48,6 +48,9 @@ pub struct Fingerprint { } impl Fingerprint { + pub fn new(bytes: [u8; 32]) -> Self { + Self { bytes } + } pub fn bytes(&self) -> &[u8; 32] { &self.bytes } @@ -132,9 +135,7 @@ impl CryptConfig { } pub fn fingerprint(&self) -> Fingerprint { - Fingerprint { - bytes: self.compute_digest(&FINGERPRINT_INPUT) - } + Fingerprint::new(self.compute_digest(&FINGERPRINT_INPUT)) } pub fn data_crypter(&self, iv: &[u8; 16], mode: Mode) -> Result {