From: Loup Vaillant Date: Mon, 15 Jun 2020 21:54:21 +0000 (+0200) Subject: Added extern "C" to optional & deprecated files X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=e25d853ac2ae58602160e089964d2f048475bc9d;p=Monocypher.git Added extern "C" to optional & deprecated files --- diff --git a/src/deprecated/aead-incr.h b/src/deprecated/aead-incr.h index d9b9d48..c349b1f 100644 --- a/src/deprecated/aead-incr.h +++ b/src/deprecated/aead-incr.h @@ -92,6 +92,10 @@ #include #include "monocypher.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { crypto_poly1305_ctx poly; uint64_t ad_size; @@ -131,4 +135,8 @@ void crypto_unlock_update(crypto_unlock_ctx *ctx, size_t text_size); int crypto_unlock_final(crypto_unlock_ctx *ctx, const uint8_t mac[16]); +#ifdef __cplusplus +} +#endif + #endif // AEAD_INCR_H diff --git a/src/deprecated/chacha20.h b/src/deprecated/chacha20.h index fc8f063..5208a08 100644 --- a/src/deprecated/chacha20.h +++ b/src/deprecated/chacha20.h @@ -82,6 +82,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + // Chacha20 typedef struct { uint8_t key[32]; @@ -117,5 +121,8 @@ void crypto_chacha20_encrypt(crypto_chacha_ctx *ctx, void crypto_chacha20_stream(crypto_chacha_ctx *ctx, uint8_t *stream, size_t size); +#ifdef __cplusplus +} +#endif #endif // CHACHA20_H diff --git a/src/monocypher.h b/src/monocypher.h index 93e9950..f750552 100644 --- a/src/monocypher.h +++ b/src/monocypher.h @@ -358,5 +358,5 @@ void crypto_x25519_inverse(uint8_t blind_salt [32], #ifdef __cplusplus } #endif - + #endif // MONOCYPHER_H diff --git a/src/optional/monocypher-ed25519.h b/src/optional/monocypher-ed25519.h index 6f43c50..6a40703 100644 --- a/src/optional/monocypher-ed25519.h +++ b/src/optional/monocypher-ed25519.h @@ -56,6 +56,10 @@ #include "monocypher.h" +#ifdef __cplusplus +extern "C" { +#endif + //////////////////////// /// Type definitions /// //////////////////////// @@ -138,5 +142,8 @@ void crypto_ed25519_check_init(crypto_check_ctx_abstract *ctx, void crypto_from_ed25519_private(uint8_t x25519[32], const uint8_t eddsa[32]); #define crypto_from_ed25519_public crypto_from_eddsa_public +#ifdef __cplusplus +} +#endif #endif // ED25519_H