Commit da81c86a authored by Nikos Mavrogiannopoulos's avatar Nikos Mavrogiannopoulos Committed by Niels Möller
Browse files

abi: explicitly export intended symbols and hide others

This adds all exported symbols in the map files explicitly under
the following rules:
 - Symbols mentioned in internal headers go in a section which is
   valid only for testing, and linking with these symbols will break
   in library updates.
 - Symbols mentioned in installed headers go in the exported sections
   and are considered part of the ABI.
 - All internal symbols move to internal headers.
 - The _nettle_md5_compress and _nettle_sha1_compress become exported
   without the _nettle prefix, due to existing usage.
parent 7ef18d1e
......@@ -37,6 +37,7 @@
#include <string.h>
#include "nettle-meta.h"
#include "nettle-internal.h"
const struct nettle_hash *
nettle_lookup_hash (const char *name)
......
......@@ -61,8 +61,6 @@ struct nettle_cipher
};
/* null-terminated list of ciphers implemented by this version of nettle */
extern const struct nettle_cipher * const _nettle_ciphers[];
const struct nettle_cipher * const *
#ifdef __GNUC__
__attribute__((pure))
......@@ -123,8 +121,6 @@ struct nettle_hash
}
/* null-terminated list of digests implemented by this version of nettle */
extern const struct nettle_hash * const _nettle_hashes[];
const struct nettle_hash * const *
#ifdef __GNUC__
__attribute__((pure))
......@@ -176,8 +172,6 @@ struct nettle_aead
/* null-terminated list of aead constructions implemented by this
version of nettle */
extern const struct nettle_aead * const _nettle_aeads[];
const struct nettle_aead * const *
#ifdef __GNUC__
__attribute__((pure))
......@@ -244,8 +238,6 @@ struct nettle_armor
}
/* null-terminated list of armor schemes implemented by this version of nettle */
extern const struct nettle_armor * const _nettle_armors[];
const struct nettle_armor * const *
#ifdef __GNUC__
__attribute__((pure))
......
......@@ -34,10 +34,10 @@
#endif
#include "pkcs1.h"
#include "bignum.h"
#include "gmp-glue.h"
#include "nettle-internal.h"
#include "hogweed-internal.h"
int
pkcs1_rsa_digest_encode(mpz_t m, size_t key_size,
......
......@@ -43,6 +43,7 @@
#include "bignum.h"
#include "pkcs1.h"
#include "hogweed-internal.h"
#include "gmp-glue.h"
......
......@@ -43,6 +43,7 @@
#include "bignum.h"
#include "pkcs1.h"
#include "hogweed-internal.h"
#include "gmp-glue.h"
......
......@@ -43,6 +43,7 @@
#include "bignum.h"
#include "pkcs1.h"
#include "hogweed-internal.h"
#include "gmp-glue.h"
......
......@@ -43,6 +43,7 @@
#include "bignum.h"
#include "pkcs1.h"
#include "hogweed-internal.h"
#include "gmp-glue.h"
......
......@@ -39,6 +39,7 @@
#include <string.h>
#include "pkcs1.h"
#include "hogweed-internal.h"
/* Formats the PKCS#1 padding, of the form
*
......
......@@ -42,7 +42,6 @@ extern "C" {
#endif
/* Name mangling */
#define _pkcs1_signature_prefix _nettle_pkcs1_signature_prefix
#define pkcs1_rsa_digest_encode nettle_pkcs1_rsa_digest_encode
#define pkcs1_rsa_md5_encode nettle_pkcs1_rsa_md5_encode
#define pkcs1_rsa_md5_encode_digest nettle_pkcs1_rsa_md5_encode_digest
......@@ -60,13 +59,6 @@ struct sha1_ctx;
struct sha256_ctx;
struct sha512_ctx;
uint8_t *
_pkcs1_signature_prefix(unsigned key_size,
uint8_t *buffer,
unsigned id_size,
const uint8_t *id,
unsigned digest_size);
int
pkcs1_encrypt (size_t key_size,
/* For padding */
......
/* ripemd160-internal.h
RIPEMD-160 hash function.
Copyright (C) 2011 Andres Mejia
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.
or both in parallel, as here.
GNU Nettle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
*/
#ifndef NETTLE_RIPEMD160_INTERNAL_H_INCLUDED
#define NETTLE_RIPEMD160_INTERNAL_H_INCLUDED
/* Internal compression function. STATE points to 5 uint32_t words,
and DATA points to 64 bytes of input data, possibly unaligned. */
void
_nettle_ripemd160_compress(uint32_t *state, const uint8_t *data);
#endif /* NETTLE_RIPEMD160_INTERNAL_H_INCLUDED */
......@@ -40,6 +40,7 @@
#include <assert.h>
#include "ripemd160.h"
#include "ripemd160-internal.h"
#include "macros.h"
#include "nettle-write.h"
......
......@@ -76,11 +76,6 @@ ripemd160_digest(struct ripemd160_ctx *ctx,
size_t length,
uint8_t *digest);
/* Internal compression function. STATE points to 5 uint32_t words,
and DATA points to 64 bytes of input data, possibly unaligned. */
void
_nettle_ripemd160_compress(uint32_t *state, const uint8_t *data);
#ifdef __cplusplus
}
#endif
......
......@@ -36,6 +36,7 @@
#endif
#include "rsa.h"
#include "rsa-internal.h"
#include "bignum.h"
......
......@@ -37,6 +37,7 @@
#endif
#include "rsa.h"
#include "rsa-internal.h"
#include "bignum.h"
#include "pkcs1.h"
......
......@@ -36,6 +36,7 @@
#endif
#include "rsa.h"
#include "rsa-internal.h"
#include "pkcs1.h"
......
/* rsa-internal.h
The RSA publickey algorithm.
Copyright (C) 2001, 2002 Niels Möller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.
or both in parallel, as here.
GNU Nettle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
*/
#ifndef NETTLE_RSA_INTERNAL_H_INCLUDED
#define NETTLE_RSA_INTERNAL_H_INCLUDED
#include "nettle-types.h"
#define _rsa_verify _nettle_rsa_verify
#define _rsa_verify_recover _nettle_rsa_verify_recover
#define _rsa_check_size _nettle_rsa_check_size
#define _rsa_blind _nettle_rsa_blind
#define _rsa_unblind _nettle_rsa_unblind
/* Internal functions. */
int
_rsa_verify(const struct rsa_public_key *key,
const mpz_t m,
const mpz_t s);
int
_rsa_verify_recover(const struct rsa_public_key *key,
mpz_t m,
const mpz_t s);
size_t
_rsa_check_size(mpz_t n);
/* _rsa_blind and _rsa_unblind are deprecated, unused in the library,
and will likely be removed with the next ABI break. */
void
_rsa_blind (const struct rsa_public_key *pub,
void *random_ctx, nettle_random_func *random,
mpz_t c, mpz_t ri);
void
_rsa_unblind (const struct rsa_public_key *pub, mpz_t c, const mpz_t ri);
#endif /* NETTLE_RSA_INTERNAL_H_INCLUDED */
......@@ -39,6 +39,7 @@
#include <stdlib.h>
#include "rsa.h"
#include "rsa-internal.h"
#include "bignum.h"
#ifndef DEBUG
......
......@@ -38,6 +38,7 @@
#include <assert.h>
#include "rsa.h"
#include "rsa-internal.h"
#include "bignum.h"
#include "pkcs1.h"
......
......@@ -38,6 +38,7 @@
#include <assert.h>
#include "rsa.h"
#include "rsa-internal.h"
#include "bignum.h"
#include "pkcs1.h"
......
......@@ -38,6 +38,7 @@
#include <assert.h>
#include "rsa.h"
#include "rsa-internal.h"
#include "bignum.h"
#include "pkcs1.h"
......
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