|
15 | 15 | #include "block-sha1/sha1.h"
|
16 | 16 | #endif
|
17 | 17 |
|
| 18 | +#if defined(SHA1_APPLE_UNSAFE) |
| 19 | +# include <CommonCrypto/CommonDigest.h> |
| 20 | +# define platform_SHA_CTX_unsafe CC_SHA1_CTX |
| 21 | +# define platform_SHA1_Init_unsafe CC_SHA1_Init |
| 22 | +# define platform_SHA1_Update_unsafe CC_SHA1_Update |
| 23 | +# define platform_SHA1_Final_unsafe CC_SHA1_Final |
| 24 | +#elif defined(SHA1_OPENSSL_UNSAFE) |
| 25 | +# include <openssl/sha.h> |
| 26 | +# if defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL >= 3 |
| 27 | +# define SHA1_NEEDS_CLONE_HELPER_UNSAFE |
| 28 | +# include "sha1/openssl.h" |
| 29 | +# define platform_SHA_CTX_unsafe openssl_SHA1_CTX |
| 30 | +# define platform_SHA1_Init_unsafe openssl_SHA1_Init |
| 31 | +# define platform_SHA1_Clone_unsafe openssl_SHA1_Clone |
| 32 | +# define platform_SHA1_Update_unsafe openssl_SHA1_Update |
| 33 | +# define platform_SHA1_Final_unsafe openssl_SHA1_Final |
| 34 | +# else |
| 35 | +# define platform_SHA_CTX_unsafe SHA_CTX |
| 36 | +# define platform_SHA1_Init_unsafe SHA1_Init |
| 37 | +# define platform_SHA1_Update_unsafe SHA1_Update |
| 38 | +# define platform_SHA1_Final_unsafe SHA1_Final |
| 39 | +# endif |
| 40 | +#elif defined(SHA1_BLK_UNSAFE) |
| 41 | +# include "block-sha1/sha1.h" |
| 42 | +# define platform_SHA_CTX_unsafe blk_SHA_CTX |
| 43 | +# define platform_SHA1_Init_unsafe blk_SHA1_Init |
| 44 | +# define platform_SHA1_Update_unsafe blk_SHA1_Update |
| 45 | +# define platform_SHA1_Final_unsafe blk_SHA1_Final |
| 46 | +#endif |
| 47 | + |
18 | 48 | #if defined(SHA256_NETTLE)
|
19 | 49 | #include "sha256/nettle.h"
|
20 | 50 | #elif defined(SHA256_GCRYPT)
|
|
0 commit comments