Commit d83027b1 authored by Daniel Kahn Gillmor's avatar Daniel Kahn Gillmor Committed by Niels Möller

Contributed by Daniel Kahn Gillmor:

* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added
meta-hash-test.c, meta-cipher-test.c, and meta-armor-test.c.

* nettle.texinfo: Document nettle_hashes and nettle_ciphers.

* nettle-meta.h: Declare algorithm lists nettle_ciphers,
nettle_hashes, nettle_armors.

* Makefile.in (nettle_SOURCES): Added nettle-meta-hashes.c,
nettle-meta-ciphers.c, and nettle-meta-armors.c.

* nettle-meta-armors.c: New file.
* nettle-meta-ciphers.c: New file.
* nettle-meta-hashes.c: New file.

Rev: nettle/ChangeLog:1.159
Rev: nettle/Makefile.in:1.32
Rev: nettle/nettle-meta-armors.c:1.1
Rev: nettle/nettle-meta-ciphers.c:1.1
Rev: nettle/nettle-meta-hashes.c:1.1
Rev: nettle/nettle-meta.h:1.10
Rev: nettle/nettle.texinfo:1.22
parent 392b6d7d
2011-03-23 Niels Mller <nisse@lysator.liu.se>
Contributed by Daniel Kahn Gillmor:
* testsuite/Makefile.in (TS_NETTLE_SOURCES): Added
meta-hash-test.c, meta-cipher-test.c, and meta-armor-test.c.
* testsuite/meta-hash-test.c: New file.
* testsuite/meta-cipher-test.c: New file.
* testsuite/meta-armor-test.c: New file.
* nettle.texinfo: Document nettle_hashes and nettle_ciphers.
* nettle-meta.h: Declare algorithm lists nettle_ciphers,
nettle_hashes, nettle_armors.
* Makefile.in (nettle_SOURCES): Added nettle-meta-hashes.c,
nettle-meta-ciphers.c, and nettle-meta-armors.c.
* nettle-meta-armors.c: New file.
* nettle-meta-ciphers.c: New file.
* nettle-meta-hashes.c: New file.
2011-02-18 Niels Mller <nisse@lysator.liu.se>
* arcfour.c (arcfour_stream): Deleted function. It's not very
......
......@@ -75,6 +75,8 @@ nettle_SOURCES = aes-decrypt-internal.c aes-decrypt.c \
twofish.c twofish-meta.c \
yarrow256.c yarrow_key_event.c \
buffer.c buffer-init.c realloc.c \
nettle-meta-hashes.c nettle-meta-ciphers.c \
nettle-meta-armors.c \
nettle-internal.c write-be32.c
hogweed_SOURCES = sexp.c sexp-format.c \
......
/* nettle-meta-armors.c */
/* nettle, low-level cryptographics library
*
* Copyright (C) 2011 Daniel Kahn Gillmor
*
* The nettle library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* The nettle library 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 Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the nettle library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stddef.h>
#include "nettle-meta.h"
const struct nettle_armor * const nettle_armors[] = {
&nettle_base64,
&nettle_base16,
NULL
};
/* nettle-meta-ciphers.c */
/* nettle, low-level cryptographics library
*
* Copyright (C) 2011 Daniel Kahn Gillmor
*
* The nettle library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* The nettle library 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 Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the nettle library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stddef.h>
#include "nettle-meta.h"
const struct nettle_cipher * const nettle_ciphers[] = {
&nettle_aes128,
&nettle_aes192,
&nettle_aes256,
&nettle_arcfour128,
&nettle_camellia128,
&nettle_camellia192,
&nettle_camellia256,
&nettle_cast128,
&nettle_serpent128,
&nettle_serpent192,
&nettle_serpent256,
&nettle_twofish128,
&nettle_twofish192,
&nettle_twofish256,
&nettle_arctwo40,
&nettle_arctwo64,
&nettle_arctwo128,
&nettle_arctwo_gutmann128,
NULL
};
/* nettle-meta-hashes.c */
/* nettle, low-level cryptographics library
*
* Copyright (C) 2011 Daniel Kahn Gillmor
*
* The nettle library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* The nettle library 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 Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the nettle library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stddef.h>
#include "nettle-meta.h"
const struct nettle_hash * const nettle_hashes[] = {
&nettle_md2,
&nettle_md4,
&nettle_md5,
&nettle_sha1,
&nettle_sha224,
&nettle_sha256,
&nettle_sha384,
&nettle_sha512,
NULL
};
......@@ -96,6 +96,9 @@ struct nettle_cipher
(nettle_crypt_func *) name##_decrypt, \
}
/* null-terminated list of ciphers implemented by this version of nettle */
extern const struct nettle_cipher * const nettle_ciphers[];
extern const struct nettle_cipher nettle_aes128;
extern const struct nettle_cipher nettle_aes192;
extern const struct nettle_cipher nettle_aes256;
......@@ -149,6 +152,9 @@ struct nettle_hash
(nettle_hash_digest_func *) name##_digest \
}
/* null-terminated list of digests implemented by this version of nettle */
extern const struct nettle_hash * const nettle_hashes[];
extern const struct nettle_hash nettle_md2;
extern const struct nettle_hash nettle_md4;
extern const struct nettle_hash nettle_md5;
......@@ -207,6 +213,9 @@ struct nettle_armor
(nettle_armor_decode_final_func *) name##_decode_final, \
}
/* null-terminated list of armor schemes implemented by this version of nettle */
extern const struct nettle_armor * const nettle_armors[];
extern const struct nettle_armor nettle_base64;
extern const struct nettle_armor nettle_base16;
......
......@@ -683,6 +683,12 @@ The last three attributes are function pointers, of types
@deftypevrx {Constant Struct} {struct nettle_hash} nettle_sha512
These are all the hash functions that Nettle implements.
Nettle also exports a list of all these hashes. This list can be used
to dynamically enumerate or search the supported algorithms:
@deftypevrx {Constant Struct} {struct nettle_hash **} nettle_hashes
@end deftypevr
@node Cipher functions, Cipher modes, Hash functions, Reference
......@@ -1330,6 +1336,13 @@ struct, which is of size @code{context_size}.
Nettle includes such structs for all the @emph{regular} ciphers, i.e.
ones without weak keys or other oddities.
Nettle also exports a list of all these ciphers without weak keys or
other oddities. This list can be used to dynamically enumerate or
search the supported algorithms:
@deftypevrx {Constant Struct} {struct nettle_cipher **} nettle_ciphers
@end deftypevr
@node Cipher modes, Keyed hash functions, Cipher functions, Reference
......
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