Add an API-alike equivalent library for openssl BIGNUM functionality.
This is accomplished using the libtommath MPI implementation
internally, without exporting any functions.  All of the BIGNUM
functionality to provide working netpgp signatures, verification,
encryption and encryption is provided.

Functions and macros included:

	BN_is_negative(x)
	BN_is_zero(a)
	BN_is_odd(a)
	BN_is_even(a)

	BIGNUM *BN_new(void);
	BIGNUM *BN_dup(const BIGNUM */*a*/);
	int BN_copy(BIGNUM */*b*/, const BIGNUM */*a*/);

	void BN_init(BIGNUM */*a*/);
	void BN_free(BIGNUM */*a*/);
	void BN_clear(BIGNUM */*a*/);
	void BN_clear_free(BIGNUM */*a*/);

	int BN_cmp(BIGNUM */*a*/, BIGNUM */*b*/);

	BIGNUM *BN_bin2bn(const uint8_t */*buf*/, int /*size*/, BIGNUM */*bn*/);
	int BN_bn2bin(const BIGNUM */*a*/, unsigned char */*b*/);
	char *BN_bn2hex(const BIGNUM */*a*/);
	char *BN_bn2dec(const BIGNUM */*a*/);
	int BN_hex2bn(BIGNUM **/*a*/, const char */*str*/);
	int BN_dec2bn(BIGNUM **/*a*/, const char */*str*/);
	int BN_print_fp(FILE */*fp*/, const BIGNUM */*a*/);

	int BN_add(BIGNUM */*r*/, const BIGNUM */*a*/, const BIGNUM */*b*/);
	int BN_sub(BIGNUM */*r*/, const BIGNUM */*a*/, const BIGNUM */*b*/);
	int BN_mul(BIGNUM */*r*/, const BIGNUM */*a*/, const BIGNUM */*b*/, BN_CTX */*ctx*/);
	int BN_div(BIGNUM */*q*/, BIGNUM */*r*/, const BIGNUM */*a*/, const BIGNUM */*b*/, BN_CTX */*ctx*/);
	void BN_swap(BIGNUM */*a*/, BIGNUM */*b*/);
	int BN_lshift(BIGNUM */*r*/, const BIGNUM */*a*/, int /*n*/);
	int BN_lshift1(BIGNUM */*r*/, BIGNUM */*a*/);
	int BN_rshift(BIGNUM */*r*/, const BIGNUM */*a*/, int /*n*/);
	int BN_rshift1(BIGNUM */*r*/, BIGNUM */*a*/);
	int BN_set_word(BIGNUM */*a*/, BN_ULONG /*w*/);
	void BN_set_negative(BIGNUM */*a*/, int /*n*/);

	int BN_num_bytes(const BIGNUM */*a*/);
	int BN_num_bits(const BIGNUM */*a*/);

	int BN_mod_exp(BIGNUM */*r*/, BIGNUM */*a*/, BIGNUM */*p*/, BIGNUM */*m*/, BN_CTX */*ctx*/);
	BIGNUM *BN_mod_inverse(BIGNUM */*ret*/, BIGNUM */*a*/, const BIGNUM */*n*/, BN_CTX */*ctx*/);
	int BN_mod_mul(BIGNUM */*ret*/, BIGNUM */*a*/, BIGNUM */*b*/, const BIGNUM */*m*/, BN_CTX */*ctx*/);
	int BN_mod_sub(BIGNUM */*r*/, BIGNUM */*a*/, BIGNUM */*b*/, const BIGNUM */*m*/, BN_CTX */*ctx*/);

	BN_CTX *BN_CTX_new(void);
	BIGNUM *BN_CTX_get(BN_CTX */*ctx*/);
	void BN_CTX_start(BN_CTX */*ctx*/);
	void BN_CTX_end(BN_CTX */*ctx*/);
	void BN_CTX_init(BN_CTX */*c*/);
	void BN_CTX_free(BN_CTX */*c*/);

	int BN_rand(BIGNUM */*rnd*/, int /*bits*/, int /*top*/, int /*bottom*/);
	int BN_rand_range(BIGNUM */*rnd*/, BIGNUM */*range*/);

	int BN_is_prime(const BIGNUM */*a*/, int /*checks*/, void (*callback)(int, int, void *), BN_CTX */*ctx*/, void */*cb_arg*/);

	const BIGNUM *BN_value_one(void);
	int BN_is_bit_set(const BIGNUM */*a*/, int /*n*/);
Add an API-alike equivalent for openssl cipher functionality.

The ciphers implemented are CAST5 and AES. Camellia code is present,
but has not been fully implemented yet.

The rijndael code is from the NetBSD kernel sources, the CAST source
is based on the libtomcrypt implementation (although the internal
methods of storing intermediate values has been modified to mimic
the openssl code, just in case someone is relying on internal state
for this - probably overkill, but whatever).
Move the existing netpgp library sources to the libnetpgp sub-directory.
Add the RSA and DSA signature code to the agc-netpgp-standalone branch.

Despite the library name, this library implements both RSA and DSA functionality.

XXX There is still some work to do on DSA signatures and verification. XXX
Add a library solely consisting of signature verification functions.

This is because verfiication is a much more common occurrence than signing,
and requires only public keys to accomplish. Keeping this in its own library
allows the small library to be linked into applications without also linking
every kind of other function.
reachover build infrastructure for standalone version of netpgp
Add reachover build infrastructure for lib components of netpgp
standalone
clean up a file which has now moved location
get rid of the old reachover infrastructure (which was horribly non-standard
anyway).

Replace with the new reachover build infrastructure for standalone netpgp
Reachover Makefile for the bin directory for standalone netpgp
Move the autoconf-generated config.h file to its destination in the reachover
infrastructure.
Fix an inverted test
Add the digest directory to make this compile correctly.
Now that idea is out of jail, add it as a cipher - requested by christos.

For all intents and purposes, AES will be used these days, but idea may
be used in legacy things, so mainly for completeness.
Split out the digest functionality into its own subdirectory.
Replace the netpgpverify command and libnetpgpverify in the
agc-netpgp-standalone branch with a completely rewritten "from the RFC
up" version designed to be small, standalone, and easy to maintain.

	% ldd bin/netpgpverify/netpgpverify
	bin/netpgpverify/netpgpverify:
		-lz.1 => /usr/lib/libz.so.1
		-lgcc_s.1 => /usr/lib/libgcc_s.so.1
		-lc.12 => /usr/lib/libc.so.12
		-lbz2.1 => /usr/lib/libbz2.so.1
		-lnetpgpverify.4 => /usr/lib/libnetpgpverify.so.4
	% ldd lib/verify/libnetpgpverify.so
	lib/verify/libnetpgpverify.so:
		-lc.12 => /usr/lib/libc.so.12
	% ls -al lib/verify/libnetpgpverify* bin/netpgpverify/netpgpverify
	-rwxr-xr-x  1 agc  agc   10502 Oct 18 20:59 bin/netpgpverify/netpgpverify
	-rw-r--r--  1 agc  agc  159720 Oct 18 20:59 lib/verify/libnetpgpverify.a
	-rw-r--r--  1 agc  agc    4822 Oct 18 20:59 lib/verify/libnetpgpverify.html3
	lrwxr-xr-x  1 agc  agc      22 Oct 18 20:59 lib/verify/libnetpgpverify.so -> libnetpgpverify.so.4.0
	lrwxr-xr-x  1 agc  agc      22 Oct 18 20:59 lib/verify/libnetpgpverify.so.4 -> libnetpgpverify.so.4.0
	-rwxr-xr-x  1 agc  agc  123069 Oct 18 20:59 lib/verify/libnetpgpverify.so.4.0
	-rw-r--r--  1 agc  agc  169696 Oct 18 20:59 lib/verify/libnetpgpverify_p.a
	-rw-r--r--  1 agc  agc  149968 Oct 18 20:59 lib/verify/libnetpgpverify_pic.a
	%

("Small" here includes the full BIGNUM/mpi functionality required to
verify signatures).

Instead of using extensive callbacks for input data, which have proved
to be fragile and difficult to maintain, as well as precluding uses
elsewhere, this uses straight mmaping of input files where possible,
and falls back to reading if unavailable.

RFC 4880 makes provision for two types of data to be signed, binary
data and text, and text is subject to modification of data before the
signature is made, and is usually opaque.  The new netpgpverify(1) can
handle this, our old version could not.  DSA signatures are not yet
supported -- watch this space -- but full RSA ones, including those of
text documents like the signed NetBSD release hashes (see PR
bin/46930) are recognised and are included in the regression tests.

	% env LD_LIBRARY_PATH=../../lib/verify ./netpgpverify < NetBSD-6.0_hashes.asc
	Good signature for [stdin] made Mon Oct 15 09:28:54 2012
	signature  4096/RSA (Encrypt or Sign) 064973ac4c4a706e 2009-06-23
	fingerprint:  ddee 2bdb 9c98 a0d1 d4fb dbf7 0649 73ac 4c4a 706e
	uid              NetBSD Security Officer <security-officer@NetBSD.org>
	encryption 4096/RSA (Encrypt or Sign) 9ff2c24fdf2ce620 2009-06-23 [Expiry 2019-06-21]
	fingerprint:  1915 0801 fbd8 f45d 89f2 0205 9ff2 c24f df2c e620

	%

Redirection from stdin is also supported, as are multiple files, and
detached signatures.  Another interesting use is to verify the
signatures, and to retrieve the data only if a signature matches -
this was the old "--cat" command to netpgpverify(1), and it has been
brought forward into the newer version.

	% env LD_LIBRARY_PATH=../../lib/verify ./netpgpverify -c cat det.sig | diff det -
	%

This is implemented as a library and a small program to call so
that it is easier to embed verification of signatures in scripting
languages, or other source code.
implement a new pgpv_get_verified() exported function, which returns the
data and its size to the caller.

implement pgpv_verify_print() in terms of pgpv_get_verified()
document pgpv_get_verified(), which returns data and size of verified
data.
add preliminary support for DSA signatures to libnetpgpverify(3) and
netpgpverify(1)
Get rid of a debugging inclusion which is no longer needed.