~ubuntu-branches/ubuntu/utopic/nettle/utopic

« back to all changes in this revision

Viewing changes to nettle-internal.h

  • Committer: Package Import Robot
  • Author(s): Magnus Holmgren
  • Date: 2013-05-07 22:57:14 UTC
  • mfrom: (8.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20130507225714-s331yr8ov53dtt17
Tags: 2.7-2
Tag some (ECC related) symbols that only exist on some architectures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
/* nettle, low-level cryptographics library
8
8
 *
9
 
 * Copyright (C) 2002 Niels M�ller
 
9
 * Copyright (C) 2002 Niels Möller
10
10
 *  
11
11
 * The nettle library is free software; you can redistribute it and/or modify
12
12
 * it under the terms of the GNU Lesser General Public License as published by
20
20
 * 
21
21
 * You should have received a copy of the GNU Lesser General Public License
22
22
 * along with the nettle library; see the file COPYING.LIB.  If not, write to
23
 
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
24
 
 * MA 02111-1307, USA.
 
23
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
24
 * MA 02111-1301, USA.
25
25
 */
26
26
 
27
27
#ifndef NETTLE_INTERNAL_H_INCLUDED
36
36
 
37
37
#if HAVE_ALLOCA
38
38
# define TMP_DECL(name, type, max) type *name
39
 
# define TMP_ALLOC(name, size) (name = alloca(sizeof (*name) * size))
 
39
# define TMP_ALLOC(name, size) (name = alloca(sizeof (*name) * (size)))
40
40
#else /* !HAVE_ALLOCA */
41
41
# define TMP_DECL(name, type, max) type name[max]
42
42
# define TMP_ALLOC(name, size) \
43
 
do { if (size > (sizeof(name) / sizeof(name[0]))) abort(); } while (0)
 
43
  do { if ((size) > (sizeof(name) / sizeof(name[0]))) abort(); } while (0)
44
44
#endif 
45
45
 
46
46
/* Arbitrary limits which apply to systems that don't have alloca */
47
47
#define NETTLE_MAX_BIGNUM_BITS 10000
 
48
#define NETTLE_MAX_BIGNUM_SIZE ((NETTLE_MAX_BIGNUM_BITS + 7)/8)
48
49
#define NETTLE_MAX_HASH_BLOCK_SIZE 128
49
50
#define NETTLE_MAX_HASH_DIGEST_SIZE 64
50
51
#define NETTLE_MAX_SEXP_ASSOC 17
59
60
 
60
61
extern const struct nettle_cipher nettle_blowfish128;
61
62
 
62
 
/* Glue to openssl, for comparative benchmarking. The corresponding
63
 
 * code is not included in the nettle library, as that would make the
64
 
 * shared library depend on openssl. Instead, look at
 
63
/* For benchmarking only, sets no iv and lies about the block size. */
 
64
extern const struct nettle_cipher nettle_salsa20;
 
65
extern const struct nettle_cipher nettle_salsa20r12;
 
66
 
 
67
/* Glue to openssl, for comparative benchmarking. Code in
65
68
 * examples/nettle-openssl.c. */
66
69
extern const struct nettle_cipher nettle_openssl_aes128;
67
70
extern const struct nettle_cipher nettle_openssl_aes192;