summaryrefslogtreecommitdiffstats
path: root/src/methods
diff options
context:
space:
mode:
Diffstat (limited to 'src/methods')
-rw-r--r--src/methods/composed_gmac/composed_gmac.c2
-rw-r--r--src/methods/composed_umac/composed_umac.c2
-rw-r--r--src/methods/generic_gmac/generic_gmac.c2
-rw-r--r--src/methods/generic_umac/generic_umac.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/methods/composed_gmac/composed_gmac.c b/src/methods/composed_gmac/composed_gmac.c
index 72f5c8b..86ae66b 100644
--- a/src/methods/composed_gmac/composed_gmac.c
+++ b/src/methods/composed_gmac/composed_gmac.c
@@ -301,7 +301,7 @@ static bool method_decrypt(fastd_peer_t *peer, fastd_method_session_state_t *ses
ok = session->ghash->digest(session->ghash_state, &tag, inblocks+1, n_blocks*sizeof(fastd_block128_t));
}
- if (!ok || memcmp(&tag, &outblocks[0], sizeof(fastd_block128_t)) != 0) {
+ if (!ok || !block_equal(&tag, &outblocks[0])) {
fastd_buffer_free(*out);
return false;
}
diff --git a/src/methods/composed_umac/composed_umac.c b/src/methods/composed_umac/composed_umac.c
index 02fdda6..6c01bff 100644
--- a/src/methods/composed_umac/composed_umac.c
+++ b/src/methods/composed_umac/composed_umac.c
@@ -265,7 +265,7 @@ static bool method_decrypt(fastd_peer_t *peer, fastd_method_session_state_t *ses
ok = session->uhash->digest(session->uhash_state, &tag, inblocks+1, in_len);
}
- if (!ok || memcmp(&tag, &outblocks[0], sizeof(fastd_block128_t)) != 0) {
+ if (!ok || !block_equal(&tag, &outblocks[0])) {
fastd_buffer_free(*out);
return false;
}
diff --git a/src/methods/generic_gmac/generic_gmac.c b/src/methods/generic_gmac/generic_gmac.c
index 30a2f2f..519c354 100644
--- a/src/methods/generic_gmac/generic_gmac.c
+++ b/src/methods/generic_gmac/generic_gmac.c
@@ -261,7 +261,7 @@ static bool method_decrypt(fastd_peer_t *peer, fastd_method_session_state_t *ses
ok = session->ghash->digest(session->ghash_state, &tag, inblocks+1, n_blocks*sizeof(fastd_block128_t));
}
- if (!ok || memcmp(&tag, &outblocks[0], sizeof(fastd_block128_t)) != 0) {
+ if (!ok || !block_equal(&tag, &outblocks[0])) {
fastd_buffer_free(*out);
return false;
}
diff --git a/src/methods/generic_umac/generic_umac.c b/src/methods/generic_umac/generic_umac.c
index aaaf9e7..167ee79 100644
--- a/src/methods/generic_umac/generic_umac.c
+++ b/src/methods/generic_umac/generic_umac.c
@@ -224,7 +224,7 @@ static bool method_decrypt(fastd_peer_t *peer, fastd_method_session_state_t *ses
if (ok)
ok = session->uhash->digest(session->uhash_state, &tag, inblocks+1, in_len);
- if (!ok || memcmp(&tag, &outblocks[0], sizeof(fastd_block128_t)) != 0) {
+ if (!ok || !block_equal(&tag, &outblocks[0])) {
fastd_buffer_free(*out);
return false;
}