Setup for >2 sha methods
[exim.git] / src / src / hash.h
index 89bedb926ebd804ee44d48f2f8f158231992564b..f1ebac467dc9c121d80a5fec84209d881dd5638e 100644 (file)
 
 /* Hash context for the exim_sha_* routines */
 
+typedef enum hashmethod {
+  HASH_SHA1,
+  HASH_SHA256,
+  HASH_SHA3
+} hashmethod;
+
 typedef struct {
-  BOOL is_sha1;
-  int hashlen;
+  hashmethod   method;
+  int          hashlen;
 
 #ifdef SHA_OPENSSL
   union {
@@ -57,7 +63,7 @@ typedef struct {
 
 } hctx;
 
-extern void     exim_sha_init(hctx *, BOOL);
+extern void     exim_sha_init(hctx *, hashmethod);
 extern void     exim_sha_update(hctx *, const uschar *a, int);
 extern void     exim_sha_finish(hctx *, blob *);
 extern int      exim_sha_hashlen(hctx *);