Skip to content

Rename *result* to finalize #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion aes-gcm-siv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ where
block[8..].copy_from_slice(&buffer_bits.to_le_bytes());
self.polyval.update(&block);

let mut tag = self.polyval.result_reset().into_bytes();
let mut tag = self.polyval.finalize_reset().into_bytes();

// XOR the nonce into the resulting tag
for (i, byte) in tag[..12].iter_mut().enumerate() {
Expand Down
4 changes: 2 additions & 2 deletions aes-gcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ where
block[8..].copy_from_slice(&nonce_bits.to_be_bytes());
ghash.update(&block);

ghash.result().into_bytes()
ghash.finalize().into_bytes()
};

Ctr32::new(j0)
Expand All @@ -322,6 +322,6 @@ where
block[8..].copy_from_slice(&buffer_bits.to_be_bytes());
ghash.update(&block);

ghash.result().into_bytes()
ghash.finalize().into_bytes()
}
}
6 changes: 3 additions & 3 deletions aes-siv/src/siv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ where
T: AsRef<[u8]>,
{
mac.update(&Tag::default());
let mut state = mac.result_reset().into_bytes();
let mut state = mac.finalize_reset().into_bytes();

for (i, header) in headers.into_iter().enumerate() {
if i >= MAX_HEADERS {
Expand All @@ -272,7 +272,7 @@ where

state = state.dbl();
mac.update(header.as_ref());
let code = mac.result_reset().into_bytes();
let code = mac.finalize_reset().into_bytes();
xor_in_place(&mut state, &code);
}

Expand All @@ -288,7 +288,7 @@ where
};

mac.update(state.as_ref());
Ok(mac.result_reset().into_bytes())
Ok(mac.finalize_reset().into_bytes())
}

/// XOR the second argument into the first in-place. Slices do not have to be
Expand Down
2 changes: 1 addition & 1 deletion chacha20poly1305/src/cipher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ where
self.mac.update_padded(buffer);

self.authenticate_lengths(associated_data, buffer)?;
Ok(self.mac.result().into_bytes())
Ok(self.mac.finalize().into_bytes())
}

/// Decrypt the given message, first authenticating ciphertext integrity
Expand Down