Commit 82cb285e authored by Niels Möller's avatar Niels Möller
Browse files

Added C++ guards.

Rev: src/nettle/aes.h:1.8
Rev: src/nettle/arcfour.h:1.6
Rev: src/nettle/arctwo.h:1.3
Rev: src/nettle/asn1.h:1.3
Rev: src/nettle/base16.h:1.4
Rev: src/nettle/base64.h:1.15
Rev: src/nettle/bignum.h:1.11
Rev: src/nettle/blowfish.h:1.10
Rev: src/nettle/buffer.h:1.6
Rev: src/nettle/cast128.h:1.6
Rev: src/nettle/cbc.h:1.9
Rev: src/nettle/ctr.h:1.3
Rev: src/nettle/des-compat.h:1.13
Rev: src/nettle/des.h:1.11
Rev: src/nettle/dsa.h:1.10
Rev: src/nettle/hmac.h:1.6
Rev: src/nettle/knuth-lfib.h:1.4
Rev: src/nettle/md2.h:1.4
Rev: src/nettle/md4.h:1.4
Rev: src/nettle/md5-compat.h:1.3
Rev: src/nettle/md5.h:1.9
Rev: src/nettle/memxor.h:1.5
Rev: src/nettle/nettle-meta.h:1.15
Rev: src/nettle/nettle-types.h:1.2
Rev: src/nettle/pgp.h:1.8
Rev: src/nettle/pkcs1.h:1.4
Rev: src/nettle/realloc.h:1.3
Rev: src/nettle/rsa-compat.h:1.4
Rev: src/nettle/rsa.h:1.26
Rev: src/nettle/serpent.h:1.8
Rev: src/nettle/sexp.h:1.18
Rev: src/nettle/sha.h:1.7
Rev: src/nettle/testsuite/testutils.h:1.24
Rev: src/nettle/twofish.h:1.7
Rev: src/nettle/yarrow.h:1.12
parent f2b218bc
......@@ -28,6 +28,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define aes_set_encrypt_key nettle_aes_set_encrypt_key
#define aes_set_decrypt_key nettle_aes_set_decrypt_key
......@@ -65,4 +69,8 @@ aes_decrypt(struct aes_ctx *ctx,
unsigned length, uint8_t *dst,
const uint8_t *src);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_AES_H_INCLUDED */
......@@ -28,6 +28,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define arcfour_set_key nettle_arcfour_set_key
#define arcfour_crypt nettle_arcfour_crypt
......@@ -59,5 +63,9 @@ void
arcfour_stream(struct arcfour_ctx *ctx,
unsigned length, uint8_t *dst);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_ARCFOUR_H_INCLUDED */
......@@ -29,6 +29,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define arctwo_set_key nettle_arctwo_set_key
#define arctwo_set_key_ekb nettle_arctwo_set_key_ekb
......@@ -73,4 +77,8 @@ void
arctwo_decrypt (struct arctwo_ctx *ctx,
unsigned length, uint8_t *dst, const uint8_t *src);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_ARCTWO_H_INCLUDED */
......@@ -28,6 +28,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define asn1_der_iterator_first nettle_asn1_der_iterator_first
#define asn1_der_iterator_next nettle_asn1_der_iterator_next
......@@ -133,4 +137,8 @@ int
asn1_der_get_uint32(struct asn1_der_iterator *i,
uint32_t *x);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_ASN1_H_INCLUDED */
......@@ -29,6 +29,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define base16_encode_single nettle_base16_encode_single
#define base16_encode_update nettle_base16_encode_update
......@@ -95,4 +99,8 @@ base16_decode_update(struct base16_decode_ctx *ctx,
int
base16_decode_final(struct base16_decode_ctx *ctx);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_BASE16_H_INCLUDED */
......@@ -28,6 +28,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define base64_encode_init nettle_base64_encode_init
#define base64_encode_single nettle_base64_encode_single
......@@ -142,4 +146,8 @@ base64_decode_update(struct base64_decode_ctx *ctx,
int
base64_decode_final(struct base64_decode_ctx *ctx);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_BASE64_H_INCLUDED */
......@@ -31,6 +31,10 @@
#include <gmp.h>
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Size needed for signed encoding, including extra sign byte if
* necessary. */
unsigned
......@@ -94,4 +98,8 @@ int
nettle_asn1_der_get_bignum(struct asn1_der_iterator *iterator,
mpz_t x, unsigned limit);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_BIGNUM_H_INCLUDED */
......@@ -28,6 +28,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define blowfish_set_key nettle_blowfish_set_key
#define blowfish_encrypt nettle_blowfish_encrypt
......@@ -68,4 +72,8 @@ blowfish_decrypt(struct blowfish_ctx *ctx,
unsigned length, uint8_t *dst,
const uint8_t *src);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_BLOWFISH_H_INCLUDED */
......@@ -28,6 +28,10 @@
#include "realloc.h"
#ifdef __cplusplus
extern "C" {
#endif
struct nettle_buffer
{
uint8_t *contents;
......@@ -87,4 +91,8 @@ int
nettle_buffer_copy(struct nettle_buffer *dst,
const struct nettle_buffer *src);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_BUFFER_H_INCLUDED */
......@@ -34,6 +34,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define cast128_set_key nettle_cast128_set_key
#define cast128_encrypt nettle_cast128_encrypt
......@@ -66,4 +70,8 @@ cast128_decrypt(struct cast128_ctx *ctx,
unsigned length, uint8_t *dst,
const uint8_t *src);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_CAST128_H_INCLUDED */
......@@ -28,6 +28,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define cbc_encrypt nettle_cbc_encrypt
#define cbc_decrypt nettle_cbc_decrypt
......@@ -64,4 +68,8 @@ memcpy((ctx)->iv, (data), sizeof((ctx)->iv))
sizeof((self)->iv), (self)->iv, \
(length), (dst), (src)))
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_CBC_H_INCLUDED */
......@@ -29,6 +29,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define ctr_crypt nettle_ctr_crypt
......@@ -51,4 +55,8 @@ memcpy((ctx)->ctr, (data), sizeof((ctx)->ctr))
sizeof((self)->ctr), (self)->ctr, \
(length), (dst), (src)))
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_CTR_H_INCLUDED */
......@@ -35,6 +35,10 @@
#include "des.h"
#ifdef __cplusplus
extern "C" {
#endif
/* We use some name mangling, to avoid collisions with either other
* nettle functions or with libcrypto. */
......@@ -143,4 +147,8 @@ des_key_sched(const_des_cblock *key, des_key_schedule ctx);
int
des_is_weak_key(const_des_cblock *key);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_DES_COMPAT_H_INCLUDED */
......@@ -37,6 +37,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Namespace mangling */
#define des_set_key nettle_des_set_key
#define des_encrypt nettle_des_encrypt
......@@ -102,4 +106,8 @@ des3_decrypt(const struct des3_ctx *ctx,
unsigned length, uint8_t *dst,
const uint8_t *src);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_DES_H_INCLUDED */
......@@ -35,6 +35,10 @@
/* For nettle_random_func */
#include "nettle-meta.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define dsa_public_key_init nettle_dsa_public_key_init
#define dsa_public_key_clear nettle_dsa_public_key_clear
......@@ -191,4 +195,8 @@ dsa_keypair_from_sexp(struct dsa_public_key *pub,
unsigned length, const uint8_t *expr);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_DSA_H_INCLUDED */
......@@ -31,6 +31,10 @@
#include "md5.h"
#include "sha.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Namespace mangling */
#define hmac_set_key nettle_hmac_set_key
#define hmac_update nettle_hmac_update
......@@ -122,4 +126,8 @@ void
hmac_sha256_digest(struct hmac_sha256_ctx *ctx,
unsigned length, uint8_t *digest);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_HMAC_H_INCLUDED */
......@@ -33,6 +33,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Namespace mangling */
#define knuth_lfib_init nettle_knuth_lfib_init
#define knuth_lfib_get nettle_knuth_lfib_get
......@@ -64,4 +68,8 @@ void
knuth_lfib_random(struct knuth_lfib_ctx *ctx,
unsigned n, uint8_t *dst);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_KNUTH_LFIB_H_INCLUDED */
......@@ -28,6 +28,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define md2_init nettle_md2_init
#define md2_update nettle_md2_update
......@@ -58,4 +62,8 @@ md2_digest(struct md2_ctx *ctx,
uint8_t *digest);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_MD2_H_INCLUDED */
......@@ -28,6 +28,10 @@
#include "nettle-types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define md4_init nettle_md4_init
#define md4_update nettle_md4_update
......@@ -61,4 +65,8 @@ md4_digest(struct md4_ctx *ctx,
uint8_t *digest);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_MD4_H_INCLUDED */
......@@ -28,6 +28,10 @@
#include "md5.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define MD5Init nettle_MD5Init
#define MD5Update nettle_MD5Update
......@@ -39,4 +43,8 @@ void MD5Init(MD5_CTX *ctx);
void MD5Update(MD5_CTX *ctx, const unsigned char *data, unsigned int length);
void MD5Final(unsigned char *out, MD5_CTX *ctx);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_MD5_COMPAT_H_INCLUDED */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment