summaryrefslogtreecommitdiffstats
path: root/src/methods
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-08-25 00:09:19 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-08-25 00:09:19 +0200
commitf2d84afd9d8373bf2778d1a1635384000c03f887 (patch)
tree42af8a7430278871e3a1b1e14006099aa50eae80 /src/methods
parent9855a34f48acf6ae3aaeba9ec37756da41507e64 (diff)
downloadfastd-f2d84afd9d8373bf2778d1a1635384000c03f887.tar
fastd-f2d84afd9d8373bf2778d1a1635384000c03f887.zip
MAC: rename hash() to digest() and change length unit from blocks to bytes
Diffstat (limited to 'src/methods')
-rw-r--r--src/methods/composed_gmac/composed_gmac.c4
-rw-r--r--src/methods/generic_gmac/generic_gmac.c4
2 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 a709c3f..72f5c8b 100644
--- a/src/methods/composed_gmac/composed_gmac.c
+++ b/src/methods/composed_gmac/composed_gmac.c
@@ -237,7 +237,7 @@ static bool method_encrypt(fastd_peer_t *peer UNUSED, fastd_method_session_state
put_size(&outblocks[n_blocks+1], in.len);
- ok = session->ghash->hash(session->ghash_state, &tag, outblocks+1, n_blocks+1);
+ ok = session->ghash->digest(session->ghash_state, &tag, outblocks+1, (n_blocks+1)*sizeof(fastd_block128_t));
}
if (!ok) {
@@ -298,7 +298,7 @@ static bool method_decrypt(fastd_peer_t *peer, fastd_method_session_state_t *ses
put_size(&inblocks[n_blocks], in.len-sizeof(fastd_block128_t));
- ok = session->ghash->hash(session->ghash_state, &tag, inblocks+1, n_blocks);
+ 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) {
diff --git a/src/methods/generic_gmac/generic_gmac.c b/src/methods/generic_gmac/generic_gmac.c
index 5ee8427..30a2f2f 100644
--- a/src/methods/generic_gmac/generic_gmac.c
+++ b/src/methods/generic_gmac/generic_gmac.c
@@ -203,7 +203,7 @@ static bool method_encrypt(fastd_peer_t *peer UNUSED, fastd_method_session_state
put_size(&outblocks[n_blocks], in.len-sizeof(fastd_block128_t));
- ok = session->ghash->hash(session->ghash_state, &tag, outblocks+1, n_blocks);
+ ok = session->ghash->digest(session->ghash_state, &tag, outblocks+1, n_blocks*sizeof(fastd_block128_t));
}
if (!ok) {
@@ -258,7 +258,7 @@ static bool method_decrypt(fastd_peer_t *peer, fastd_method_session_state_t *ses
put_size(&inblocks[n_blocks], in.len-sizeof(fastd_block128_t));
- ok = session->ghash->hash(session->ghash_state, &tag, inblocks+1, n_blocks);
+ 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) {