summaryrefslogtreecommitdiffstats
path: root/3rd_party/libsrp6a-sha512/t_sha.h
diff options
context:
space:
mode:
Diffstat (limited to '3rd_party/libsrp6a-sha512/t_sha.h')
-rw-r--r--3rd_party/libsrp6a-sha512/t_sha.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/3rd_party/libsrp6a-sha512/t_sha.h b/3rd_party/libsrp6a-sha512/t_sha.h
index 18deec5..2e38067 100644
--- a/3rd_party/libsrp6a-sha512/t_sha.h
+++ b/3rd_party/libsrp6a-sha512/t_sha.h
@@ -38,6 +38,28 @@
38#endif 38#endif
39 39
40#ifdef OPENSSL_SHA 40#ifdef OPENSSL_SHA
41#include <openssl/err.h>
42#if OPENSSL_VERSION_NUMBER >= 0x30000000L
43#include <openssl/evp.h>
44
45typedef EVP_MD_CTX* SHA1_CTX;
46#define SHA1Init SHA1Init_openssl
47#define SHA1Update SHA1Update_openssl
48#define SHA1Final SHA1Final_openssl
49
50typedef EVP_MD_CTX* SHA512_CTX;
51#define SHA512Init SHA512Init_openssl
52#define SHA512Update SHA512Update_openssl
53#define SHA512Final SHA512Final_openssl
54
55void SHA1Init_openssl(SHA1_CTX *ctx);
56void SHA1Update_openssl(SHA1_CTX *ctx, const void *data, unsigned int len);
57void SHA1Final_openssl(unsigned char digest[20], SHA1_CTX *ctx);
58
59void SHA512Init_openssl(SHA512_CTX *ctx);
60void SHA512Update_openssl(SHA512_CTX *ctx, const void *data, unsigned int len);
61void SHA512Final_openssl(unsigned char digest[64], SHA1_CTX *ctx);
62#else /* for OpenSSL < 3.0 */
41#include <openssl/sha.h> 63#include <openssl/sha.h>
42 64
43typedef SHA_CTX SHA1_CTX; 65typedef SHA_CTX SHA1_CTX;
@@ -48,7 +70,7 @@ typedef SHA_CTX SHA1_CTX;
48#define SHA512Init SHA512_Init 70#define SHA512Init SHA512_Init
49#define SHA512Update SHA512_Update 71#define SHA512Update SHA512_Update
50#define SHA512Final SHA512_Final 72#define SHA512Final SHA512_Final
51 73#endif /* for OpenSSL < 3.0 */
52#elif defined(TOMCRYPT_SHA) 74#elif defined(TOMCRYPT_SHA)
53/* mycrypt.h already included above */ 75/* mycrypt.h already included above */
54 76