mpi: Support printing of negative numbers.
authorWerner Koch <wk@gnupg.org>
Sat, 7 Sep 2013 08:06:46 +0000 (10:06 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 17 Sep 2013 13:22:15 +0000 (15:22 +0200)
commit89fe2173649a72019d75e059e6c6938efd10421f
tree2dca440a3424ed505d7015cdaf530f873b5b6467
parenta7a9cdcaaf3979baa18dad51e722882581349f45
mpi: Support printing of negative numbers.

* mpi/mpicoder.c (twocompl, onecompl): New.
(gcry_mpi_print): Use it for STD and SSH.
(gcry_mpi_scan): Use it for STD and SSH.  Always set NSCANNED.
(gcry_mpi_aprint): Clear the extra allocated byte.
* tests/t-convert.c (showhex, showmpi): New.
(mpi2bitstr_nlz): New.
(check_formats): New.
(main): Call new test.

Signed-off-by: Werner Koch <wk@gnupg.org>
NEWS
doc/gcrypt.texi
mpi/mpicoder.c
tests/t-convert.c