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
......@@ -98,11 +98,6 @@ extern "C" {
#define rsa_private_key_from_der_iterator nettle_rsa_private_key_from_der_iterator
#define rsa_keypair_from_der nettle_rsa_keypair_from_der
#define rsa_keypair_to_openpgp nettle_rsa_keypair_to_openpgp
#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
/* This limit is somewhat arbitrary. Technically, the smallest modulo
which makes sense at all is 15 = 3*5, phi(15) = 8, size 4 bits. But
......@@ -524,28 +519,6 @@ rsa_keypair_to_openpgp(struct nettle_buffer *buffer,
/* A single user id. NUL-terminated utf8. */
const char *userid);
/* 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);
#ifdef __cplusplus
}
......
......@@ -45,6 +45,7 @@
#include <string.h>
#include "salsa20.h"
#include "salsa20-internal.h"
#include "macros.h"
......
......@@ -44,6 +44,7 @@
#include <string.h>
#include "salsa20.h"
#include "salsa20-internal.h"
#include "macros.h"
#include "memxor.h"
......
/* salsa20-internal.h
The Salsa20 stream cipher.
Copyright (C) 2012 Simon Josefsson
Copyright (C) 2001 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_SALSA20_INTERNAL_H_INCLUDED
#define NETTLE_SALSA20_INTERNAL_H_INCLUDED
#include "nettle-types.h"
#define _salsa20_core _nettle_salsa20_core
void
_salsa20_core(uint32_t *dst, const uint32_t *src, unsigned rounds);
#endif /* NETTLE_SALSA20_INTERNAL_H_INCLUDED */
......@@ -47,7 +47,6 @@ extern "C" {
#define salsa20_256_set_key nettle_salsa20_256_set_key
#define salsa20_set_nonce nettle_salsa20_set_nonce
#define salsa20_crypt nettle_salsa20_crypt
#define _salsa20_core _nettle_salsa20_core
#define salsa20r12_crypt nettle_salsa20r12_crypt
......@@ -104,9 +103,6 @@ salsa20r12_crypt(struct salsa20_ctx *ctx,
size_t length, uint8_t *dst,
const uint8_t *src);
void
_salsa20_core(uint32_t *dst, const uint32_t *src, unsigned rounds);
#ifdef __cplusplus
}
#endif
......
......@@ -44,6 +44,7 @@
#include <string.h>
#include "salsa20.h"
#include "salsa20-internal.h"
#include "macros.h"
#include "memxor.h"
......
......@@ -142,7 +142,7 @@ _nettle_sha1_compress_c(uint32_t *state, const uint8_t *input);
sections, e.g. based on the four subrounds. */
void
_nettle_sha1_compress(uint32_t *state, const uint8_t *input)
nettle_sha1_compress(uint32_t *state, const uint8_t *input)
{
uint32_t data[SHA1_DATA_LENGTH];
uint32_t A, B, C, D, E; /* Local vars */
......
......@@ -68,7 +68,7 @@ sha1_init(struct sha1_ctx *ctx)
ctx->index = 0;
}
#define COMPRESS(ctx, data) (_nettle_sha1_compress((ctx)->state, data))
#define COMPRESS(ctx, data) (nettle_sha1_compress((ctx)->state, data))
void
sha1_update(struct sha1_ctx *ctx,
......@@ -93,7 +93,7 @@ sha1_digest(struct sha1_ctx *ctx,
/* append the 64 bit count */
WRITE_UINT64(ctx->block + (SHA1_BLOCK_SIZE - 8), bit_count);
_nettle_sha1_compress(ctx->state, ctx->block);
nettle_sha1_compress(ctx->state, ctx->block);
_nettle_write_be32(length, digest, ctx->state);
sha1_init(ctx);
......
......@@ -79,7 +79,9 @@ sha1_digest(struct sha1_ctx *ctx,
/* Internal compression function. STATE points to 5 uint32_t words,
and DATA points to 64 bytes of input data, possibly unaligned. */
void
_nettle_sha1_compress(uint32_t *state, const uint8_t *data);
nettle_sha1_compress(uint32_t *state, const uint8_t *data);
#define _nettle_sha1_compress nettle_sha1_compress
#ifdef __cplusplus
}
......
/* sha2-internal.h
The sha2 family of hash functions.
Copyright (C) 2001, 2012 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_SHA2_INTERNAL_H_INCLUDED
#define NETTLE_SHA2_INTERNAL_H_INCLUDED
#include "nettle-types.h"
/* Internal compression function. STATE points to 8 uint32_t words,
DATA points to 64 bytes of input data, possibly unaligned, and K
points to the table of constants. */
void
_nettle_sha256_compress(uint32_t *state, const uint8_t *data, const uint32_t *k);
/* Internal compression function. STATE points to 8 uint64_t words,
DATA points to 128 bytes of input data, possibly unaligned, and K
points to the table of constants. */
void
_nettle_sha512_compress(uint64_t *state, const uint8_t *data, const uint64_t *k);
#endif /* NETTLE_SHA2_INTERNAL_H_INCLUDED */
......@@ -91,12 +91,6 @@ sha256_digest(struct sha256_ctx *ctx,
size_t length,
uint8_t *digest);
/* Internal compression function. STATE points to 8 uint32_t words,
DATA points to 64 bytes of input data, possibly unaligned, and K
points to the table of constants. */
void
_nettle_sha256_compress(uint32_t *state, const uint8_t *data, const uint32_t *k);
/* SHA224, a truncated SHA256 with different initial state. */
......@@ -144,12 +138,6 @@ sha512_digest(struct sha512_ctx *ctx,
size_t length,
uint8_t *digest);
/* Internal compression function. STATE points to 8 uint64_t words,
DATA points to 128 bytes of input data, possibly unaligned, and K
points to the table of constants. */
void
_nettle_sha512_compress(uint64_t *state, const uint8_t *data, const uint64_t *k);
/* SHA384, a truncated SHA512 with different initial state. */
......
......@@ -53,6 +53,7 @@
#include <string.h>
#include "sha2.h"
#include "sha2-internal.h"
#include "macros.h"
......
......@@ -43,6 +43,7 @@
#include <string.h>
#include "sha2.h"
#include "sha2-internal.h"
#include "macros.h"
#include "nettle-write.h"
......
......@@ -36,6 +36,7 @@
#include "nettle-meta.h"
#include "sha3.h"
#include "sha3-internal.h"
const struct nettle_hash nettle_sha3_224
= _NETTLE_HASH(sha3_224, SHA3_224);
......@@ -39,6 +39,7 @@
#include <string.h>
#include "sha3.h"
#include "sha3-internal.h"
#include "nettle-write.h"
......
......@@ -36,6 +36,7 @@
#include "nettle-meta.h"
#include "sha3.h"
#include "sha3-internal.h"
const struct nettle_hash nettle_sha3_256
= _NETTLE_HASH(sha3_256, SHA3_256);
......@@ -39,6 +39,7 @@
#include <string.h>
#include "sha3.h"
#include "sha3-internal.h"
#include "nettle-write.h"
......
......@@ -36,6 +36,7 @@
#include "nettle-meta.h"
#include "sha3.h"
#include "sha3-internal.h"
const struct nettle_hash nettle_sha3_384
= _NETTLE_HASH(sha3_384, SHA3_384);
......@@ -39,6 +39,7 @@
#include <string.h>
#include "sha3.h"
#include "sha3-internal.h"
#include "nettle-write.h"
......
......@@ -36,6 +36,7 @@
#include "nettle-meta.h"
#include "sha3.h"
#include "sha3-internal.h"
const struct nettle_hash nettle_sha3_512
= _NETTLE_HASH(sha3_512, SHA3_512);
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