[IMPLEMENTATION] DSA algorithm implementation #728
Closed
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.
Hi team, this is my DSA implementation. This PR needs a little bit of context.
I tried to follow the exact same algorithm steps as Wikipedia says but this has a big problem: efficiency. I'm talking about waiting around 1.5 mins to get the keys generated. Even this is not the exact amount of time because having randomness adds inconsistency (this is the keygen took 10s or 10m but on average 1.5m).
This is why I took a look at the current go dsa implementation. As you might see, we have the same aproach in the generation parameters loop (i.e. GPLoop for me, GeneratePrimes for DSA Go implementation), this is so far the most optimal way I found to get the
p
andq
params, so I tried to replicated it in my own way also with the added value of explaining most decisions because some decisions seems arbitray but it's all for (again) efficiency.I hope the context helps a little bit to clarify why the core algorithm appears to be a "copy" of the DSA std library. Honestly, after studying many different implementations, this is the only viable one.