Artifact 4824984df98c07a15978275d5d3b18273cde20637925f4fa2e69aa708337f189:
- File libtommath/bn_mp_to_signed_bin.c — part of check-in [94cf70186e] at 2019-06-13 19:07:13 on branch libtommath — Update to latest libtommath's "develop" branch. On the way to 1.2.0 (user: jan.nijtmans, size: 466) [annotate] [blame] [check-ins using] [more...]
#include "tommath_private.h" #ifdef BN_MP_TO_SIGNED_BIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* store in signed [big endian] format */ mp_err mp_to_signed_bin(const mp_int *a, unsigned char *b) { mp_err err; if ((err = mp_to_unsigned_bin(a, b + 1)) != MP_OKAY) { return err; } b[0] = (a->sign == MP_ZPOS) ? (unsigned char)0 : (unsigned char)1; return MP_OKAY; } #endif