fingerprint: add new() method
This commit is contained in:
parent
af9f72e9d8
commit
a303e00289
@ -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<Crypter, Error> {
|
||||
|
Loading…
Reference in New Issue
Block a user