3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 23:09:34 +01:00

sha1: Remove unneeded resets

This commit is contained in:
Denis Kenzior 2015-02-13 15:02:04 -06:00
parent 6916554918
commit 0abbde0ebb

View File

@ -46,8 +46,6 @@ static void __hmac_sha1(struct l_checksum *checksum,
l_checksum_update(checksum, key, key_len); l_checksum_update(checksum, key, key_len);
l_checksum_get_digest(checksum, digest, SHA1_MAC_LEN); l_checksum_get_digest(checksum, digest, SHA1_MAC_LEN);
l_checksum_reset(checksum);
key = digest; key = digest;
key_len = SHA1_MAC_LEN; key_len = SHA1_MAC_LEN;
} }
@ -69,15 +67,11 @@ static void __hmac_sha1(struct l_checksum *checksum,
l_checksum_update(checksum, data, data_len); l_checksum_update(checksum, data, data_len);
l_checksum_get_digest(checksum, digest, SHA1_MAC_LEN); l_checksum_get_digest(checksum, digest, SHA1_MAC_LEN);
l_checksum_reset(checksum);
/* perform outer SHA1 */ /* perform outer SHA1 */
l_checksum_update(checksum, opad, sizeof(opad)); l_checksum_update(checksum, opad, sizeof(opad));
l_checksum_update(checksum, digest, SHA1_MAC_LEN); l_checksum_update(checksum, digest, SHA1_MAC_LEN);
l_checksum_get_digest(checksum, output, l_checksum_get_digest(checksum, output,
size > SHA1_MAC_LEN ? SHA1_MAC_LEN : size); size > SHA1_MAC_LEN ? SHA1_MAC_LEN : size);
l_checksum_reset(checksum);
} }
bool hmac_sha1(const void *key, size_t key_len, bool hmac_sha1(const void *key, size_t key_len,