Artifact b9dc00a491d528790cae35a48b57659259a4cf1ba9c3f92d73fa06e2f59a291e:
- File libtommath/bn_mp_neg.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: 482) [annotate] [blame] [check-ins using] [more...]
#include "tommath_private.h" #ifdef BN_MP_NEG_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* b = -a */ mp_err mp_neg(const mp_int *a, mp_int *b) { mp_err err; if (a != b) { if ((err = mp_copy(a, b)) != MP_OKAY) { return err; } } if (!MP_IS_ZERO(b)) { b->sign = (a->sign == MP_ZPOS) ? MP_NEG : MP_ZPOS; } else { b->sign = MP_ZPOS; } return MP_OKAY; } #endif