Commit aa15154
committed
Merge bitcoin-core#568: Fix integer overflow in ecmult_multi_var when n is large
2277af5 Fix integer overflow in ecmult_multi_var when n is large (Jonas Nick)
Pull request description:
Without this PR ecmult_multi could return wrong results. If the number of points `n` is large enough then some or all multiplications could be skipped or the function could end up in an infinite loop. This PR adds two checks to prevent `n` from wrapping around.
Tree-SHA512: 342944369b24776fa3ec0694eee159259ff67e94d2d8176c1d3159875f387d943d5bfdff7cde59f058e13f07fd09bde1cbc609426e63c8a5b8040e382dd865d82 files changed
+69
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1111 | 1111 | | |
1112 | 1112 | | |
1113 | 1113 | | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
1114 | 1134 | | |
1115 | 1135 | | |
1116 | 1136 | | |
1117 | 1137 | | |
1118 | 1138 | | |
1119 | | - | |
1120 | 1139 | | |
1121 | 1140 | | |
1122 | 1141 | | |
| |||
1133 | 1152 | | |
1134 | 1153 | | |
1135 | 1154 | | |
1136 | | - | |
1137 | | - | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1138 | 1158 | | |
1139 | | - | |
1140 | | - | |
1141 | 1159 | | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | 1160 | | |
1146 | 1161 | | |
1147 | 1162 | | |
1148 | | - | |
1149 | | - | |
| 1163 | + | |
1150 | 1164 | | |
1151 | 1165 | | |
1152 | | - | |
1153 | | - | |
1154 | 1166 | | |
1155 | 1167 | | |
1156 | 1168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2854 | 2854 | | |
2855 | 2855 | | |
2856 | 2856 | | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
2857 | 2901 | | |
2858 | 2902 | | |
2859 | 2903 | | |
| |||
2936 | 2980 | | |
2937 | 2981 | | |
2938 | 2982 | | |
| 2983 | + | |
2939 | 2984 | | |
2940 | 2985 | | |
2941 | 2986 | | |
| |||
0 commit comments