#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
unsigned length, uint8_t *dst,
const uint8_t *src);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_AES_H_INCLUDED */
#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
arcfour_stream(struct arcfour_ctx *ctx,
unsigned length, uint8_t *dst);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_ARCFOUR_H_INCLUDED */
#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
arctwo_decrypt (struct arctwo_ctx *ctx,
unsigned length, uint8_t *dst, const uint8_t *src);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_ARCTWO_H_INCLUDED */
#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
asn1_der_get_uint32(struct asn1_der_iterator *i,
uint32_t *x);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_ASN1_H_INCLUDED */
#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
int
base16_decode_final(struct base16_decode_ctx *ctx);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_BASE16_H_INCLUDED */
#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
int
base64_decode_final(struct base64_decode_ctx *ctx);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_BASE64_H_INCLUDED */
#include <gmp.h>
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Size needed for signed encoding, including extra sign byte if
* necessary. */
unsigned
nettle_asn1_der_get_bignum(struct asn1_der_iterator *iterator,
mpz_t x, unsigned limit);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_BIGNUM_H_INCLUDED */
#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
unsigned length, uint8_t *dst,
const uint8_t *src);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_BLOWFISH_H_INCLUDED */
#include "realloc.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct nettle_buffer
{
uint8_t *contents;
nettle_buffer_copy(struct nettle_buffer *dst,
const struct nettle_buffer *src);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_BUFFER_H_INCLUDED */
#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
unsigned length, uint8_t *dst,
const uint8_t *src);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_CAST128_H_INCLUDED */
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define cbc_encrypt nettle_cbc_encrypt
#define cbc_decrypt nettle_cbc_decrypt
sizeof((self)->iv), (self)->iv, \
(length), (dst), (src)))
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_CBC_H_INCLUDED */
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define ctr_crypt nettle_ctr_crypt
sizeof((self)->ctr), (self)->ctr, \
(length), (dst), (src)))
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_CTR_H_INCLUDED */
#include "des.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* We use some name mangling, to avoid collisions with either other
* nettle functions or with libcrypto. */
int
des_is_weak_key(const_des_cblock *key);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_DES_COMPAT_H_INCLUDED */
#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
unsigned length, uint8_t *dst,
const uint8_t *src);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_DES_H_INCLUDED */
/* 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
unsigned length, const uint8_t *expr);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_DSA_H_INCLUDED */
#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
hmac_sha256_digest(struct hmac_sha256_ctx *ctx,
unsigned length, uint8_t *digest);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_HMAC_H_INCLUDED */
#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
knuth_lfib_random(struct knuth_lfib_ctx *ctx,
unsigned n, uint8_t *dst);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_KNUTH_LFIB_H_INCLUDED */
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define md2_init nettle_md2_init
#define md2_update nettle_md2_update
uint8_t *digest);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_MD2_H_INCLUDED */
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define md4_init nettle_md4_init
#define md4_update nettle_md4_update
uint8_t *digest);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_MD4_H_INCLUDED */
#include "md5.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define MD5Init nettle_MD5Init
#define MD5Update nettle_MD5Update
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 */
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define md5_init nettle_md5_init
#define md5_update nettle_md5_update
void
_nettle_md5_compress(uint32_t *state, const uint8_t *data);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_MD5_H_INCLUDED */
#include <stdlib.h>
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
uint8_t *memxor(uint8_t *dst, const uint8_t *src, size_t n);
uint8_t *memxor3(uint8_t *dst, const uint8_t *a, const uint8_t *b, size_t n);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_MEMXOR_H_INCLUDED */
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Randomness. Used by key generation and dsa signature creation. */
typedef void (*nettle_random_func)(void *ctx,
unsigned length, uint8_t *dst);
extern const struct nettle_armor nettle_base64;
extern const struct nettle_armor nettle_base16;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_META_H_INCLUDED */
#include "nettle-stdint.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Uses a void * for cipher contexts.
For block ciphers it would make sense with a const void * for the
/* FIXME: Move more of the typedefs to this file? */
-#endif /* NETTLE_TYPES_H */
+#ifdef __cplusplus
+}
+#endif
+#endif /* NETTLE_TYPES_H */
mpz_t defined. We don't do that here, in order to kludge through
compilation without public key support and without gmp.h. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define pgp_put_uint32 nettle_pgp_put_uint32
#define pgp_put_uint16 nettle_pgp_put_uint16
PGP_SUBPACKET_REASON_FOR_REVOCATION = 29,
};
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_PGP_H_INCLUDED */
#include <gmp.h>
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define pkcs1_signature_prefix nettle_pkcs1_signature_prefix
#define pkcs1_rsa_md5_encode nettle_pkcs1_rsa_md5_encode
void
pkcs1_rsa_sha1_encode_digest(mpz_t m, unsigned length, const uint8_t *digest);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_PKCS1_H_INCLUDED */
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef void *nettle_realloc_func(void *ctx, void *p, unsigned length);
nettle_realloc_func nettle_realloc;
nettle_realloc_func nettle_xrealloc;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_REALLOC_H_INCLUDED */
#include "rsa.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define R_SignInit nettle_R_SignInit
#define R_SignUpdate nettle_R_SignUpdate
unsigned length,
R_RSA_PUBLIC_KEY *key);
+#ifdef __cplusplus
+}
+#endif
#endif /* NETTLE_RSA_COMPAT_H_INCLUDED */
-
/* For nettle_random_func */
#include "nettle-meta.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define rsa_public_key_init nettle_rsa_public_key_init
#define rsa_public_key_clear nettle_rsa_public_key_clear
unsigned
_rsa_check_size(mpz_t n);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_RSA_H_INCLUDED */
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define serpent_set_key nettle_serpent_set_key
#define serpent_encrypt nettle_serpent_encrypt
unsigned length, uint8_t *dst,
const uint8_t *src);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_SERPENT_H_INCLUDED */
#include <stdarg.h>
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define sexp_iterator_first nettle_sexp_iterator_first
#define sexp_transport_iterator_first nettle_sexp_transport_iterator_first
#define TOKEN_CHAR(c) ((c) < 0x80 && sexp_token_chars[(c)])
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_SEXP_H_INCLUDED */
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define sha1_init nettle_sha1_init
#define sha1_update nettle_sha1_update
unsigned length,
uint8_t *digest);
+#ifdef __cplusplus
+}
+#endif
#endif /* NETTLE_SHA_H_INCLUDED */
#include "nettle-meta.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void *
xalloc(size_t size);
#endif /* WITH_PUBLIC_KEY */
+#ifdef __cplusplus
+}
+#endif
+
#define H2(d, s) decode_hex((d), (s))
#define H(x) decode_hex_dup(x)
#define HL(x) decode_hex_length(x), decode_hex_dup(x)
#include "nettle-types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define twofish_set_key nettle_twofish_set_key
#define twofish_encrypt nettle_twofish_encrypt
unsigned length, uint8_t *dst,
const uint8_t *src);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_TWOFISH_H_INCLUDED */
#include "aes.h"
#include "sha.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Name mangling */
#define yarrow256_init nettle_yarrow256_init
#define yarrow256_seed nettle_yarrow256_seed
yarrow_key_event_estimate(struct yarrow_key_event_ctx *ctx,
unsigned key, unsigned time);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NETTLE_YARROW_COMPAT_H_INCLUDED */