mpi: Introduce 4 user flags for gcry_mpi_t.

* src/gcrypt.h.in (GCRYMPI_FLAG_USER1, GCRYMPI_FLAG_USER2)
(GCRYMPI_FLAG_USER3, GCRYMPI_FLAG_USER4): New.
* mpi/mpiutil.c (gcry_mpi_set_flag, gcry_mpi_clear_flag)
(gcry_mpi_get_flag, _gcry_mpi_free): Implement them.
(gcry_mpi_set_opaque): Keep user flags.
--

The space for the flags in the MPI struct is free and thus we can help
applications to make use of some flags.  This is for example useful to
indicate that an MPI needs special processing before use.

Signed-off-by: Werner Koch <wk@gnupg.org>
ecc: Fix gcry_mpi_ec_curve_point for Weierstrass.

* mpi/ec.c (_gcry_mpi_ec_curve_point): Use correct equation.
(ec_pow3): New.
(ec_p_init): Always copy B.
--

The code path was obviously never tested.

Signed-off-by: Werner Koch <wk@gnupg.org>
ecc: Fix eddsa point decompression.

* cipher/ecc-eddsa.c (_gcry_ecc_eddsa_recover_x): Fix the negative
case.

Signed-off-by: Werner Koch <wk@gnupg.org>
ecc: Make gcry_pk_testkey work for Ed25519.

* cipher/ecc-misc.c (_gcry_ecc_compute_public): Add optional args G
and d.  Change all callers.
* cipher/ecc.c (gen_y_2): Remove.
(check_secret_key): Use generic public key compute function.  Adjust
for use with Ed25519 and EdDSA.
(nist_generate_key): Do not use the compliant key thingy for Ed25519.
(ecc_check_secret_key): Make parameter parsing similar to the other
functions.
* cipher/ecc-curves.c (domain_parms): Zero prefix some parameters so
that _gcry_ecc_update_curve_param works correctly.
* tests/keygen.c (check_ecc_keys): Add "param" flag.  Check all
Ed25519 keys.
ecc: Use constant time point operation for Twisted Edwards.

* mpi/ec.c (_gcry_mpi_ec_mul_point): Try to do a constant time
operation if needed.
* tests/benchmark.c (main): Add option --use-secmem.

Signed-off-by: Werner Koch <wk@gnupg.org>
Add aarch64 (arm64) mpi assembly

* mpi/aarch64/mpi-asm-defs.h: New.
* mpi/aarch64/mpih-add1.S: New.
* mpi/aarch64/mpih-mul1.S: New.
* mpi/aarch64/mpih-mul2.S: New.
* mpi/aarch64/mpih-mul3.S: New.
* mpi/aarch64/mpih-sub1.S: New.
* mpi/config.links [host=aarch64-*-*]: Add configguration for aarch64
assembly.
* mpi/longlong.h [__aarch64__] (add_ssaaaa, sub_ddmmss, umul_ppmm)
(count_leading_zeros): New.
--

Add preliminary aarch64 assembly implementations for mpi.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
rijndael: fix compiler warning on aarch64

* cipher/rijndael.c (do_setkey): Use braces for empty if statement
instead of semicolon.
--

Patch fixes following warning:

 rijndael.c: In function 'do_setkey':
 rijndael.c:507:9: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
          ;
          ^

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>