pubkey: Move sexp parsing for gcry_pk_get_nbits to the modules.
authorWerner Koch <wk@gnupg.org>
Tue, 8 Oct 2013 18:51:39 +0000 (20:51 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 8 Oct 2013 18:51:39 +0000 (20:51 +0200)
commit4645f3728bb0900591b0aef85831fdee52c59e3c
treed0d2a6fc2e05a181f0676bc868d8b2b98dcb3f35
parent3816e46ce211e63adf46dbc775510aa137572248
pubkey: Move sexp parsing for gcry_pk_get_nbits to the modules.

* cipher/pubkey.c (spec_from_sexp): New.
(gcry_pk_get_nbits): Simplify.
* cipher/rsa.c (rsa_get_nbits): Take only PARMS as args and do sexp
parsing here.
* cipher/dsa.c (dsa_get_nbits): Ditto.
* cipher/elgamal.c (elg_get_nbits): Ditto.
* cipher/ecc.c (ecc_get_nbits): Ditto.
* cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Allow NULL for arg
CURVE.
--

gcry_pk_get_nbits should now also be faster for ECC because there is
no more need to copy all the parms if a curve name has been given.

Signed-off-by: Werner Koch <wk@gnupg.org>
cipher/dsa.c
cipher/ecc-curves.c
cipher/ecc.c
cipher/elgamal.c
cipher/pubkey.c
cipher/rsa.c
src/cipher-proto.h