Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uses the
fiat-constify
tool to mechanically transformfiat-crypto
generated field implementations intoconst fn
:https://github.com/RustCrypto/utils/tree/master/fiat-constify
Resulting code has been run through
rustfmt
prior to checking it in:The following are criterion benchmarks after the translation. While these values are within the threshold of noise I experience running them on a semi-busy desktop computer (MacBook w\ 2.3 GHz 8-Core Intel Core i9) they do paint a picture of a slight performance regression (~5%).
field element operations/mul
time: [60.361 ns 60.755 ns 61.170 ns]
change: [+3.0611% +4.1805% +5.1398%] (p = 0.00 < 0.05)
Performance has regressed.
field element operations/square
time: [59.143 ns 59.508 ns 59.924 ns]
change: [+4.8440% +5.5441% +6.2283%] (p = 0.00 < 0.05)
Performance has regressed.
field element operations/invert
time: [49.713 us 50.069 us 50.481 us]
change: [+14.227% +15.283% +16.277%] (p = 0.00 < 0.05)
Performance has regressed.
field element operations/sqrt
time: [24.936 us 25.064 us 25.206 us]
change: [+3.0874% +3.9261% +4.7805%] (p = 0.00 < 0.05)
Performance has regressed.
point operations/point-scalar mul
time: [532.24 us 535.29 us 538.62 us]
change: [+2.4804% +3.2221% +3.9748%] (p = 0.00 < 0.05)
Performance has regressed.
scalar operations/sub
time: [7.1834 ns 7.2272 ns 7.2688 ns]
change: [+13.036% +13.817% +14.551%] (p = 0.00 < 0.05)
Performance has regressed.
scalar operations/add
time: [9.5314 ns 9.5797 ns 9.6287 ns]
change: [+1.2331% +1.9875% +2.6816%] (p = 0.00 < 0.05)
Performance has regressed.
scalar operations/mul
time: [59.303 ns 59.530 ns 59.779 ns]
change: [+5.0340% +5.6533% +6.2711%] (p = 0.00 < 0.05)
Performance has regressed.
scalar operations/negate
time: [6.6648 ns 6.6915 ns 6.7244 ns]
change: [+0.1937% +1.0485% +1.8021%] (p = 0.01 < 0.05)
Change within noise threshold.
scalar operations/invert
time: [49.255 us 49.365 us 49.489 us]
change: [+12.196% +13.079% +13.937%] (p = 0.00 < 0.05)
Performance has regressed.