Home GnuPG

mpi: Support printing of negative numbers.
89fe2173649aUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

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>

Details

Provenance
wernerAuthored on Sep 7 2013, 10:06 AM
Parents
rCa7a9cdcaaf39: Fix bug in _gcry_mpi_tdiv_q_2exp.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rC89fe2173649a: mpi: Support printing of negative numbers. (authored by Werner Koch <wk@gnupg.org>).Sep 17 2013, 3:22 PM