Lines Matching refs:bn
76 BIGNUM *bn = NULL; in BN_bin2bn() local
79 ret = bn = BN_new(); in BN_bin2bn()
94 if (bn) { in BN_bin2bn()
95 BN_free(bn); in BN_bin2bn()
122 BIGNUM *bn = NULL; in BN_le2bn() local
124 bn = BN_new(); in BN_le2bn()
125 ret = bn; in BN_le2bn()
141 BN_free(bn); in BN_le2bn()
256 char *BN_bn2hex(const BIGNUM *bn) { in BN_bn2hex() argument
258 bn->top * BN_BYTES * 2 + 1 /* trailing NUL */); in BN_bn2hex()
265 if (bn->neg) { in BN_bn2hex()
269 if (BN_is_zero(bn)) { in BN_bn2hex()
274 for (int i = bn->top - 1; i >= 0; i--) { in BN_bn2hex()
277 int v = ((int)(bn->d[i] >> (long)j)) & 0xff; in BN_bn2hex()
291 static int decode_hex(BIGNUM *bn, const char *in, int in_len) { in decode_hex() argument
297 if (bn_expand(bn, in_len * 4) == NULL) { in decode_hex()
329 bn->d[i++] = word; in decode_hex()
332 assert(i <= bn->dmax); in decode_hex()
333 bn->top = i; in decode_hex()
338 static int decode_dec(BIGNUM *bn, const char *in, int in_len) { in decode_dec() argument
352 if (!BN_mul_word(bn, BN_DEC_CONV) || in decode_dec()
353 !BN_add_word(bn, l)) { in decode_dec()
363 typedef int (*decode_func) (BIGNUM *bn, const char *in, int in_len);
560 BN_ULONG BN_get_word(const BIGNUM *bn) { in BN_get_word() argument
561 switch (bn->top) { in BN_get_word()
565 return bn->d[0]; in BN_get_word()
571 int BN_get_u64(const BIGNUM *bn, uint64_t *out) { in BN_get_u64() argument
572 switch (bn->top) { in BN_get_u64()
577 *out = bn->d[0]; in BN_get_u64()
581 *out = (uint64_t) bn->d[0] | (((uint64_t) bn->d[1]) << 32); in BN_get_u64()