Lines Matching refs:r

14 int BN_lshift1(BIGNUM *r, const BIGNUM *a)  in BN_lshift1()  argument
19 bn_check_top(r); in BN_lshift1()
22 if (r != a) { in BN_lshift1()
23 r->neg = a->neg; in BN_lshift1()
24 if (bn_wexpand(r, a->top + 1) == NULL) in BN_lshift1()
26 r->top = a->top; in BN_lshift1()
28 if (bn_wexpand(r, a->top + 1) == NULL) in BN_lshift1()
32 rp = r->d; in BN_lshift1()
40 r->top += c; in BN_lshift1()
41 bn_check_top(r); in BN_lshift1()
45 int BN_rshift1(BIGNUM *r, const BIGNUM *a) in BN_rshift1() argument
50 bn_check_top(r); in BN_rshift1()
54 BN_zero(r); in BN_rshift1()
59 if (a != r) { in BN_rshift1()
60 if (bn_wexpand(r, i) == NULL) in BN_rshift1()
62 r->neg = a->neg; in BN_rshift1()
64 rp = r->d; in BN_rshift1()
65 r->top = i; in BN_rshift1()
69 r->top -= (t == 1); in BN_rshift1()
75 if (!r->top) in BN_rshift1()
76 r->neg = 0; /* don't allow negative zero */ in BN_rshift1()
77 bn_check_top(r); in BN_rshift1()
81 int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) in BN_lshift() argument
90 ret = bn_lshift_fixed_top(r, a, n); in BN_lshift()
92 bn_correct_top(r); in BN_lshift()
93 bn_check_top(r); in BN_lshift()
104 int bn_lshift_fixed_top(BIGNUM *r, const BIGNUM *a, int n) in bn_lshift_fixed_top() argument
113 bn_check_top(r); in bn_lshift_fixed_top()
117 if (bn_wexpand(r, a->top + nw + 1) == NULL) in bn_lshift_fixed_top()
127 t = &(r->d[nw]); in bn_lshift_fixed_top()
138 r->d[nw] = 0; in bn_lshift_fixed_top()
141 memset(r->d, 0, sizeof(*t) * nw); in bn_lshift_fixed_top()
143 r->neg = a->neg; in bn_lshift_fixed_top()
144 r->top = a->top + nw + 1; in bn_lshift_fixed_top()
145 r->flags |= BN_FLG_FIXED_TOP; in bn_lshift_fixed_top()
150 int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) in BN_rshift() argument
159 ret = bn_rshift_fixed_top(r, a, n); in BN_rshift()
161 bn_correct_top(r); in BN_rshift()
162 bn_check_top(r); in BN_rshift()
173 int bn_rshift_fixed_top(BIGNUM *r, const BIGNUM *a, int n) in bn_rshift_fixed_top() argument
180 bn_check_top(r); in bn_rshift_fixed_top()
188 BN_zero(r); in bn_rshift_fixed_top()
198 if (r != a && bn_wexpand(r, top) == NULL) in bn_rshift_fixed_top()
201 t = &(r->d[0]); in bn_rshift_fixed_top()
211 r->neg = a->neg; in bn_rshift_fixed_top()
212 r->top = top; in bn_rshift_fixed_top()
213 r->flags |= BN_FLG_FIXED_TOP; in bn_rshift_fixed_top()