Add Spake2p support to test framework#308
Open
sigvartmh wants to merge 3 commits into
Open
Conversation
Teach crypto_knowledge.KeyType about SPAKE2+ keys so the test generators
can reason about them:
- SPAKE2P_KEY_SIZES: SPAKE2+ (RFC 9383) is defined over secp_r1
P-256/P-384/P-521, with the curve bit size as the key size;
- SPAKE2P_KEY_DATA: valid registration material (w0||w1 for a key pair,
w0||L for a public key) used as the export representation;
- sizes_to_test() returns the SPAKE2+ sizes for supported ECC families
(and nothing for unsupported families), and key_material() returns the
registration material for SPAKE2+ key types.
Signed-off-by: Sigvart Hovland <Sigvart.Hovland@silabs.com>
Now that crypto_knowledge models SPAKE2+ keys, let the PSA test
generators handle them:
- psa_information: stop discarding the SPAKE2+ key types so they take
part in systematic key-type generation;
- generate_psa_tests: emit not-supported and storage cases for SPAKE2+
(parametrised by ECC family), skip key *generation* (SPAKE2+ keys are
password-derived registration material, not random), skip them in
op-fail generation (PAKE-only policy), and skip key types with no
testable size.
Signed-off-by: Sigvart Hovland <Sigvart.Hovland@silabs.com>
Extend mbedtls_test_psa_exported_key_sanity_check() to handle SPAKE2+ key types: the export representation is the registration material (w0||w1 for a key pair, w0||L for a public key), so check the exported length against PSA_EXPORT_KEY_OUTPUT_SIZE. Signed-off-by: Sigvart Hovland <Sigvart.Hovland@silabs.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adding test vectors from the RFC for SPAKE2+ to be used with the PR in TF-PSA-Crypto
PR checklist
Please add the numbers (or links) of the associated pull requests for consuming branches. You can omit branches where this pull request is not needed.
Notes for the submitter
Please refer to the contributing guidelines, especially the
checklist for PR contributors.
Help make review efficient: