aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sha2.c2
-rw-r--r--sha2.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/sha2.c b/sha2.c
index fc08d38..1e3ae41 100644
--- a/sha2.c
+++ b/sha2.c
@@ -462,7 +462,7 @@ void sha512_init(sha512_t * const ctx) {
w[i] = w16 + s0 + w7 + s1; \
} while (0)
-// WC: compress word
+// WC64: compress word
#define WC64(i) do { \
const uint64_t s1 = rr64(hs[4], 14) ^ rr64(hs[4], 18) ^ rr64(hs[4], 41), \
ch = (hs[4] & hs[5]) ^ ((~(hs[4])) & hs[6]), \
diff --git a/sha2.h b/sha2.h
index 704fb2f..367b736 100644
--- a/sha2.h
+++ b/sha2.h
@@ -1,6 +1,10 @@
#ifndef SHA2_H_
#define SHA2_H_
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
#include <stdint.h> // uint32_t, uint8_t
#include <stdlib.h> // size_t
@@ -59,4 +63,8 @@ void sha384_push(sha384_t * const, const uint8_t *, size_t);
void sha384_fini(sha384_t * const, uint8_t * const);
void sha384(const uint8_t * const, const size_t, uint8_t * const);
+#ifdef __cplusplus
+};
+#endif /* __cplusplus */
+
#endif /* SHA2_H_ */