Commit ae65734
authored
Use bounded exponentiation to improve encrypt/verify performance (#662)
Limit exponentiation to the bit length of e to reduce computation time.
This is safe since e is public.
Improves encrypt/verify performance by over 2x on my laptop.
rsa_2048_pkcsv1_encrypt time: [17.822 µs 17.849 µs 17.877 µs]
change: [-80.899% -80.786% -80.697%] (p = 0.00 < 0.05)
Performance has improved.
rsa_4096_pkcsv1_encrypt time: [149.74 µs 150.04 µs 150.37 µs]
change: [-63.132% -61.496% -60.140%] (p = 0.00 < 0.05)
Performance has improved.
aws_lc_rs_2048_pkcs1_encrypt
time: [10.682 µs 10.714 µs 10.747 µs]
aws_lc_rs_4096_pkcs1_encrypt
time: [31.771 µs 31.826 µs 31.879 µs]1 parent 03e25a7 commit ae65734
1 file changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
| 199 | + | |
| 200 | + | |
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
| |||
234 | 236 | | |
235 | 237 | | |
236 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
237 | 252 | | |
238 | 253 | | |
239 | 254 | | |
| |||
0 commit comments