Update CNIOSHA1.h to support C++ mode (#2523)

This commit is contained in:
Stanislav Yaglo authored and GitHub committed 2023-09-27 10:46:26 +01:00
1 parent ebb271a6a9
commit e4aaf2ca35
1 file changed
+12
+12
View File
@@ -49,6 +49,10 @@
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
struct sha1_ctxt {
union {
uint8_t b8[20];
@@ -68,7 +72,12 @@ typedef struct sha1_ctxt SHA1_CTX;
#define SHA1_RESULTLEN (160/8)
#ifdef __cplusplus
#define __min_size(x) (x)
#else
#define __min_size(x) static (x)
#endif
extern void c_nio_sha1_init(struct sha1_ctxt *);
extern void c_nio_sha1_pad(struct sha1_ctxt *);
extern void c_nio_sha1_loop(struct sha1_ctxt *, const uint8_t *, size_t);
@@ -79,5 +88,8 @@ extern void c_nio_sha1_result(struct sha1_ctxt *, char[__min_size(SHA1_RESULTLEN
#define SHA1Update(x, y, z) c_nio_sha1_loop((x), (y), (z))
#define SHA1Final(x, y) c_nio_sha1_result((y), (x))
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*_CRYPTO_SHA1_H_*/