OpenCoverage

bn_lcl.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/bn/bn_lcl.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5unsigned long bn_mul_add_words(unsigned long *rp, const unsigned long *ap, int num,-
6 unsigned long w);-
7unsigned long bn_mul_words(unsigned long *rp, const unsigned long *ap, int num, unsigned long w);-
8void bn_sqr_words(unsigned long *rp, const unsigned long *ap, int num);-
9unsigned long bn_div_words(unsigned long h, unsigned long l, unsigned long d);-
10unsigned long bn_add_words(unsigned long *rp, const unsigned long *ap, const unsigned long *bp,-
11 int num);-
12unsigned long bn_sub_words(unsigned long *rp, const unsigned long *ap, const unsigned long *bp,-
13 int num);-
14-
15struct bignum_st {-
16 unsigned long *d;-
17-
18 int top;-
19-
20 int dmax;-
21 int neg;-
22 int flags;-
23};-
24-
25-
26struct bn_mont_ctx_st {-
27 int ri;-
28 BIGNUM RR;-
29-
30 BIGNUM N;-
31 BIGNUM Ni;-
32-
33 unsigned long n0[2];-
34-
35-
36 int flags;-
37};-
38-
39-
40-
41-
42-
43struct bn_recp_ctx_st {-
44 BIGNUM N;-
45 BIGNUM Nr;-
46 int num_bits;-
47 int shift;-
48 int flags;-
49};-
50-
51-
52struct bn_gencb_st {-
53 unsigned int ver;-
54 void *arg;-
55 union {-
56-
57 void (*cb_1) (int, int, void *);-
58-
59 int (*cb_2) (int, int, BN_GENCB *);-
60 } cb;-
61};-
62void BN_RECP_CTX_init(BN_RECP_CTX *recp);-
63void BN_MONT_CTX_init(BN_MONT_CTX *ctx);-
64-
65void bn_init(BIGNUM *a);-
66void bn_mul_normal(unsigned long *r, unsigned long *a, int na, unsigned long *b, int nb);-
67void bn_mul_comba8(unsigned long *r, unsigned long *a, unsigned long *b);-
68void bn_mul_comba4(unsigned long *r, unsigned long *a, unsigned long *b);-
69void bn_sqr_normal(unsigned long *r, const unsigned long *a, int n, unsigned long *tmp);-
70void bn_sqr_comba8(unsigned long *r, const unsigned long *a);-
71void bn_sqr_comba4(unsigned long *r, const unsigned long *a);-
72int bn_cmp_words(const unsigned long *a, const unsigned long *b, int n);-
73int bn_cmp_part_words(const unsigned long *a, const unsigned long *b, int cl, int dl);-
74void bn_mul_recursive(unsigned long *r, unsigned long *a, unsigned long *b, int n2,-
75 int dna, int dnb, unsigned long *t);-
76void bn_mul_part_recursive(unsigned long *r, unsigned long *a, unsigned long *b,-
77 int n, int tna, int tnb, unsigned long *t);-
78void bn_sqr_recursive(unsigned long *r, const unsigned long *a, int n2, unsigned long *t);-
79void bn_mul_low_normal(unsigned long *r, unsigned long *a, unsigned long *b, int n);-
80void bn_mul_low_recursive(unsigned long *r, unsigned long *a, unsigned long *b, int n2,-
81 unsigned long *t);-
82unsigned long bn_sub_part_words(unsigned long *r, const unsigned long *a, const unsigned long *b,-
83 int cl, int dl);-
84int bn_mul_mont(unsigned long *rp, const unsigned long *ap, const unsigned long *bp,-
85 const unsigned long *np, const unsigned long *n0, int num);-
86-
87BIGNUM *int_bn_mod_inverse(BIGNUM *in,-
88 const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx,-
89 int *noinv);-
90-
91int bn_probable_prime_dh(BIGNUM *rnd, int bits,-
92 const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);-
93-
94static inline BIGNUM *bn_expand(BIGNUM *a, int bits)-
95{-
96 if (bits > (0x7fffffff - (8 * 8) + 1)
bits > (0x7fff...- (8 * 8) + 1)Description
TRUEnever evaluated
FALSEevaluated 97690369 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-97690369
97 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
98 ((void *)0)
never executed: return ((void *)0) ;
0
99 ;
never executed: return ((void *)0) ;
0
100-
101 if (((
((bits+(8 * 8)...) <= (a)->dmaxDescription
TRUEevaluated 96286538 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1403831 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
bits+(8 * 8)-1)/(8 * 8)) <= (a)->dmax
((bits+(8 * 8)...) <= (a)->dmaxDescription
TRUEevaluated 96286538 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1403831 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
1403831-96286538
102 return
executed 96286538 times by 2 tests: return a;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
a;
executed 96286538 times by 2 tests: return a;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
96286538
103-
104 return
executed 1403831 times by 2 tests: return bn_expand2((a),(bits+(8 * 8)-1)/(8 * 8));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
bn_expand2((a),(bits+(8 * 8)-1)/(8 * 8));
executed 1403831 times by 2 tests: return bn_expand2((a),(bits+(8 * 8)-1)/(8 * 8));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1403831
105}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2