|
2 | 2 | #define HASH_H
|
3 | 3 |
|
4 | 4 | #if defined(SHA1_APPLE)
|
| 5 | +#define SHA1_BACKEND "SHA1_APPLE (No collision detection)" |
5 | 6 | #include <CommonCrypto/CommonDigest.h>
|
6 | 7 | #elif defined(SHA1_OPENSSL)
|
| 8 | +# define SHA1_BACKEND "SHA1_OPENSSL (No collision detection)" |
7 | 9 | # include <openssl/sha.h>
|
8 | 10 | # if defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL >= 3
|
9 | 11 | # define SHA1_NEEDS_CLONE_HELPER
|
10 | 12 | # include "sha1/openssl.h"
|
11 | 13 | # endif
|
12 | 14 | #elif defined(SHA1_DC)
|
| 15 | +#define SHA1_BACKEND "SHA1_DC" |
13 | 16 | #include "sha1dc_git.h"
|
14 | 17 | #else /* SHA1_BLK */
|
| 18 | +#define SHA1_BACKEND "SHA1_BLK (No collision detection)" |
15 | 19 | #include "block-sha1/sha1.h"
|
16 | 20 | #endif
|
17 | 21 |
|
18 | 22 | #if defined(SHA1_APPLE_UNSAFE)
|
| 23 | +# define SHA1_UNSAFE_BACKEND "SHA1_APPLE_UNSAFE" |
19 | 24 | # include <CommonCrypto/CommonDigest.h>
|
20 | 25 | # define platform_SHA_CTX_unsafe CC_SHA1_CTX
|
21 | 26 | # define platform_SHA1_Init_unsafe CC_SHA1_Init
|
22 | 27 | # define platform_SHA1_Update_unsafe CC_SHA1_Update
|
23 | 28 | # define platform_SHA1_Final_unsafe CC_SHA1_Final
|
24 | 29 | #elif defined(SHA1_OPENSSL_UNSAFE)
|
| 30 | +# define SHA1_UNSAFE_BACKEND "SHA1_OPENSSL_UNSAFE" |
25 | 31 | # include <openssl/sha.h>
|
26 | 32 | # if defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL >= 3
|
27 | 33 | # define SHA1_NEEDS_CLONE_HELPER_UNSAFE
|
|
38 | 44 | # define platform_SHA1_Final_unsafe SHA1_Final
|
39 | 45 | # endif
|
40 | 46 | #elif defined(SHA1_BLK_UNSAFE)
|
| 47 | +# define SHA1_UNSAFE_BACKEND "SHA1_BLK_UNSAFE" |
41 | 48 | # include "block-sha1/sha1.h"
|
42 | 49 | # define platform_SHA_CTX_unsafe blk_SHA_CTX
|
43 | 50 | # define platform_SHA1_Init_unsafe blk_SHA1_Init
|
|
46 | 53 | #endif
|
47 | 54 |
|
48 | 55 | #if defined(SHA256_NETTLE)
|
| 56 | +#define SHA256_BACKEND "SHA256_NETTLE" |
49 | 57 | #include "sha256/nettle.h"
|
50 | 58 | #elif defined(SHA256_GCRYPT)
|
| 59 | +#define SHA256_BACKEND "SHA256_GCRYPT" |
51 | 60 | #define SHA256_NEEDS_CLONE_HELPER
|
52 | 61 | #include "sha256/gcrypt.h"
|
53 | 62 | #elif defined(SHA256_OPENSSL)
|
| 63 | +# define SHA256_BACKEND "SHA256_OPENSSL" |
54 | 64 | # include <openssl/sha.h>
|
55 | 65 | # if defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL >= 3
|
56 | 66 | # define SHA256_NEEDS_CLONE_HELPER
|
57 | 67 | # include "sha256/openssl.h"
|
58 | 68 | # endif
|
59 | 69 | #else
|
| 70 | +#define SHA256_BACKEND "SHA256_BLK" |
60 | 71 | #include "sha256/block/sha256.h"
|
61 | 72 | #endif
|
62 | 73 |
|
|
0 commit comments