summaryrefslogtreecommitdiff
path: root/tests/t-convert.c
AgeCommit message (Collapse)AuthorFilesLines
2013-10-23mpi: Fix scanning of negative SSH formats and add more tests.Werner Koch1-34/+98
* mpi/mpicoder.c (gcry_mpi_scan): Fix sign setting for SSH format. * tests/t-convert.c (negative_zero): Test all formats. (check_formats): Add tests for PGP and scan tests for SSH and USG. * src/gcrypt.h.in (mpi_is_neg): Fix macro. * mpi/mpi-scan.c (_gcry_mpi_getbyte, _gcry_mpi_putbyte): Comment out these unused functions. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-09-17mpi: Support printing of negative numbers.Werner Koch1-5/+369
* 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>
2013-08-30mpi: Make gcry_mpi_print work with negative zeroes.Werner Koch1-0/+160
* mpi/mpicoder.c (gcry_mpi_print): Take care of negative zero. (gcry_mpi_aprint): Allocate at least 1 byte. * tests/t-convert.c: New. * tests/Makefile.am (TESTS): Add t-convert. -- Reported-by: Christian Fuchs Signed-off-by: Werner Koch <wk@gnupg.org>