Bandersnatch/banderwagon endomorphism acceleration #380
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.
This implements:
Departures from the generic derivation
λ
The endomorphism is equivalent to a scalar multiplication by a solution of λ² = -2.
There are 2 such solutions and for a generic implementation we should try
to ensure which of λ₀ = √-2 and λ₁ = -√-2 corresponds to the computation at
constantine/constantine/math/constants/zoo_endomorphisms.nim
Lines 49 to 73 in 69b8f41
This is what is done for cubic root endomorphisms:
constantine/sage/derive_endomorphisms.sage
Lines 151 to 162 in f3e08ed
constantine/sage/derive_endomorphisms.sage
Lines 84 to 112 in f3e08ed
However, SageMath has no builtin support for Edwards curves so we would would need to reimplement scalar multiplication to do these checks. Hence we hardcode the λ from the paper.
Lattice decomposition
The lattice decomposition also follows the reference implementation, i.e. instead of
constantine/sage/derive_endomorphisms.sage
Lines 61 to 67 in f3e08ed
we do https://github.com/asanso/Bandersnatch/blob/e280929/python-ref-impl/bandersnatch.py#L20-L21
This only moves signs around.