@@ -75874,17 +75874,16 @@ static int sp_256_ecc_mulmod_8(sp_point_256* r, const sp_point_256* g,
7587475874 if (cache->cnt == 2)
7587575875 sp_256_gen_stripe_table_8(g, cache->table, tmp, heap);
7587675876
75877- #ifndef HAVE_THREAD_LS
75878- wc_UnLockMutex(&sp_cache_256_lock);
75879- #endif /* HAVE_THREAD_LS */
75880-
7588175877 if (cache->cnt < 2) {
7588275878 err = sp_256_ecc_mulmod_fast_8(r, g, k, map, ct, heap);
7588375879 }
7588475880 else {
7588575881 err = sp_256_ecc_mulmod_stripe_8(r, g, cache->table, k,
7588675882 map, ct, heap);
7588775883 }
75884+ #ifndef HAVE_THREAD_LS
75885+ wc_UnLockMutex(&sp_cache_256_lock);
75886+ #endif /* HAVE_THREAD_LS */
7588875887 }
7588975888
7589075889 SP_FREE_VAR(tmp, heap, DYNAMIC_TYPE_ECC);
@@ -76256,17 +76255,16 @@ static int sp_256_ecc_mulmod_8(sp_point_256* r, const sp_point_256* g,
7625676255 if (cache->cnt == 2)
7625776256 sp_256_gen_stripe_table_8(g, cache->table, tmp, heap);
7625876257
76259- #ifndef HAVE_THREAD_LS
76260- wc_UnLockMutex(&sp_cache_256_lock);
76261- #endif /* HAVE_THREAD_LS */
76262-
7626376258 if (cache->cnt < 2) {
7626476259 err = sp_256_ecc_mulmod_fast_8(r, g, k, map, ct, heap);
7626576260 }
7626676261 else {
7626776262 err = sp_256_ecc_mulmod_stripe_8(r, g, cache->table, k,
7626876263 map, ct, heap);
7626976264 }
76265+ #ifndef HAVE_THREAD_LS
76266+ wc_UnLockMutex(&sp_cache_256_lock);
76267+ #endif /* HAVE_THREAD_LS */
7627076268 }
7627176269
7627276270 SP_FREE_VAR(tmp, heap, DYNAMIC_TYPE_ECC);
@@ -93909,17 +93907,16 @@ static int sp_384_ecc_mulmod_12(sp_point_384* r, const sp_point_384* g,
9390993907 if (cache->cnt == 2)
9391093908 sp_384_gen_stripe_table_12(g, cache->table, tmp, heap);
9391193909
93912- #ifndef HAVE_THREAD_LS
93913- wc_UnLockMutex(&sp_cache_384_lock);
93914- #endif /* HAVE_THREAD_LS */
93915-
9391693910 if (cache->cnt < 2) {
9391793911 err = sp_384_ecc_mulmod_fast_12(r, g, k, map, ct, heap);
9391893912 }
9391993913 else {
9392093914 err = sp_384_ecc_mulmod_stripe_12(r, g, cache->table, k,
9392193915 map, ct, heap);
9392293916 }
93917+ #ifndef HAVE_THREAD_LS
93918+ wc_UnLockMutex(&sp_cache_384_lock);
93919+ #endif /* HAVE_THREAD_LS */
9392393920 }
9392493921
9392593922 SP_FREE_VAR(tmp, heap, DYNAMIC_TYPE_ECC);
@@ -94307,17 +94304,16 @@ static int sp_384_ecc_mulmod_12(sp_point_384* r, const sp_point_384* g,
9430794304 if (cache->cnt == 2)
9430894305 sp_384_gen_stripe_table_12(g, cache->table, tmp, heap);
9430994306
94310- #ifndef HAVE_THREAD_LS
94311- wc_UnLockMutex(&sp_cache_384_lock);
94312- #endif /* HAVE_THREAD_LS */
94313-
9431494307 if (cache->cnt < 2) {
9431594308 err = sp_384_ecc_mulmod_fast_12(r, g, k, map, ct, heap);
9431694309 }
9431794310 else {
9431894311 err = sp_384_ecc_mulmod_stripe_12(r, g, cache->table, k,
9431994312 map, ct, heap);
9432094313 }
94314+ #ifndef HAVE_THREAD_LS
94315+ wc_UnLockMutex(&sp_cache_384_lock);
94316+ #endif /* HAVE_THREAD_LS */
9432194317 }
9432294318
9432394319 SP_FREE_VAR(tmp, heap, DYNAMIC_TYPE_ECC);
@@ -121070,17 +121066,16 @@ static int sp_521_ecc_mulmod_17(sp_point_521* r, const sp_point_521* g,
121070121066 if (cache->cnt == 2)
121071121067 sp_521_gen_stripe_table_17(g, cache->table, tmp, heap);
121072121068
121073- #ifndef HAVE_THREAD_LS
121074- wc_UnLockMutex(&sp_cache_521_lock);
121075- #endif /* HAVE_THREAD_LS */
121076-
121077121069 if (cache->cnt < 2) {
121078121070 err = sp_521_ecc_mulmod_fast_17(r, g, k, map, ct, heap);
121079121071 }
121080121072 else {
121081121073 err = sp_521_ecc_mulmod_stripe_17(r, g, cache->table, k,
121082121074 map, ct, heap);
121083121075 }
121076+ #ifndef HAVE_THREAD_LS
121077+ wc_UnLockMutex(&sp_cache_521_lock);
121078+ #endif /* HAVE_THREAD_LS */
121084121079 }
121085121080
121086121081 SP_FREE_VAR(tmp, heap, DYNAMIC_TYPE_ECC);
@@ -121488,17 +121483,16 @@ static int sp_521_ecc_mulmod_17(sp_point_521* r, const sp_point_521* g,
121488121483 if (cache->cnt == 2)
121489121484 sp_521_gen_stripe_table_17(g, cache->table, tmp, heap);
121490121485
121491- #ifndef HAVE_THREAD_LS
121492- wc_UnLockMutex(&sp_cache_521_lock);
121493- #endif /* HAVE_THREAD_LS */
121494-
121495121486 if (cache->cnt < 2) {
121496121487 err = sp_521_ecc_mulmod_fast_17(r, g, k, map, ct, heap);
121497121488 }
121498121489 else {
121499121490 err = sp_521_ecc_mulmod_stripe_17(r, g, cache->table, k,
121500121491 map, ct, heap);
121501121492 }
121493+ #ifndef HAVE_THREAD_LS
121494+ wc_UnLockMutex(&sp_cache_521_lock);
121495+ #endif /* HAVE_THREAD_LS */
121502121496 }
121503121497
121504121498 SP_FREE_VAR(tmp, heap, DYNAMIC_TYPE_ECC);
@@ -150839,17 +150833,16 @@ static int sp_1024_ecc_mulmod_32(sp_point_1024* r, const sp_point_1024* g,
150839150833 if (cache->cnt == 2)
150840150834 sp_1024_gen_stripe_table_32(g, cache->table, tmp, heap);
150841150835
150842- #ifndef HAVE_THREAD_LS
150843- wc_UnLockMutex(&sp_cache_1024_lock);
150844- #endif /* HAVE_THREAD_LS */
150845-
150846150836 if (cache->cnt < 2) {
150847150837 err = sp_1024_ecc_mulmod_fast_32(r, g, k, map, ct, heap);
150848150838 }
150849150839 else {
150850150840 err = sp_1024_ecc_mulmod_stripe_32(r, g, cache->table, k,
150851150841 map, ct, heap);
150852150842 }
150843+ #ifndef HAVE_THREAD_LS
150844+ wc_UnLockMutex(&sp_cache_1024_lock);
150845+ #endif /* HAVE_THREAD_LS */
150853150846 }
150854150847
150855150848 SP_FREE_VAR(tmp, heap, DYNAMIC_TYPE_ECC);
@@ -151154,17 +151147,16 @@ static int sp_1024_ecc_mulmod_32(sp_point_1024* r, const sp_point_1024* g,
151154151147 if (cache->cnt == 2)
151155151148 sp_1024_gen_stripe_table_32(g, cache->table, tmp, heap);
151156151149
151157- #ifndef HAVE_THREAD_LS
151158- wc_UnLockMutex(&sp_cache_1024_lock);
151159- #endif /* HAVE_THREAD_LS */
151160-
151161151150 if (cache->cnt < 2) {
151162151151 err = sp_1024_ecc_mulmod_fast_32(r, g, k, map, ct, heap);
151163151152 }
151164151153 else {
151165151154 err = sp_1024_ecc_mulmod_stripe_32(r, g, cache->table, k,
151166151155 map, ct, heap);
151167151156 }
151157+ #ifndef HAVE_THREAD_LS
151158+ wc_UnLockMutex(&sp_cache_1024_lock);
151159+ #endif /* HAVE_THREAD_LS */
151168151160 }
151169151161
151170151162 SP_FREE_VAR(tmp, heap, DYNAMIC_TYPE_ECC);
0 commit comments