Commit d3c6070
committed
Better explanation for Barrett division in decompose (C and AVX2)
Based on Hanno Becker's proposal, the new explanation explains how
round-(f1' / B) can be replaced with rounding-mulhi, regardless of the
type of rounding used in the mulhi. In addition, by bounding the
approximation error to be strictly less than 1 / B, the exactness of the
Barrett division is also justified.
To avoid excessive repetition, we prove the GAMMA2 = (Q-1)/88 case in
the C implementation, remark how the same proof can be adapted to the
GAMMA2 = (Q-1)/32 case, and finally refer to them when explaining the
AVX2 implementation.
Signed-off-by: jammychiou1 <jammy.chiou1@gmail.com>1 parent 1f24035 commit d3c6070
File tree
5 files changed
+39
-14
lines changed- dev/x86_64/src
- mldsa/src
- native/x86_64/src
5 files changed
+39
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
| 77 | + | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
| 77 | + | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
122 | 144 | | |
123 | 145 | | |
124 | 146 | | |
| |||
128 | 150 | | |
129 | 151 | | |
130 | 152 | | |
| 153 | + | |
131 | 154 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
135 | 160 | | |
136 | 161 | | |
137 | 162 | | |
| |||
0 commit comments