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

age: scrypt fix work factor calculation with bad SystemTime precision #419

Closed
wants to merge 1 commit into from

Conversation

Rileran
Copy link

@Rileran Rileran commented Dec 6, 2023

This PR fixes issue #418

Uses default scrypt work factor if the duration of one scrypt encryption is below SystemTime precision.

@str4d
Copy link
Owner

str4d commented Dec 17, 2023

Rather than falling back to the default (which in this case could be significantly faster than 1 second on a platform that is this fast), what I'll do is re-run the test with larger log_n values until the measured duration is non-zero. It stands to reason that this will impose the minimum cost on encryption, as any run that measures below SystemTime precision can be considered negligible.

Copy link

codecov bot commented Dec 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (488212d) 40.81% compared to head (c2b91c9) 41.73%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #419      +/-   ##
==========================================
+ Coverage   40.81%   41.73%   +0.92%     
==========================================
  Files          34       34              
  Lines        3249     3225      -24     
==========================================
+ Hits         1326     1346      +20     
+ Misses       1923     1879      -44     

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

@str4d
Copy link
Owner

str4d commented Dec 17, 2023

Closing in favour of #424.

@str4d str4d closed this Dec 17, 2023
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.

2 participants