diff th_crypto.h @ 215:f04743489c9e

Add endian converting th_md5_append_{he,le,be}{16,32,64}() functions.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 12 Feb 2016 18:17:44 +0200
parents d9f1d1c977ff
children 4fee16cb28c1
line wrap: on
line diff
--- a/th_crypto.h	Fri Feb 12 18:17:11 2016 +0200
+++ b/th_crypto.h	Fri Feb 12 18:17:44 2016 +0200
@@ -40,6 +40,20 @@
 void    th_md5_finish(th_md5state_t *ctx, th_md5hash_t digest);
 void    th_md5_print(FILE *, const th_md5hash_t digest);
 
+void    th_md5_append_uint8(th_md5state_t *ctx, uint8_t val);
+
+#define TH_DEFINE_HEADER(xname) \
+void    th_md5_append_ ## xname ## 16 (th_md5state_t *ctx, uint16_t val); \
+void    th_md5_append_ ## xname ## 32 (th_md5state_t *ctx, uint32_t val); \
+void    th_md5_append_ ## xname ## 64 (th_md5state_t *ctx, uint64_t val);
+
+TH_DEFINE_HEADER(he)
+TH_DEFINE_HEADER(le)
+TH_DEFINE_HEADER(be)
+
+#undef TH_DEFINE_HEADER
+
+
 #ifdef __cplusplus
 }
 #endif