2 * PDKIM - a RFC4871 (DKIM) implementation
4 * Copyright (C) 2016 Exim maintainers
6 * Hash interface functions
11 #if !defined(DISABLE_DKIM) && !defined(PDKIM_HASH_H) /* entire file */
15 # error Need SUPPORT_TLS for DKIM
18 #include "crypt_ver.h"
22 # include <openssl/rsa.h>
23 # include <openssl/ssl.h>
24 # include <openssl/err.h>
25 #elif defined(RSA_GNUTLS)
26 # include <gnutls/gnutls.h>
27 # include <gnutls/x509.h>
31 # include <gnutls/crypto.h>
32 #elif defined(SHA_GCRYPT)
34 #elif defined(SHA_POLARSSL)
36 # include "polarssl/sha1.h"
37 # include "polarssl/sha2.h"
47 SHA_CTX sha1; /* SHA1 block */
48 SHA256_CTX sha2; /* SHA256 block */
51 #elif defined(SHA_GNUTLS)
52 gnutls_hash_hd_t sha; /* Either SHA1 or SHA256 block */
54 #elif defined(SHA_GCRYPT)
55 gcry_md_hd_t sha; /* Either SHA1 or SHA256 block */
57 #elif defined(SHA_POLARSSL)
59 sha1_context sha1; /* SHA1 block */
60 sha2_context sha2; /* SHA256 block */
66 #if defined(SHA_OPENSSL)
68 #elif defined(SHA_GCRYPT)
73 extern void exim_sha_init(hctx *, BOOL);
74 extern void exim_sha_update(hctx *, const uschar *a, int);
75 extern void exim_sha_finish(hctx *, blob *);
76 extern int exim_sha_hashlen(hctx *);
78 #endif /*DISABLE_DKIM*/