cipher/gost28147: generate optimized s-boxes from compact ones

* cipher/gost-s-box.c: New. Outputs optimized expanded representation of
  s-boxes (4x256) from compact 16x8 representation.
* cipher/Makefile.am: Add gost-sb.h dependency to gost28147.lo
* cipher/gost.h: Add sbox to the GOST28147_context structure.
* cipher/gost28147.c (gost_setkey): Set default s-box to test s-box from
  GOST R 34.11 (this was the only one S-box before).
* cipher/gost28147.c (gost_val): Use sbox from the context.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Add GOST R 34.11-94 variant using id-GostR3411-94-CryptoProParamSet

* src/gcrypt.h.in (GCRY_MD_GOSTR3411_CP): New.
* src/cipher.h (_gcry_digest_spec_gost3411_cp): New.
* cipher/gost28147.c (_gcry_gost_enc_one): Differentiate between
  CryptoPro and Test S-Boxes.
* cipher/gostr3411-94.c (_gcry_digest_spec_gost3411_cp,
  gost3411_cp_init): New.
* cipher/md.c (md_open): GCRY_MD_GOSTR3411_CP also uses B=32.

--
RFC4357 defines only two S-Boxes that should be used together with
GOST R 34.11-94 - a testing one (from standard itself, for testing only)
and CryptoPro one. Instead of adding a separate gcry_md_ctrl() function
just to switch s-boxes, add a separate MD algorithm using CryptoPro
S-box.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Update PBKDF2 tests with GOST R 34.11-94 test cases

* tests/t-kdf.c (check_pbkdf2): Add MD_GOSTR3411_CP test cases.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
XXX: Add PBKDF2 tests for Stribog512 - failing for now

* tests/t-kdf.c (check_pbkdf2): Add Stribog512 test cases.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
XXX: ECC: GOST interprets numbers as LE, so we need to adapt

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
gost28147: add OIDs used to define cipher mode

* cipher/gost28147 (oids_gost28147): New.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
gostr3411_97: fixup for _CP

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Allow to use s-exp with hash with GOST signature code

* cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): set
  PUBKEY_FLAG_RAW_FLAG if 'gost' flag was parsed.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
gost flag fixup

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
stribog: change endianness

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
pubkey test: fixup curve name

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
tests: pass -no-install should be used for tests

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>