Skip to content

test: add XOF dispatch tests to driver wrapper suite#773

Open
yiwu0b11 wants to merge 6 commits into
Mbed-TLS:developmentfrom
yiwu0b11:add-xof-wrapper-tests
Open

test: add XOF dispatch tests to driver wrapper suite#773
yiwu0b11 wants to merge 6 commits into
Mbed-TLS:developmentfrom
yiwu0b11:add-xof-wrapper-tests

Conversation

@yiwu0b11
Copy link
Copy Markdown
Contributor

@yiwu0b11 yiwu0b11 commented Apr 21, 2026

Description

Add XOF dispatch test to test_suite_psa_crypto_driver_wrappers
Issue: #703

PR checklist

  • changelog not required because: test only
  • framework PR not required
  • TF-PSA-Crypto development PR provided: here
  • TF-PSA-Crypto 1.1 PR provided: TODO
  • mbedtls development PR not required because: not related
  • mbedtls 4.1 PR not required because: not related
  • mbedtls 3.6 PR not required because: not related
  • tests provided: here

@yiwu0b11 yiwu0b11 added size-s Estimated task size: small (~2d) needs-reviewer This PR needs someone to pick it up for review priority-medium Medium priority - this can be reviewed as time permits needs-ci Needs to pass CI tests needs-work and removed needs-reviewer This PR needs someone to pick it up for review labels Apr 21, 2026
Signed-off-by: Yi Wu <yi.wu2@arm.com>
@yiwu0b11 yiwu0b11 force-pushed the add-xof-wrapper-tests branch from 1ffa094 to aa4e4a3 Compare April 22, 2026 14:53
@yiwu0b11 yiwu0b11 marked this pull request as ready for review April 23, 2026 08:03
@yiwu0b11 yiwu0b11 removed needs-work needs-ci Needs to pass CI tests labels Apr 27, 2026
Signed-off-by: Yi Wu <yi.wu2@arm.com>
@yiwu0b11
Copy link
Copy Markdown
Contributor Author

yiwu0b11 commented Apr 28, 2026

Hash values used in test are taken from

XOF multi update: SHAKE128 1 -> 200
depends_on:PSA_WANT_ALG_SHAKE128
xof_multi_update:PSA_ALG_SHAKE128:0:"":"eb":"33c7bca426b135e7fb977b3123a103e745d14e81cbf603a0ed5d8a3d1b4ee180a968197bb4eac05932be39c2ca89a0de7684abdde722369ef7d2964b41857e023dc871614f1cf24a5fc36b68407cf6c3850b2f27c6bd0912bc831996a5546216a774a74ad5c243c80605f3a3c48b2392045a6c7ff9784f8f1cebc116bf5226d16ece99e56c111d3b64ae7fd0fb75997cd4a9d604b6ab77625c258000fdf2ad7a5840b94934413a16b5fa70d03724932b2b020ff3ee35c9c3ff1304f6e20c950ed2fe5f5f6585cb2d"

@yiwu0b11 yiwu0b11 requested a review from minosgalanakis May 11, 2026 08:33
@bjwtaylor bjwtaylor self-requested a review May 13, 2026 10:42
bjwtaylor
bjwtaylor previously approved these changes May 13, 2026
Copy link
Copy Markdown
Contributor

@bjwtaylor bjwtaylor left a comment

Choose a reason for hiding this comment

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

I might be worth doing a fixup on the fix commit. Though otherwise looks good.

Copy link
Copy Markdown
Contributor

@minosgalanakis minosgalanakis left a comment

Choose a reason for hiding this comment

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

This covers the setup-time dispatch/fallback path for XOF, which may be the intended scope here.

I need to be clear because the issue this PR is addressing is not. I will comment there.

I think we should probably test the scenario of unsupported XOF algorithm distinct from SHAKE128/SHAKE256.

That means testing that a value where PSA_ALG_IS_XOF(alg) is true, but neither the test driver nor builtin supports it. This would exercise “driver returns not supported, builtin returns not supported, final result is PSA_ERROR_NOT_SUPPORTED”

depends_on:PSA_WANT_ALG_JPAKE:PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC:PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT:PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT:PSA_WANT_ECC_SECP_R1_256:PSA_WANT_ALG_SHA_256:PSA_WANT_ALG_TLS12_PSK_TO_MS:MBEDTLS_PSA_BUILTIN_ALG_JPAKE
ecjpake_rounds:PSA_ALG_JPAKE(PSA_ALG_SHA_256):PSA_PAKE_PRIMITIVE(PSA_PAKE_PRIMITIVE_TYPE_ECC, PSA_ECC_FAMILY_SECP_R1, 256):PSA_ALG_TLS12_PSK_TO_MS(PSA_ALG_SHA_256):"abcdef":0:0

XOF dispatch: SHAKE128, computed by the driver
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need test cases for SHAKE256 too.

Signed-off-by: Yi Wu <yi.wu2@arm.com>
yiwu0b11 added 3 commits June 1, 2026 16:03
Signed-off-by: Yi Wu <yi.wu2@arm.com>
Signed-off-by: Yi Wu <yi.wu2@arm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority-medium Medium priority - this can be reviewed as time permits size-s Estimated task size: small (~2d)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants