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

FIPS compatibility #72

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

FIPS compatibility #72

wants to merge 7 commits into from

Conversation

fjarri
Copy link
Member

@fjarri fjarri commented Feb 5, 2025

Fixes #4

  • Fixed some comments in pseudoprimes.rs
  • Added LucasCheck::Regular to match what's described in FIPS-186.5 Section B.3.3
  • Flattened the logic in lucas_test() to make it easier to understand when the checks are applied
  • Simplified test structure in lucas.rs
  • Added hazmat::minimum_mr_iterations() with the recommended formula from FIPS
  • Added fips_is_prime_with_rng() and fips_is_safe_prime_with_rng()

Is there a better way to organize the FIPS preset? A fips submodule? Or just prefixes/suffixes? Should we provide a corresponding prime-generation function, or just have users rely on sieve_and_find()? Although maybe we should push it to when we're dealing with #62.

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 95.40230% with 16 lines in your changes missing coverage. Please review.

Project coverage is 98.60%. Comparing base (ad4f439) to head (2a10f75).

Files with missing lines Patch % Lines
src/presets.rs 91.22% 10 Missing ⚠️
src/hazmat/lucas.rs 97.14% 3 Missing ⚠️
src/hazmat/float.rs 97.22% 2 Missing ⚠️
src/hazmat/miller_rabin.rs 98.24% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
- Coverage   99.47%   98.60%   -0.87%     
==========================================
  Files          11       12       +1     
  Lines        1512     1721     +209     
==========================================
+ Hits         1504     1697     +193     
- Misses          8       24      +16     

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

@fjarri fjarri self-assigned this Feb 5, 2025
@fjarri fjarri force-pushed the fips branch 4 times, most recently from 47afc37 to 1b9cf81 Compare February 6, 2025 00:05
@fjarri fjarri marked this pull request as ready for review February 6, 2025 00:08
@fjarri fjarri requested a review from dvdplm February 6, 2025 00:09
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.

FIPS compatibility
1 participant