Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ec/ec_mult.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | struct ec_pre_comp_st { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 | const EC_GROUP *group; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 | size_t blocksize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5 | size_t numblocks; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 | size_t w; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8 | EC_POINT **points; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 | size_t num; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 | CRYPTO_REF_COUNT references; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
13 | CRYPTO_RWLOCK *lock; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
16 | static EC_PRE_COMP *ec_pre_comp_new(const EC_GROUP *group) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 | EC_PRE_COMP *ret = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
21 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | if (!group
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
24 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
26 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
27 | ret = CRYPTO_zalloc(sizeof(*ret), __FILE__, 52); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
28 | if (ret ==
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 | ((void *)0)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
30 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
31 | ERR_put_error(16,(196),((1|64)),__FILE__,54); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
32 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
34 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
35 | ret->group = group; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
36 | ret->blocksize = 8; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
37 | ret->w = 4; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
38 | ret->references = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
39 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
40 | ret->lock = CRYPTO_THREAD_lock_new(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
41 | if (ret->lock ==
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
42 | ((void *)0)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
43 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44 | ERR_put_error(16,(196),((1|64)),__FILE__,65); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
45 | CRYPTO_free(ret, __FILE__, 66); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
46 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
47 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
48 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
49 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
50 | return executed 45 times by 1 test: ret;return ret; Executed by:
executed 45 times by 1 test: return ret; Executed by:
| 45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
51 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
52 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
53 | EC_PRE_COMP *EC_ec_pre_comp_dup(EC_PRE_COMP *pre) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
54 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
55 | int i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
56 | if (pre !=
| 0-6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
57 | ((void *)0)
| 0-6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
58 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
59 | CRYPTO_UP_REF(&pre->references, &i, pre->lock); executed 6 times by 1 test: CRYPTO_UP_REF(&pre->references, &i, pre->lock); Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
60 | return executed 6 times by 1 test: pre;return pre; Executed by:
executed 6 times by 1 test: return pre; Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
61 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
62 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
63 | void EC_ec_pre_comp_free(EC_PRE_COMP *pre) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
64 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
65 | int i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
66 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
67 | if (pre ==
| 45-51 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
68 | ((void *)0)
| 45-51 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
69 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
70 | return; executed 45 times by 1 test: return; Executed by:
| 45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
71 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
72 | CRYPTO_DOWN_REF(&pre->references, &i, pre->lock); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
73 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
74 | if (i > 0
| 6-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
75 | return; executed 6 times by 1 test: return; Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
76 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
77 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
78 | if (pre->points !=
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
79 | ((void *)0)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
80 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
81 | EC_POINT **pts; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
82 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
83 | for (pts = pre->points; *
| 45-10992 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
84 | ((void *)0)
| 45-10992 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
85 | ; pts++) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
86 | EC_POINT_free(*pts); executed 10992 times by 1 test: EC_POINT_free(*pts); Executed by:
| 10992 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
87 | CRYPTO_free(pre->points, __FILE__, 98); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
88 | } executed 45 times by 1 test: end of block Executed by:
| 45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
89 | CRYPTO_THREAD_lock_free(pre->lock); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
90 | CRYPTO_free(pre, __FILE__, 101); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
91 | } executed 45 times by 1 test: end of block Executed by:
| 45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
92 | int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
93 | const BIGNUM *scalar, const EC_POINT *point, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
94 | BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
95 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
96 | int i, cardinality_bits, group_top, kbit, pbit, Z_is_one; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
97 | EC_POINT *p = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
98 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
99 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
100 | EC_POINT *s = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
101 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
102 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
103 | BIGNUM *k = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
104 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
105 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
106 | BIGNUM *lambda = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
107 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
108 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
109 | BIGNUM *cardinality = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
110 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
111 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
112 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
113 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
114 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
115 | if (point !=
| 2062-2075 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
116 | ((void *)0)
| 2062-2075 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
117 | && EC_POINT_is_at_infinity(group, point)
| 7-2068 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
118 | return executed 7 times by 1 test: EC_POINT_set_to_infinity(group, r);return EC_POINT_set_to_infinity(group, r); Executed by:
executed 7 times by 1 test: return EC_POINT_set_to_infinity(group, r); Executed by:
| 7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
119 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
120 | if (BN_is_zero(group->order)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
121 | ERR_put_error(16,(284),(114),__FILE__,156); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
122 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
123 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
124 | if (BN_is_zero(group->cofactor)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
125 | ERR_put_error(16,(284),(164),__FILE__,160); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
126 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
127 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
128 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
129 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
130 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
131 | if (((
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
132 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
133 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
134 | || ((
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
135 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
136 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
137 | ERR_put_error(16,(284),((1|64)),__FILE__,168); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
138 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
139 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
140 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
141 | if (point ==
| 2062-2068 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
142 | ((void *)0)
| 2062-2068 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
143 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
144 | if (!EC_POINT_copy(p, group->generator)
| 0-2062 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
145 | ERR_put_error(16,(284),(16),__FILE__,174); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
146 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
147 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
148 | } executed 2062 times by 2 tests: else {end of block Executed by:
| 2062 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
149 | if (!EC_POINT_copy(p, point)
| 0-2068 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
150 | ERR_put_error(16,(284),(16),__FILE__,179); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
151 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
152 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
153 | } executed 2068 times by 2 tests: end of block Executed by:
| 2068 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
154 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
155 | do { BN_set_flags((p)->X, (0x04)); BN_set_flags((p)->Y, (0x04)); BN_set_flags((p)->Z, (0x04)); } while(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
156 | do { BN_set_flags((r)->X, (0x04)); BN_set_flags((r)->Y, (0x04)); BN_set_flags((r)->Z, (0x04)); } while(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
157 | do { BN_set_flags((s)->X, (0x04)); BN_set_flags((s)->Y, (0x04)); BN_set_flags((s)->Z, (0x04)); } while(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
158 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
159 | cardinality = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
160 | lambda = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
161 | k = BN_CTX_get(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
162 | if (k ==
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
163 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
164 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
165 | ERR_put_error(16,(284),((1|64)),__FILE__,192); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
166 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
167 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
168 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
169 | if (!BN_mul(cardinality, group->order, group->cofactor, ctx)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
170 | ERR_put_error(16,(284),(3),__FILE__,197); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
171 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
172 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
173 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
174 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
175 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
176 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
177 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
178 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
179 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
180 | cardinality_bits = BN_num_bits(cardinality); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
181 | group_top = bn_get_top(cardinality); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
182 | if ((
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
183 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
184 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
185 | || (
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
186 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
187 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
188 | ERR_put_error(16,(284),(3),__FILE__,211); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
189 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
190 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
191 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
192 | if (!BN_copy(k, scalar)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
193 | ERR_put_error(16,(284),(3),__FILE__,216); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
194 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
195 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
196 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
197 | BN_set_flags(k, 0x04); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
198 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
199 | if ((
| 194-3715 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
200 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
201 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
202 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
203 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
204 | if (!BN_nnmod(k, k, cardinality, ctx)
| 0-609 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
205 | ERR_put_error(16,(284),(3),__FILE__,228); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
206 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
207 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
208 | } executed 609 times by 1 test: end of block Executed by:
| 609 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
209 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
210 | if (!BN_add(lambda, k, cardinality)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
211 | ERR_put_error(16,(284),(3),__FILE__,234); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
212 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
213 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
214 | BN_set_flags(lambda, 0x04); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
215 | if (!BN_add(k, lambda, cardinality)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
216 | ERR_put_error(16,(284),(3),__FILE__,239); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
217 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
218 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
219 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
220 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
221 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
222 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
223 | kbit = BN_is_bit_set(lambda, cardinality_bits); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
224 | BN_consttime_swap(kbit, k, lambda, group_top + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
225 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
226 | group_top = bn_get_top(group->field); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
227 | if ((
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
228 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
229 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
230 | || (
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
231 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
232 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
233 | || (
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
234 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
235 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
236 | || (
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
237 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
238 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
239 | || (
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
240 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
241 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
242 | || (
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
243 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
244 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
245 | || (
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
246 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
247 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
248 | || (
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
249 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
250 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
251 | || (
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
252 | ((void *)0)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
253 | )
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
254 | ERR_put_error(16,(284),(3),__FILE__,259); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
255 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
256 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
257 | if (!ec_point_blind_coordinates(group, p, ctx)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
258 | ERR_put_error(16,(284),(163),__FILE__,272); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
259 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
260 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
261 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
262 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
263 | if (!ec_point_ladder_pre(group, r, s, p, ctx)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
264 | ERR_put_error(16,(284),(153),__FILE__,278); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
265 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
266 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
267 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
268 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
269 | pbit = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
270 | for (i = cardinality_bits - 1; i >= 0
| 4130-1193659 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
271 | kbit = BN_is_bit_set(k, i) ^ pbit; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
272 | do { BN_consttime_swap(kbit, (r)->X, (s)->X, group_top); BN_consttime_swap(kbit, (r)->Y, (s)->Y, group_top); BN_consttime_swap(kbit, (r)->Z, (s)->Z, group_top); Z_is_one = ((r)->Z_is_one ^ (s)->Z_is_one) & (kbit); (r)->Z_is_one ^= (Z_is_one); (s)->Z_is_one ^= (Z_is_one); } while(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
273 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
274 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
275 | if (!ec_point_ladder_step(group, r, s, p, ctx)
| 0-1193659 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
276 | ERR_put_error(16,(284),(162),__FILE__,358); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
277 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
278 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
279 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
280 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
281 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
282 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
283 | pbit ^= kbit; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
284 | } executed 1193659 times by 2 tests: end of block Executed by:
| 1193659 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
285 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
286 | do { BN_consttime_swap(pbit, (r)->X, (s)->X, group_top); BN_consttime_swap(pbit, (r)->Y, (s)->Y, group_top); BN_consttime_swap(pbit, (r)->Z, (s)->Z, group_top); Z_is_one = ((r)->Z_is_one ^ (s)->Z_is_one) & (pbit); (r)->Z_is_one ^= (Z_is_one); (s)->Z_is_one ^= (Z_is_one); } while(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
287 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
288 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
289 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
290 | if (!ec_point_ladder_post(group, r, s, p, ctx)
| 0-4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
291 | ERR_put_error(16,(284),(136),__FILE__,373); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
292 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
293 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
294 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
295 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
296 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
297 | err: code before this statement executed 4130 times by 2 tests: err: Executed by:
| 4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
298 | EC_POINT_free(p); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
299 | EC_POINT_free(s); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
300 | BN_CTX_end(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
301 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
302 | return executed 4130 times by 2 tests: ret;return ret; Executed by:
executed 4130 times by 2 tests: return ret; Executed by:
| 4130 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
303 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
304 | int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
305 | size_t num, const EC_POINT *points[], const BIGNUM *scalars[], | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
306 | BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
307 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
308 | const EC_POINT *generator = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
309 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
310 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
311 | EC_POINT *tmp = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
312 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
313 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
314 | size_t totalnum; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
315 | size_t blocksize = 0, numblocks = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
316 | size_t pre_points_per_block = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
317 | size_t i, j; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
318 | int k; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
319 | int r_is_inverted = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
320 | int r_is_at_infinity = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
321 | size_t *wsize = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
322 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
323 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
324 | signed char **wNAF = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
325 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
326 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
327 | size_t *wNAF_len = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
328 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
329 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
330 | size_t max_len = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
331 | size_t num_val; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
332 | EC_POINT **val = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
333 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
334 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
335 | EC_POINT **v; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
336 | EC_POINT ***val_sub = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
337 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
338 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
339 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
340 | const EC_PRE_COMP *pre_comp = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
341 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
342 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
343 | int num_scalar = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
344 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
345 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
346 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
347 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
348 | if (!BN_is_zero(group->order)
| 0-2741 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
349 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
350 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
351 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
352 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
353 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
354 | if ((
| 1248-1461 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
355 | ((void *)0)
| 1248-1461 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
356 | )
| 304-1461 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
357 | return executed 1157 times by 2 tests: ec_scalar_mul_ladder(group, r, scalar, return ec_scalar_mul_ladder(group, r, scalar, ((void *)0) , ctx); Executed by:
executed 1157 times by 2 tests: return ec_scalar_mul_ladder(group, r, scalar, ((void *)0) , ctx); Executed by:
| 1157 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
358 | ((void *)0) executed 1157 times by 2 tests: return ec_scalar_mul_ladder(group, r, scalar, ((void *)0) , ctx); Executed by:
| 1157 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
359 | , ctx); executed 1157 times by 2 tests: return ec_scalar_mul_ladder(group, r, scalar, ((void *)0) , ctx); Executed by:
| 1157 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
360 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
361 | if ((
| 304-1248 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
362 | ((void *)0)
| 304-1248 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
363 | )
| 304-1248 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
364 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
365 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
366 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
367 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
368 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
369 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
370 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
371 | return executed 854 times by 2 tests: ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx);return ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx); Executed by:
executed 854 times by 2 tests: return ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx); Executed by:
| 854 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
372 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
373 | } executed 698 times by 2 tests: end of block Executed by:
| 698 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
374 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
375 | if (scalar !=
| 336-394 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
376 | ((void *)0)
| 336-394 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
377 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
378 | generator = EC_GROUP_get0_generator(group); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
379 | if (generator ==
| 0-336 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
380 | ((void *)0)
| 0-336 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
381 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
382 | ERR_put_error(16,(187),(113),__FILE__,470); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
383 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
384 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
385 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
386 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
387 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
388 | pre_comp = group->pre_comp.ec; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
389 | if (pre_comp
| 0-335 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
390 | && (
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
391 | 0)
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
392 | blocksize = pre_comp->blocksize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
393 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
394 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
395 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
396 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
397 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
398 | numblocks = (BN_num_bits(scalar) / blocksize) + 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
399 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
400 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
401 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
402 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
403 | if (numblocks > pre_comp->numblocks
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
404 | numblocks = pre_comp->numblocks; never executed: numblocks = pre_comp->numblocks; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
405 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
406 | pre_points_per_block = (size_t)1 << (pre_comp->w - 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
407 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
408 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
409 | if (pre_comp->num != (pre_comp->numblocks * pre_points_per_block)
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
410 | ERR_put_error(16,(187),((4|64)),__FILE__,498); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
411 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
412 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
413 | } executed 1 time by 1 test: else {end of block Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
414 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
415 | pre_comp = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
416 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
417 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
418 | numblocks = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
419 | num_scalar = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
420 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
421 | } executed 335 times by 2 tests: end of block Executed by:
| 335 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
422 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
423 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
424 | totalnum = num + numblocks; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
425 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
426 | wsize = CRYPTO_malloc(totalnum * sizeof(wsize[0]), __FILE__, 512); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
427 | wNAF_len = CRYPTO_malloc(totalnum * sizeof(wNAF_len[0]), __FILE__, 513); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
428 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
429 | wNAF = CRYPTO_malloc((totalnum + 1) * sizeof(wNAF[0]), __FILE__, 515); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
430 | val_sub = CRYPTO_malloc(totalnum * sizeof(val_sub[0]), __FILE__, 516); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
431 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
432 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
433 | if (wNAF !=
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
434 | ((void *)0)
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
435 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
436 | wNAF[0] = executed 730 times by 2 tests: wNAF[0] = ((void *)0) ; Executed by:
| 730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
437 | ((void *)0) executed 730 times by 2 tests: wNAF[0] = ((void *)0) ; Executed by:
| 730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
438 | ; executed 730 times by 2 tests: wNAF[0] = ((void *)0) ; Executed by:
| 730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
439 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
440 | if (wsize ==
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
441 | ((void *)0)
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
442 | || wNAF_len ==
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
443 | ((void *)0)
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
444 | || wNAF ==
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
445 | ((void *)0)
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
446 | || val_sub ==
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
447 | ((void *)0)
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
448 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
449 | ERR_put_error(16,(187),((1|64)),__FILE__,523); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
450 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
451 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
452 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
453 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
454 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
455 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
456 | num_val = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
457 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
458 | for (i = 0; i < num + num_scalar
| 730-2208 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
459 | size_t bits; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
460 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
461 | bits = i < num
| 335-1873 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
462 | wsize[i] = ((size_t) ((
| 0-2208 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
463 | num_val += (size_t)1 << (wsize[i] - 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
464 | wNAF[i + 1] = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
465 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
466 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
467 | wNAF[i] = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
468 | bn_compute_wNAF((i < num ? scalars[i] : scalar), wsize[i], | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
469 | &wNAF_len[i]); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
470 | if (wNAF[i] ==
| 0-2208 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
471 | ((void *)0)
| 0-2208 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
472 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
473 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
474 | if (wNAF_len[i] > max_len
| 1096-1112 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
475 | max_len = wNAF_len[i]; executed 1096 times by 2 tests: max_len = wNAF_len[i]; Executed by:
| 1096 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
476 | } executed 2208 times by 2 tests: end of block Executed by:
| 2208 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
477 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
478 | if (numblocks
| 336-394 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
479 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
480 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
481 | if (pre_comp ==
| 1-335 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
482 | ((void *)0)
| 1-335 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
483 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
484 | if (num_scalar != 1
| 0-335 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
485 | ERR_put_error(16,(187),((4|64)),__FILE__,553); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
486 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
487 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
488 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
489 | } executed 335 times by 2 tests: else {end of block Executed by:
| 335 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
490 | signed char *tmp_wNAF = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
491 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
492 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
493 | size_t tmp_len = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
494 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
495 | if (num_scalar != 0
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
496 | ERR_put_error(16,(187),((4|64)),__FILE__,562); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
497 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
498 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
499 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
500 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
501 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
502 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
503 | wsize[num] = pre_comp->w; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
504 | tmp_wNAF = bn_compute_wNAF(scalar, wsize[num], &tmp_len); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
505 | if (!tmp_wNAF
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
506 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
507 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
508 | if (tmp_len <= max_len
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
509 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
510 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
511 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
512 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
513 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
514 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
515 | numblocks = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
516 | totalnum = num + 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
517 | wNAF[num] = tmp_wNAF; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
518 | wNAF[num + 1] = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
519 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
520 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
521 | wNAF_len[num] = tmp_len; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
522 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
523 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
524 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
525 | val_sub[num] = pre_comp->points; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
526 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
527 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
528 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
529 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
530 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
531 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
532 | signed char *pp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
533 | EC_POINT **tmp_points; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
534 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
535 | if (tmp_len < numblocks * blocksize
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
536 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
537 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
538 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
539 | numblocks = (tmp_len + blocksize - 1) / blocksize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
540 | if (numblocks > pre_comp->numblocks
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
541 | ERR_put_error(16,(187),((4|64)),__FILE__,605); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
542 | CRYPTO_free(tmp_wNAF, __FILE__, 606); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
543 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
544 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
545 | totalnum = num + numblocks; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
546 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
547 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
548 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
549 | pp = tmp_wNAF; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
550 | tmp_points = pre_comp->points; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
551 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
552 | for (i = num; i < totalnum
| 1-66 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
553 | if (i < totalnum - 1
| 1-65 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
554 | wNAF_len[i] = blocksize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
555 | if (tmp_len < blocksize
| 0-65 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
556 | ERR_put_error(16,(187),((4|64)),__FILE__,620); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
557 | CRYPTO_free(tmp_wNAF, __FILE__, 621); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
558 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
559 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
560 | tmp_len -= blocksize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
561 | } executed 65 times by 1 test: elseend of block Executed by:
| 65 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
562 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
563 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
564 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
565 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
566 | wNAF_len[i] = tmp_len; executed 1 time by 1 test: wNAF_len[i] = tmp_len; Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
567 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
568 | wNAF[i + 1] = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
569 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
570 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
571 | wNAF[i] = CRYPTO_malloc(wNAF_len[i], __FILE__, 633); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
572 | if (wNAF[i] ==
| 0-66 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
573 | ((void *)0)
| 0-66 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
574 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
575 | ERR_put_error(16,(187),((1|64)),__FILE__,635); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
576 | CRYPTO_free(tmp_wNAF, __FILE__, 636); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
577 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
578 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
579 | memcpy(wNAF[i], pp, wNAF_len[i]); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
580 | if (wNAF_len[i] > max_len
| 0-66 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
581 | max_len = wNAF_len[i]; never executed: max_len = wNAF_len[i]; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
582 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
583 | if (*
| 0-66 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
584 | ((void *)0)
| 0-66 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
585 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
586 | ERR_put_error(16,(187),((4|64)),__FILE__,644); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
587 | CRYPTO_free(tmp_wNAF, __FILE__, 645); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
588 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
589 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
590 | val_sub[i] = tmp_points; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
591 | tmp_points += pre_points_per_block; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
592 | pp += blocksize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
593 | } executed 66 times by 1 test: end of block Executed by:
| 66 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
594 | CRYPTO_free(tmp_wNAF, __FILE__, 652); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
595 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
596 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
597 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
598 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
599 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
600 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
601 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
602 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
603 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
604 | val = CRYPTO_malloc((num_val + 1) * sizeof(val[0]), __FILE__, 662); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
605 | if (val ==
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
606 | ((void *)0)
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
607 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
608 | ERR_put_error(16,(187),((1|64)),__FILE__,664); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
609 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
610 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
611 | val[num_val] = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
612 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
613 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
614 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
615 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
616 | v = val; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
617 | for (i = 0; i < num + num_scalar
| 730-2208 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
618 | val_sub[i] = v; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
619 | for (j = 0; j < ((size_t)1 << (wsize[i] - 1))
| 2208-11700 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
620 | *v = EC_POINT_new(group); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
621 | if (*
| 0-11700 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
622 | ((void *)0)
| 0-11700 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
623 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
624 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
625 | v++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
626 | } executed 11700 times by 2 tests: end of block Executed by:
| 11700 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
627 | } executed 2208 times by 2 tests: end of block Executed by:
| 2208 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
628 | if (!(v == val + num_val)
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
629 | ERR_put_error(16,(187),((4|64)),__FILE__,681); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
630 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
631 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
632 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
633 | if ((
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
634 | ((void *)0)
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
635 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
636 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
637 | for (i = 0; i < num + num_scalar
| 730-2208 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
638 | if (i < num
| 335-1873 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
639 | if (!EC_POINT_copy(val_sub[i][0], points[i])
| 0-1873 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
640 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
641 | } executed 1873 times by 2 tests: else {end of block Executed by:
| 1873 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
642 | if (!EC_POINT_copy(val_sub[i][0], generator)
| 0-335 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
643 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
644 | } executed 335 times by 2 tests: end of block Executed by:
| 335 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
645 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
646 | if (wsize[i] > 1
| 454-1754 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
647 | if (!EC_POINT_dbl(group, tmp, val_sub[i][0], ctx)
| 0-1754 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
648 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
649 | for (j = 1; j < ((size_t)1 << (wsize[i] - 1))
| 1754-9492 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
650 | if (!EC_POINT_add
| 0-9492 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
651 | (group, val_sub[i][j], val_sub[i][j - 1], tmp, ctx)
| 0-9492 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
652 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
653 | } executed 9492 times by 2 tests: end of block Executed by:
| 9492 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
654 | } executed 1754 times by 2 tests: end of block Executed by:
| 1754 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
655 | } executed 2208 times by 2 tests: end of block Executed by:
| 2208 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
656 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
657 | if (!EC_POINTs_make_affine(group, num_val, val, ctx)
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
658 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
659 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
660 | r_is_at_infinity = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
661 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
662 | for (k = max_len - 1; k >= 0
| 730-190855 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
663 | if (!r_is_at_infinity
| 730-190125 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
664 | if (!EC_POINT_dbl(group, r, r, ctx)
| 0-190125 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
665 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
666 | } executed 190125 times by 2 tests: end of block Executed by:
| 190125 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
667 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
668 | for (i = 0; i < totalnum
| 190855-799546 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
669 | if (wNAF_len[i] > (size_t)k
| 189321-610225 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
670 | int digit = wNAF[i][k]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
671 | int is_neg; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
672 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
673 | if (digit
| 89410-520815 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
674 | is_neg = digit < 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
675 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
676 | if (is_neg
| 43884-45526 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
677 | digit = -digit; executed 43884 times by 2 tests: digit = -digit; Executed by:
| 43884 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
678 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
679 | if (is_neg != r_is_inverted
| 26339-63071 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
680 | if (!r_is_at_infinity
| 2-26337 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
681 | if (!EC_POINT_invert(group, r, ctx)
| 0-26337 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
682 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
683 | } executed 26337 times by 2 tests: end of block Executed by:
| 26337 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
684 | r_is_inverted = !r_is_inverted; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
685 | } executed 26339 times by 2 tests: end of block Executed by:
| 26339 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
686 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
687 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
688 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
689 | if (r_is_at_infinity
| 727-88683 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
690 | if (!EC_POINT_copy(r, val_sub[i][digit >> 1])
| 0-727 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
691 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
692 | r_is_at_infinity = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
693 | } executed 727 times by 2 tests: else {end of block Executed by:
| 727 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
694 | if (!EC_POINT_add
| 0-88683 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
695 | (group, r, r, val_sub[i][digit >> 1], ctx)
| 0-88683 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
696 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
697 | } executed 88683 times by 2 tests: end of block Executed by:
| 88683 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
698 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
699 | } executed 610225 times by 2 tests: end of block Executed by:
| 610225 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
700 | } executed 799546 times by 2 tests: end of block Executed by:
| 799546 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
701 | } executed 190855 times by 2 tests: end of block Executed by:
| 190855 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
702 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
703 | if (r_is_at_infinity
| 3-727 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
704 | if (!EC_POINT_set_to_infinity(group, r)
| 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
705 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
706 | } executed 3 times by 1 test: else {end of block Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
707 | if (r_is_inverted
| 263-464 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
708 | if (!EC_POINT_invert(group, r, ctx)
| 0-263 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
709 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
710 | } executed 727 times by 2 tests: end of block Executed by:
| 727 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
711 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
712 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
713 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
714 | err: code before this statement executed 730 times by 2 tests: err: Executed by:
| 730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
715 | EC_POINT_free(tmp); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
716 | CRYPTO_free(wsize, __FILE__, 774); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
717 | CRYPTO_free(wNAF_len, __FILE__, 775); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
718 | if (wNAF !=
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
719 | ((void *)0)
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
720 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
721 | signed char **w; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
722 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
723 | for (w = wNAF; *
| 730-2274 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
724 | ((void *)0)
| 730-2274 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
725 | ; w++) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
726 | CRYPTO_free(*w, __FILE__, 780); executed 2274 times by 2 tests: CRYPTO_free(*w, __FILE__, 780); Executed by:
| 2274 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
727 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
728 | CRYPTO_free(wNAF, __FILE__, 782); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
729 | } executed 730 times by 2 tests: end of block Executed by:
| 730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
730 | if (val !=
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
731 | ((void *)0)
| 0-730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
732 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
733 | for (v = val; *
| 730-11700 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
734 | ((void *)0)
| 730-11700 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
735 | ; v++) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
736 | EC_POINT_clear_free(*v); executed 11700 times by 2 tests: EC_POINT_clear_free(*v); Executed by:
| 11700 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
737 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
738 | CRYPTO_free(val, __FILE__, 788); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
739 | } executed 730 times by 2 tests: end of block Executed by:
| 730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
740 | CRYPTO_free(val_sub, __FILE__, 790); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
741 | return executed 730 times by 2 tests: ret;return ret; Executed by:
executed 730 times by 2 tests: return ret; Executed by:
| 730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
742 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
743 | int ec_wNAF_precompute_mult(EC_GROUP *group, BN_CTX *ctx) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
744 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
745 | const EC_POINT *generator; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
746 | EC_POINT *tmp_point = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
747 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
748 | , *base = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
749 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
750 | , **var; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
751 | BN_CTX *new_ctx = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
752 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
753 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
754 | const BIGNUM *order; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
755 | size_t i, bits, w, pre_points_per_block, blocksize, numblocks, num; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
756 | EC_POINT **points = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
757 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
758 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
759 | EC_PRE_COMP *pre_comp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
760 | int ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
761 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
762 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
763 | EC_pre_comp_free(group); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
764 | if ((
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
765 | ((void *)0)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
766 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
767 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
768 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
769 | generator = EC_GROUP_get0_generator(group); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
770 | if (generator ==
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
771 | ((void *)0)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
772 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
773 | ERR_put_error(16,(188),(113),__FILE__,832); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
774 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
775 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
776 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
777 | if (ctx ==
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
778 | ((void *)0)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
779 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
780 | ctx = new_ctx = BN_CTX_new(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
781 | if (ctx ==
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
782 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
783 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
784 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
785 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
786 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
787 | BN_CTX_start(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
788 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
789 | order = EC_GROUP_get0_order(group); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
790 | if (order ==
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
791 | ((void *)0)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
792 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
793 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
794 | if (BN_is_zero(order)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
795 | ERR_put_error(16,(188),(114),__FILE__,848); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
796 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
797 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
798 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
799 | bits = BN_num_bits(order); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
800 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
801 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
802 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
803 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
804 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
805 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
806 | blocksize = 8; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
807 | w = 4; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
808 | if (((
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
809 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
810 | w = ((size_t) ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
811 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
812 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
813 | numblocks = (bits + blocksize - 1) / blocksize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
814 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
815 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
816 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
817 | pre_points_per_block = (size_t)1 << (w - 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
818 | num = pre_points_per_block * numblocks; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
819 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
820 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
821 | points = CRYPTO_malloc(sizeof(*points) * (num + 1), __FILE__, 874); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
822 | if (points ==
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
823 | ((void *)0)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
824 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
825 | ERR_put_error(16,(188),((1|64)),__FILE__,876); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
826 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
827 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
828 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
829 | var = points; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
830 | var[num] = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
831 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
832 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
833 | for (i = 0; i < num
| 45-10992 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
834 | if ((
| 0-10992 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
835 | ((void *)0)
| 0-10992 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
836 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
837 | ERR_put_error(16,(188),((1|64)),__FILE__,884); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
838 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
839 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
840 | } executed 10992 times by 1 test: end of block Executed by:
| 10992 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
841 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
842 | if ((
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
843 | ((void *)0)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
844 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
845 | || (
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
846 | ((void *)0)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
847 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
848 | ERR_put_error(16,(188),((1|64)),__FILE__,891); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
849 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
850 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
851 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
852 | if (!EC_POINT_copy(base, generator)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
853 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
854 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
855 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
856 | for (i = 0; i < numblocks
| 45-1374 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
857 | size_t j; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
858 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
859 | if (!EC_POINT_dbl(group, tmp_point, base, ctx)
| 0-1374 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
860 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
861 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
862 | if (!EC_POINT_copy(*var++, base)
| 0-1374 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
863 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
864 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
865 | for (j = 1; j < pre_points_per_block
| 1374-9618 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
866 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
867 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
868 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
869 | if (!EC_POINT_add(group, *var, tmp_point, *(var - 1), ctx)
| 0-9618 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
870 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
871 | } executed 9618 times by 1 test: end of block Executed by:
| 9618 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
872 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
873 | if (i < numblocks - 1
| 45-1329 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
874 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
875 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
876 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
877 | size_t k; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
878 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
879 | if (blocksize <= 2
| 0-1329 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
880 | ERR_put_error(16,(188),((4|64)),__FILE__,923); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
881 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
882 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
883 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
884 | if (!EC_POINT_dbl(group, base, tmp_point, ctx)
| 0-1329 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
885 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
886 | for (k = 2; k < blocksize
| 1329-7974 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
887 | if (!EC_POINT_dbl(group, base, base, ctx)
| 0-7974 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
888 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
889 | } executed 7974 times by 1 test: end of block Executed by:
| 7974 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
890 | } executed 1329 times by 1 test: end of block Executed by:
| 1329 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
891 | } executed 1374 times by 1 test: end of block Executed by:
| 1374 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
892 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
893 | if (!EC_POINTs_make_affine(group, num, points, ctx)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
894 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
895 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
896 | pre_comp->group = group; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
897 | pre_comp->blocksize = blocksize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
898 | pre_comp->numblocks = numblocks; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
899 | pre_comp->w = w; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
900 | pre_comp->points = points; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
901 | points = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
902 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
903 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
904 | pre_comp->num = num; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
905 | group->pre_comp_type = PCT_ec, group->pre_comp.ec = pre_comp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
906 | pre_comp = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
907 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
908 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
909 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
910 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
911 | err: code before this statement executed 45 times by 1 test: err: Executed by:
| 45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
912 | if (ctx !=
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
913 | ((void *)0)
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
914 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
915 | BN_CTX_end(ctx); executed 45 times by 1 test: BN_CTX_end(ctx); Executed by:
| 45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
916 | BN_CTX_free(new_ctx); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
917 | EC_ec_pre_comp_free(pre_comp); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
918 | if (points
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
919 | EC_POINT **p; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
920 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
921 | for (p = points; *
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
922 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
923 | ; p++) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
924 | EC_POINT_free(*p); never executed: EC_POINT_free(*p); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
925 | CRYPTO_free(points, __FILE__, 960); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
926 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
927 | EC_POINT_free(tmp_point); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
928 | EC_POINT_free(base); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
929 | return executed 45 times by 1 test: ret;return ret; Executed by:
executed 45 times by 1 test: return ret; Executed by:
| 45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
930 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
931 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
932 | int ec_wNAF_have_precompute_mult(const EC_GROUP *group) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
933 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
934 | return never executed: group->pre_comp_type == PCT_ecreturn group->pre_comp_type == PCT_ec && group->pre_comp.ec != ((void *)0) ;
never executed: return group->pre_comp_type == PCT_ec && group->pre_comp.ec != ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
935 | ((void *)0)
never executed: return group->pre_comp_type == PCT_ec && group->pre_comp.ec != ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
936 | ; never executed: return group->pre_comp_type == PCT_ec && group->pre_comp.ec != ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
937 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |