Skip to content

Commit

Permalink
Update to rust-crypto 0.9.0, with breaking API changes
Browse files Browse the repository at this point in the history
Cf. RustCrypto/traits#43 . I believe that we end up
re-exporting these APIs, so this is could be a breaking change for API
consumers, although it's not an API that we expect many people to be using
themselves.
  • Loading branch information
pkgw committed Jun 16, 2020
1 parent 65192a0 commit d379c84
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl FromStr for DigestData {
impl From<DigestComputer> for DigestData {
fn from(s: DigestComputer) -> DigestData {
let mut result = DigestData::zeros();
let res = s.result();
let res = s.finalize();
result.0.copy_from_slice(res.as_slice());
result
}
Expand Down
2 changes: 1 addition & 1 deletion src/io/cached_itarbundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ impl CachedITarBundle {
let length = content.len();

let mut digest_builder = digest::create();
digest_builder.input(&content);
digest_builder.update(&content);

let digest = DigestData::from(digest_builder);

Expand Down
4 changes: 2 additions & 2 deletions src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl Read for InputHandle {
self.ever_read = true;
let n = self.inner.read(buf)?;
if !self.read_only {
self.digest.input(&buf[..n]);
self.digest.update(&buf[..n]);
}
Ok(n)
}
Expand Down Expand Up @@ -280,7 +280,7 @@ impl OutputHandle {
impl Write for OutputHandle {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
let n = self.inner.write(buf)?;
self.digest.input(&buf[..n]);
self.digest.update(&buf[..n]);
Ok(n)
}

Expand Down

0 comments on commit d379c84

Please sign in to comment.