Add GCRYCTL_SET_ENFORCED_FIPS_FLAG command.

* doc/gcrypt.texi: Add documentation of the new command.
* src/fips.c (_gcry_enforced_fips_mode): Report the enforced fips mode
only when fips mode is enabled.
(_gcry_set_enforced_fips_mode): New function.
* src/g10lib.h: Add the _gcry_set_enforced_fips_mode prototype.
* src/gcrypt.h.in: Add the GCRYCTL_SET_ENFORCED_FIPS_FLAG.
* src/global.c (_gcry_vcontrol): Handle the new command.
State new contribution rules.

* doc/DCO: New.
* doc/HACKING: Document new rules.
Add authors with a DCO to AUTHORS.

--
Add curve aliases from RFC-5656.

* cipher/ecc.c (curve_aliases): Add "nistp???" entries.
Enable VIA Padlock on x86_64 platforms

  * cipher/rijndael.c: Duplicate x86 assembly and convert to x86_64.
  * random/rndhw.c: Likewise.
  * src/hwfeatures.c: Likewise.
--
Changes made to the x86 assembly:
- *l -> *q (long -> quad)
- e** registers -> r** registers (use widest registers available)
- don't mess with ebx GOT register

Tested with make check on VIA Nano X2 L4350

Signed-off-by: Rafaël Carré <funman@videolan.org>
Beautify last change.

* cipher/rijndael.c: Replace C99 feature from last patch.  Keep cpp
lines short.
* random/rndhw.c: Keep cpp lines short.
* src/hwfeatures.c (_gcry_detect_hw_features): Make cpp def chain
better readable.
Clear AESNI feature flag for x86_64.

* src/hwfeatures.c (_gcry_detect_hw_features) [__x86_64__]: Clear
AESNI feature flag.
Replace deliberate division by zero with _gcry_divide_by_zero.

* mpi/mpi-pow.c: Replace 1 / msize.
* mpi/mpih-div.c: Replace 1 / dsize.
* src/misc.c: Add _gcry_divide_by_zero.
--

1) Division by zero doesn't "provoke a signal" on architectures
   like PowerPC.

2) C compilers like clang will optimize away these divisions, even
   though the code tries "to make the compiler not remove" them.

This patch redirects these cases to _gcry_divide_by_zero.
PBKDF2: Allow empty passphrase.

* cipher/kdf.c (gcry_kdf_derive): Allow empty passphrase for PBKDF2.
* tests/t-kdf.c (check_pbkdf2): Add test case for above.
--

While it is insecure, the PBKDF2 implementations usually
allows to derive key only from salt.

This particular case is used e.g. in cryptsetup when
you use empty file as keyfile for LUKS keyslot.

Test vector is compared with two independent implementations.

Signed-off-by: Milan Broz <mbroz@redhat.com>
tests: Add ECC key generation tests.

* tests/keygen.c (check_generated_ecc_key): New.
(check_ecc_keys): New.
(main): Call simple ECC checks.
--

Although benchmark.c does ECC key generation, it does not call
gcry_pk_testkey.  We do it here.  Note that we should do some more
checks, for example checking that all curve parameters are available
and match the specs.
Fixed indentation of sexp.c

--

Some functions used to be intended the old way.  Changed this to GNU
style.
Make ancient test program useful again.

* tests/testapi.c (test_sexp): Adjust to current API.  Print the
return code.  Mark unused args.
(test_genkey): Mark unused args.
(main): Do not pass NULL to printf.
Avoid dereferencing pointer right after the end

* mpi/mpicoder.c (do_get_buffer): Check the length before derefing P.
--

Christian Grothoff found this bug using Valgrind.
Switch to the new automagic beta numbering scheme.

* configure.ac: Add all the required m4 magic.
Allow building with w64-mingw32

* autogen.sh <--build-w32>: Support the w64-mingw32 toolchain.  Also
prepare for 64 bit building.
<git-setup>: Remove option -c from chmod.
Do not distribute a copy of gitlog-to-changelog.

* Makefile.am (GITLOG_TO_CHANGELOG): New.
(gen-ChangeLog): Require an installed gitlog-to-changelog.
* scripts/gitlog-to-changelog: Remove.

* README.SVN: Remove.
* REMOVE.GIT: New.
Update build helper scripts

* config.guess, config.sub: Update to version 2012-07-31.
* ltmain.sh: Update to version 2.4.2.
* install-sh, m4/libtool.m4, m4/ltoptions.m4, m4/ltversion.m4
* m4/lt~obsolete.m4: Update to autoconf 2.69 versions.
Adjust for stricter autoconf requirements.

* configure.ac: Fix usage of AC_LANG_PROGRAM.
Prepare for a backported interface in 1.5.1.

* configure.ac: Bump LT version at C20/A0/R0 to adjust for a planned
API update in 1.5.1.
Fix memory leak in gcry_pk_testkey for ECC.

* cipher/ecc.c (check_secret_key): Restructure for easier allocation
tracking.  Fix memory leak.