Lines Matching refs:top
157 int i = a->top - 1; in bn_num_bits_consttime()
180 int i = a->top - 1; in BN_num_bits()
287 assert(b->top <= words); in bn_expand_internal()
288 if (b->top > 0) in bn_expand_internal()
289 memcpy(a, b->d, sizeof(*a) * b->top); in bn_expand_internal()
342 bn_words = BN_get_flags(b, BN_FLG_CONSTTIME) ? b->dmax : b->top; in BN_copy()
349 if (b->top > 0) in BN_copy()
353 a->top = b->top; in BN_copy()
378 tmp_top = a->top; in BN_swap()
383 a->top = b->top; in BN_swap()
388 b->top = tmp_top; in BN_swap()
406 a->top = 0; in BN_clear()
412 if (a->top > 1) in BN_get_word()
414 else if (a->top == 1) in BN_get_word()
427 a->top = (w ? 1 : 0); in BN_set_word()
450 ret->top = 0; in BN_bin2bn()
459 ret->top = i; in BN_bin2bn()
513 atop = a->top * BN_BYTES; in bn2binpad()
561 ret->top = 0; in BN_lebin2bn()
570 ret->top = i; in BN_lebin2bn()
623 i = a->top - b->top; in BN_ucmp()
628 for (i = a->top - 1; i >= 0; i--) { in BN_ucmp()
669 if (a->top > b->top) in BN_cmp()
671 if (a->top < b->top) in BN_cmp()
673 for (i = a->top - 1; i >= 0; i--) { in BN_cmp()
693 if (a->top <= i) { in BN_set_bit()
696 for (k = a->top; k < i + 1; k++) in BN_set_bit()
698 a->top = i + 1; in BN_set_bit()
717 if (a->top <= i) in BN_clear_bit()
734 if (a->top <= i) in BN_is_bit_set()
749 if (w >= a->top) in BN_mask_bits()
752 a->top = w; in BN_mask_bits()
754 a->top = w + 1; in BN_mask_bits()
839 t = (a->top ^ b->top) & condition; in BN_consttime_swap()
840 a->top ^= t; in BN_consttime_swap()
841 b->top ^= t; in BN_consttime_swap()
913 a->top = 0; in BN_zero_ex()
919 return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); in BN_abs_is_word()
924 return a->top == 0; in BN_is_zero()
939 return (a->top > 0) && (a->d[0] & 1); in BN_is_odd()
956 dest->top = b->top; in BN_with_flags()
1026 int tmp_top = a->top; in bn_correct_top()
1034 a->top = tmp_top; in bn_correct_top()
1036 if (a->top == 0) in bn_correct_top()