aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-17 17:19:28 +0100
committerMattias Andrée <maandree@kth.se>2022-02-17 17:19:28 +0100
commitf677983078a0e5afc0dda3c3273f86ea304ddba4 (patch)
tree71226709b35b890430c83a4737ef17a5882fa8a8
parentlibar2_erase.3: mention weak linking (diff)
downloadlibar2-f677983078a0e5afc0dda3c3273f86ea304ddba4.tar.gz
libar2-f677983078a0e5afc0dda3c3273f86ea304ddba4.tar.bz2
libar2-f677983078a0e5afc0dda3c3273f86ea304ddba4.tar.xz
Remove obsolete macro
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--common.h5
-rw-r--r--libar2_hash.c8
2 files changed, 6 insertions, 7 deletions
diff --git a/common.h b/common.h
index 5e744d5..432dff2 100644
--- a/common.h
+++ b/common.h
@@ -108,9 +108,8 @@
#define MIN(A, B) ((A) < (B) ? (A) : (B))
-#define ERASE(PTR, N) libar2_erase(PTR, N)
-#define ERASE_ARRAY(ARR) ERASE(ARR, sizeof(ARR))
-#define ERASE_STRUCT(S) ERASE(&(S), sizeof(S))
+#define ERASE_ARRAY(ARR) libar2_erase(ARR, sizeof(ARR))
+#define ERASE_STRUCT(S) libar2_erase(&(S), sizeof(S))
struct block {
diff --git a/libar2_hash.c b/libar2_hash.c
index 4dc2e82..435d48d 100644
--- a/libar2_hash.c
+++ b/libar2_hash.c
@@ -497,7 +497,7 @@ initial_hash(unsigned char hash[static 64], void *msg, size_t msglen,
}
}
if (ctx->autoerase_message)
- ERASE(msg, msglen);
+ libar2_erase(msg, msglen);
}
n += store32(&block[n], (uint_least32_t)params->saltlen);
@@ -520,7 +520,7 @@ initial_hash(unsigned char hash[static 64], void *msg, size_t msglen,
n = params->saltlen - off;
}
if (ctx->autoerase_salt)
- ERASE(params->salt, params->saltlen);
+ libar2_erase(params->salt, params->saltlen);
}
n += store32(&block[n], (uint_least32_t)params->keylen);
@@ -543,7 +543,7 @@ initial_hash(unsigned char hash[static 64], void *msg, size_t msglen,
n = params->keylen - off;
}
if (ctx->autoerase_secret)
- ERASE(params->key, params->keylen);
+ libar2_erase(params->key, params->keylen);
}
n += store32(&block[n], (uint_least32_t)params->adlen);
@@ -573,7 +573,7 @@ initial_hash(unsigned char hash[static 64], void *msg, size_t msglen,
}
}
if (ctx->autoerase_associated_data)
- ERASE(params->ad, params->adlen);
+ libar2_erase(params->ad, params->adlen);
}
libblake_blake2b_digest(&state, block, n, 0, 64, hash);