Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPLEMENTATION] DSA algorithm implementation #737

Merged
merged 3 commits into from
Oct 23, 2024

Conversation

ddaniel27
Copy link
Contributor

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 and q 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.

@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2024

Codecov Report

Attention: Patch coverage is 92.38095% with 8 lines in your changes missing coverage. Please review.

Project coverage is 87.43%. Comparing base (822634f) to head (bbc98cb).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
cipher/dsa/dsa.go 92.38% 4 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #737      +/-   ##
==========================================
- Coverage   87.68%   87.43%   -0.25%     
==========================================
  Files         209      210       +1     
  Lines        5547     7054    +1507     
==========================================
+ Hits         4864     6168    +1304     
- Misses        542      741     +199     
- Partials      141      145       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ddaniel27
Copy link
Contributor Author

ddaniel27 commented Sep 14, 2024

Hey @raklaptudirm @yanglbme hope you are well. I re-open a PR for this implementation. Last one was closed by stale status. I hope you can take a look at this PR this time. Also the pipeline is failing because some lint errors not related with my PR. I could track two errors, both in math/matrix/strassenmatrixmultiply_test.go line 69 and 106. Let me know if you think it's good open another PR to fix the pipeline errors. :)

@ddaniel27
Copy link
Contributor Author

@raklaptudirm @yanglbme I created a PR to fix the tests failing for lint. After merge that PR You/I can update this PR to merge this too :)

@raklaptudirm raklaptudirm merged commit b9f7d55 into TheAlgorithms:master Oct 23, 2024
5 checks passed
mapcrafter2048 pushed a commit to mapcrafter2048/Go that referenced this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants