Lines Matching refs:bn
130 int BN_abs_is_word(const BIGNUM *bn, BN_ULONG w) { in BN_abs_is_word() argument
131 if (bn->width == 0) { in BN_abs_is_word()
134 BN_ULONG mask = bn->d[0] ^ w; in BN_abs_is_word()
135 for (int i = 1; i < bn->width; i++) { in BN_abs_is_word()
136 mask |= bn->d[i]; in BN_abs_is_word()
152 int BN_is_zero(const BIGNUM *bn) { in BN_is_zero() argument
153 return bn_fits_in_words(bn, 0); in BN_is_zero()
156 int BN_is_one(const BIGNUM *bn) { in BN_is_one() argument
157 return bn->neg == 0 && BN_abs_is_word(bn, 1); in BN_is_one()
160 int BN_is_word(const BIGNUM *bn, BN_ULONG w) { in BN_is_word() argument
161 return BN_abs_is_word(bn, w) && (w == 0 || bn->neg == 0); in BN_is_word()
164 int BN_is_odd(const BIGNUM *bn) { in BN_is_odd() argument
165 return bn->width > 0 && (bn->d[0] & 1) == 1; in BN_is_odd()
168 int BN_is_pow2(const BIGNUM *bn) { in BN_is_pow2() argument
169 int width = bn_minimal_width(bn); in BN_is_pow2()
170 if (width == 0 || bn->neg) { in BN_is_pow2()
175 if (bn->d[i] != 0) { in BN_is_pow2()
180 return 0 == (bn->d[width-1] & (bn->d[width-1] - 1)); in BN_is_pow2()