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.
Since I'm experimenting with this for my library, I figured I would try it with this one as well, to see how difficult it would be. Note that I was lazy and didn't bother fixing the field sub-package tests since this is more of an experiment/food-for-thought branch than anything else.
Numbers taken on an i7-8565U with turbo and SMT disabled, using go1.17beta1 as the compiler.
"baseline" is the existing code, with the assembly language routines. "baseline-purego" is the existing code, with
purego
set to disable assembly, "fiat" is the fiat-crypto branch. For clarity's sake, comparing the existing code with assembly, to just using fiat looks like this:X25519 performance would be worse because
Mult32
no longer is special cased (solved by addingElement.Mult121666
backed byCarryScmul121666
). I haven't looked at how you implemented the ladder inx/crypto
, but leveraging the fact that fiat'sCarryMul
andCarrySquare
calls can takeLooseFieldElement
s a's inputs will also shave off some reductions, though if to decide to do that it's easiest to use the raw fiat routines instead of the field abstraction.[0]: Regarding CLA stuff if it comes up, I'll need to bother work again.. I asked about that the last time, and my inquiry disappeared into the bureaucratic black-hole.