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

Add support for RSA KeyGen AFT tests for FIPS186-5 to ACVP tool #1234

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

billbo-yang
Copy link
Contributor

Issues:

Addresses CryptoAlg-1838

Description of changes:

FIPS 186-5 updates some things related to RSA. For ACVP, it introduces a new capabilities registration. Luckily, the format of the vectors is largely the same, but we need to enable support for "AFT" tests in order to correctly parse FIPS 186-5 compatible test vectors.

Call-outs:

N/A

Testing:

Tool passes when running against ACVP demo server.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@billbo-yang billbo-yang requested a review from a team as a code owner October 9, 2023 21:42
const expectedType = "GDT"
if group.Type != expectedType {
return nil, fmt.Errorf("RSA KeyGen test group has type %q, but only generation tests (%q) are supported", group.Type, expectedType)
// We support both GDT and AFT tests, which are formatted the same and expect the same output.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious what the exact difference between GDT and AFT is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, the GDT and AFT tests are exactly the same. For whatever reason, NIST renamed the test when they issued FIPS 186-5.

Most of the changes are related to how we register our capabilities with the ACVP server now. If we choose to register with the new way (under FIPS 186-5), we get vectors that are labeled as "AFT" tests. If we choose to register with the old way (under FIPS 186-4), we get vectors that are labeled as "GDT".

Other than the labels though, it appears that both the vectors that we get from NIST for RSA as well as the expected format/contents of the corresponding response vectors are the exact same as before...

You can see more details on the ACVP specifications page for RSA: https://pages.nist.gov/ACVP/draft-celi-acvp-rsa.html

@billbo-yang billbo-yang enabled auto-merge (squash) October 10, 2023 17:50
@billbo-yang billbo-yang merged commit 1ba686a into aws:main Oct 10, 2023
4 of 5 checks passed
billbo-yang added a commit to billbo-yang/aws-lc that referenced this pull request Oct 10, 2023
@billbo-yang billbo-yang deleted the support_aft_rsa_acvp branch January 11, 2024 18:23
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