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
......@@ -226,8 +226,11 @@ DISTFILES = $(SOURCES) $(HEADERS) getopt.h getopt_int.h \
$(des_headers) descore.README desdata.stamp \
aes-internal.h camellia-internal.h serpent-internal.h \
cast128_sboxes.h desinfo.h desCode.h \
ripemd160-internal.h sha2-internal.h \
memxor-internal.h nettle-internal.h nettle-write.h \
ctr-internal.h \
ctr-internal.h chacha-internal.h sha3-internal.h \
salsa20-internal.h umac-internal.h hogweed-internal.h \
rsa-internal.h dsa-internal.h eddsa-internal.h \
gmp-glue.h ecc-internal.h fat-setup.h \
mini-gmp.h asm.m4 \
nettle.texinfo nettle.info nettle.html nettle.pdf sha-example.c
......
......@@ -31,7 +31,7 @@ ifelse(<
not, see http://www.gnu.org/licenses/.
>)
dnl PROLOGUE(_nettle_sha1_compress) picked up by configure
dnl PROLOGUE(nettle_sha1_compress) picked up by configure
define(<fat_transform>, <$1_armv6>)
include_src(<arm/v6/sha1-compress.asm>)
......@@ -101,7 +101,7 @@ define(<ROUND3>, <
ror $2, $2, #2
add $5, $5, T0
>)
C void _nettle_sha1_compress(uint32_t *state, const uint8_t *input)
C void nettle_sha1_compress(uint32_t *state, const uint8_t *input)
.text
.align 2
......@@ -112,7 +112,7 @@ define(<ROUND3>, <
.LK3:
.int 0x8F1BBCDC
PROLOGUE(_nettle_sha1_compress)
PROLOGUE(nettle_sha1_compress)
push {r4,r5,r6,r7,r8,r10,lr}
sub sp, sp, #64
......@@ -246,7 +246,7 @@ IF_BE(< rsb SHIFT, SHIFT, #32>)
add sp, sp, #64
stm STATE, {SA,SB,SC,SD,SE}
pop {r4,r5,r6,r7,r8,r10,pc}
EPILOGUE(_nettle_sha1_compress)
EPILOGUE(nettle_sha1_compress)
.LK4:
.int 0xCA62C1D6
......@@ -109,13 +109,6 @@ nettle_random_prime(mpz_t p, unsigned bits, int top_bits_set,
void *ctx, nettle_random_func *random,
void *progress_ctx, nettle_progress_func *progress);
void
_nettle_generate_pocklington_prime (mpz_t p, mpz_t r,
unsigned bits, int top_bits_set,
void *ctx, nettle_random_func *random,
const mpz_t p0,
const mpz_t q,
const mpz_t p0q);
/* sexp parsing */
struct sexp_iterator;
......
......@@ -47,6 +47,7 @@
#include <string.h>
#include "chacha.h"
#include "chacha-internal.h"
#include "macros.h"
......
......@@ -47,6 +47,7 @@
#include <string.h>
#include "chacha.h"
#include "chacha-internal.h"
#include "macros.h"
#include "memxor.h"
......
/* chacha-internal.h
The ChaCha stream cipher.
Copyright (C) 2013 Joachim Strömbergson
Copyright (C) 2012 Simon Josefsson
Copyright (C) 2014 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_CHACHA_INTERNAL_H_INCLUDED
#define NETTLE_CHACHA_INTERNAL_H_INCLUDED
#include "nettle-types.h"
#define _chacha_core _nettle_chacha_core
void
_chacha_core(uint32_t *dst, const uint32_t *src, unsigned rounds);
#endif /* NETTLE_CHACHA_INTERNAL_H_INCLUDED */
......@@ -52,6 +52,7 @@
#include <assert.h>
#include <string.h>
#include "chacha-internal.h"
#include "chacha-poly1305.h"
#include "macros.h"
......
......@@ -47,7 +47,6 @@ extern "C" {
#define chacha_set_nonce nettle_chacha_set_nonce
#define chacha_set_nonce96 nettle_chacha_set_nonce96
#define chacha_crypt nettle_chacha_crypt
#define _chacha_core _nettle_chacha_core
/* Currently, only 256-bit keys are supported. */
#define CHACHA_KEY_SIZE 32
......@@ -86,9 +85,6 @@ void
chacha_crypt(struct chacha_ctx *ctx, size_t length,
uint8_t *dst, const uint8_t *src);
void
_chacha_core(uint32_t *dst, const uint32_t *src, unsigned rounds);
#ifdef __cplusplus
}
#endif
......
......@@ -42,6 +42,7 @@
#include "bignum.h"
#include "nettle-internal.h"
#include "hogweed-internal.h"
/* Valid sizes, according to FIPS 186-3 are (1024, 160), (2048, 224),
......
......@@ -34,6 +34,7 @@
#endif
#include "dsa.h"
#include "dsa-internal.h"
#include "bignum.h"
......
/* dsa-internal.h
The DSA publickey algorithm.
Copyright (C) 2002, 2013, 2014 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_DSA_INTERNAL_H_INCLUDED
#define NETTLE_DSA_INTERNAL_H_INCLUDED
#include "nettle-types.h"
#define _dsa_hash _nettle_dsa_hash
/* Internal functions. */
void
_dsa_hash (mpz_t h, unsigned bit_size,
size_t length, const uint8_t *digest);
#endif /* NETTLE_DSA_INTERNAL_H_INCLUDED */
......@@ -39,6 +39,7 @@
#include <stdlib.h>
#include "dsa.h"
#include "dsa-internal.h"
#include "bignum.h"
......
......@@ -38,6 +38,7 @@
#include <stdlib.h>
#include "dsa.h"
#include "dsa-internal.h"
#include "bignum.h"
......
......@@ -36,6 +36,7 @@
#endif
#include "dsa.h"
#include "dsa-internal.h"
#include "bignum.h"
......
......@@ -59,7 +59,6 @@ extern "C" {
#define dsa_public_key_from_der_iterator nettle_dsa_public_key_from_der_iterator
#define dsa_openssl_private_key_from_der_iterator nettle_dsa_openssl_private_key_from_der_iterator
#define dsa_openssl_private_key_from_der nettle_openssl_provate_key_from_der
#define _dsa_hash _nettle_dsa_hash
/* For FIPS approved parameters */
#define DSA_SHA1_MIN_P_BITS 512
......@@ -204,11 +203,6 @@ dsa_openssl_private_key_from_der(struct dsa_params *params,
size_t length, const uint8_t *data);
/* Internal functions. */
void
_dsa_hash (mpz_t h, unsigned bit_size,
size_t length, const uint8_t *digest);
#ifdef __cplusplus
}
#endif
......
......@@ -41,12 +41,6 @@ extern "C" {
/* The contents of this struct is internal. */
struct ecc_curve;
extern const struct ecc_curve _nettle_secp_192r1;
extern const struct ecc_curve _nettle_secp_224r1;
extern const struct ecc_curve _nettle_secp_256r1;
extern const struct ecc_curve _nettle_secp_384r1;
extern const struct ecc_curve _nettle_secp_521r1;
#ifdef __GNUC__
#define NETTLE_PURE __attribute__((pure))
#else
......
......@@ -73,6 +73,12 @@
#define sec_modinv _nettle_sec_modinv
#define curve25519_eh_to_x _nettle_curve25519_eh_to_x
extern const struct ecc_curve _nettle_secp_192r1;
extern const struct ecc_curve _nettle_secp_224r1;
extern const struct ecc_curve _nettle_secp_256r1;
extern const struct ecc_curve _nettle_secp_384r1;
extern const struct ecc_curve _nettle_secp_521r1;
/* Keep this structure internal for now. It's misnamed (since it's
really implementing the equivalent twisted Edwards curve, with
different coordinates). And we're not quite ready to provide
......
......@@ -34,6 +34,7 @@
#endif
#include "eddsa.h"
#include "eddsa-internal.h"
#include "ecc-internal.h"
#include "sha2.h"
......
......@@ -34,6 +34,7 @@
#endif
#include "eddsa.h"
#include "eddsa-internal.h"
#include "ecc-internal.h"
#include "sha2.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