Commit 6c83bfe
committed
Add bignum.h and port exactfloat to use it.
This removes the dependency on OpenSSL for its bignum library. The main benefit
of this is that targetting things like WASM are much simpler since we don't need
to compile OpenSSL to WASM.
I didn't try as hard for performance optimization as OpenSSL (which also has a
hard requirement around constant-time operation for security purposes), but
benchmarks indicate addition and subtraction is generally the same and
multiplication is within a factor of two. For the size of bignums we expect in
S2 there shouldn't be a noticeable difference in performance.1 parent 5b5fbc0 commit 6c83bfe
File tree
7 files changed
+1766
-249
lines changed- src/s2/util/math/exactfloat
7 files changed
+1766
-249
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
| |||
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | 101 | | |
107 | 102 | | |
108 | 103 | | |
| |||
230 | 225 | | |
231 | 226 | | |
232 | 227 | | |
233 | | - | |
234 | 228 | | |
235 | 229 | | |
236 | 230 | | |
| |||
617 | 611 | | |
618 | 612 | | |
619 | 613 | | |
| 614 | + | |
620 | 615 | | |
621 | 616 | | |
622 | 617 | | |
| |||
645 | 640 | | |
646 | 641 | | |
647 | 642 | | |
648 | | - | |
| 643 | + | |
| 644 | + | |
649 | 645 | | |
650 | 646 | | |
651 | 647 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| |||
139 | 138 | | |
140 | 139 | | |
141 | 140 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | 141 | | |
148 | 142 | | |
149 | 143 | | |
| |||
218 | 212 | | |
219 | 213 | | |
220 | 214 | | |
221 | | - | |
222 | | - | |
223 | 215 | | |
224 | 216 | | |
225 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
0 commit comments