1 #include "tommath_private.h"
2 #ifdef BN_MP_FROM_SBIN_C
3 /* LibTomMath, multiple-precision integer library -- Tom St Denis */
4 /* SPDX-License-Identifier: Unlicense */
6 /* read signed bin, big endian, first byte is 0==positive or 1==negative */
7 mp_err mp_from_sbin(mp_int *a, const unsigned char *buf, size_t size)
12 if ((err = mp_from_ubin(a, buf + 1, size - 1u)) != MP_OKAY) {
16 /* first byte is 0 for positive, non-zero for negative */
17 if (buf[0] == (unsigned char)0) {