Lines Matching refs:bn
65 mbedtls_mpi *bn = mempool_alloc(mbedtls_mpi_mempool, sizeof(*bn)); in init() local
67 if (!bn) in init()
70 mbedtls_mpi_init_mempool(bn); in init()
71 *a = bn; in init()
118 mbedtls_mpi bn = { .s = 1, .n = 1, .p = &p }; in set_int() local
120 if (mbedtls_mpi_copy(a, &bn)) in set_int()
127 mbedtls_mpi *bn = a; in get_int() local
129 if (!bn->n) in get_int()
132 return bn->p[bn->n - 1]; in get_int()
137 mbedtls_mpi *bn = a; in get_digit() local
141 if (n < 0 || (size_t)n >= bn->n) in get_digit()
144 return bn->p[n]; in get_digit()
170 mbedtls_mpi bn; in compare_d() local
172 mbedtls_mpi_init_mempool(&bn); in compare_d()
174 mbedtls_mpi_add_int(&bn, &bn, v & mask); in compare_d()
178 mbedtls_mpi_shift_l(&bn, shift); in compare_d()
181 int ret = compare(a, &bn); in compare_d()
183 mbedtls_mpi_free(&bn); in compare_d()
285 mbedtls_mpi bn = { .s = 1, .n = 1, .p = &p }; in addi() local
287 return add(a, &bn, c); in addi()
307 mbedtls_mpi bn = { .s = 1, .n = 1, .p = &p }; in subi() local
309 return sub(a, &bn, c); in subi()
751 mbedtls_mpi *bn = malloc(sizeof(*bn)); in crypto_bignum_allocate() local
753 if (!bn) in crypto_bignum_allocate()
756 mbedtls_mpi_init(bn); in crypto_bignum_allocate()
757 if (mbedtls_mpi_grow(bn, BITS_TO_LIMBS(size_bits))) { in crypto_bignum_allocate()
758 free(bn); in crypto_bignum_allocate()
762 return (struct bignum *)bn; in crypto_bignum_allocate()
776 mbedtls_mpi *bn = (mbedtls_mpi *)s; in crypto_bignum_clear() local
778 bn->s = 1; in crypto_bignum_clear()
779 if (bn->p) in crypto_bignum_clear()
780 memset(bn->p, 0, sizeof(*bn->p) * bn->n); in crypto_bignum_clear()