Skip to content

Commit

Permalink
Using string::push_back instead of string::append and reinterpret_cast.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 563709303
Change-Id: Ie632457aa9885c6846a4bf4d330bd98c40a47fed
  • Loading branch information
ise-crypto authored and Copybara-Service committed Sep 8, 2023
1 parent 50c3c05 commit 314284f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tink/mac/mac_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ util::StatusOr<std::string> MacSetWrapper::ComputeMac(
std::string local_data;
if (primary->get_output_prefix_type() == OutputPrefixType::LEGACY) {
local_data = std::string(data);
local_data.append(
reinterpret_cast<const char*>(&CryptoFormat::kLegacyStartByte), 1);
local_data.push_back(CryptoFormat::kLegacyStartByte);
data = local_data;
}
auto compute_mac_result = primary->get_primitive().ComputeMac(data);
Expand Down

0 comments on commit 314284f

Please sign in to comment.