aboutsummaryrefslogtreecommitdiffstats
path: root/libar2.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-12 21:56:50 +0100
committerMattias Andrée <maandree@kth.se>2022-02-12 21:56:50 +0100
commit33c953317cad9ea06d8a26fe2cc2ed0ed9e29692 (patch)
tree9e34e8fd215966299d11cf93d5471c76b3a933a7 /libar2.h
parentlibar2_encode_base64: data may be NULL if buf is NULL (diff)
downloadlibar2-33c953317cad9ea06d8a26fe2cc2ed0ed9e29692.tar.gz
libar2-33c953317cad9ea06d8a26fe2cc2ed0ed9e29692.tar.bz2
libar2-33c953317cad9ea06d8a26fe2cc2ed0ed9e29692.tar.xz
Use params->version == 0 for implicit specification of version 1.0
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libar2.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/libar2.h b/libar2.h
index 144b430..8915a1a 100644
--- a/libar2.h
+++ b/libar2.h
@@ -55,7 +55,7 @@
#define LIBAR2_MIN_HASHLEN ((size_t)LIBAR2_UINT_LEAST32_C__(4))
#define LIBAR2_MAX_HASHLEN ((size_t)LIBAR2_UINT_LEAST32_C__(0xFFFFffff))
#define LIBAR2_IS_TYPE_OK(T) ((T) == LIBAR2_ARGON2D || (T) == LIBAR2_ARGON2I || (T) == LIBAR2_ARGON2ID || (T) == LIBAR2_ARGON2DS)
-#define LIBAR2_IS_VERSION_OK(V) ((V) == LIBAR2_ARGON2_VERSION_10 || (V) == LIBAR2_ARGON2_VERSION_13)
+#define LIBAR2_IS_VERSION_OK(V) (!(V) || (V) == LIBAR2_ARGON2_VERSION_10 || (V) == LIBAR2_ARGON2_VERSION_13)
/* } */
@@ -180,7 +180,8 @@ struct libar2_argon2_parameters {
enum libar2_argon2_type type;
/**
- * Version number
+ * Version number; or 0 if not specified
+ * (which is equivalent to `LIBAR2_ARGON2_VERSION_10`)
*
* `libar2_latest_argon2_version` is recommended
*/