Skip to content

Conversation

Akshay-Belsare
Copy link

@Akshay-Belsare Akshay-Belsare commented Aug 25, 2025

Add new example for basic SHA algorithms:

  • TEE_ALG_SHA1
  • TEE_ALG_SHA224
  • TEE_ALG_SHA256
  • TEE_ALG_SHA384
  • TEE_ALG_SHA512
  • TEE_ALG_SHA3_224
  • TEE_ALG_SHA3_256
  • TEE_ALG_SHA3_384
  • TEE_ALG_SHA3_512
  • TEE_ALG_SHAKE128
  • TEE_ALG_SHAKE256

Also add support to select algorithm at runtime. The user can now run the optee_example_base_sha <string to encrypt> <algo name> command, and the specified algorithm will be used for computing digest.

The user can now invoke:
optee_example_base_sha

Supported values for are:

  • TA_ALG_SHA1
  • TA_ALG_SHA224
  • TA_ALG_SHA256
  • TA_ALG_SHA384
  • TA_ALG_SHA512
  • TA_ALG_SHA3_224
  • TA_ALG_SHA3_256
  • TA_ALG_SHA3_384
  • TA_ALG_SHA3_512
  • TA_ALG_SHAKE128
  • TA_ALG_SHAKE256

If no algorithm is specified, TA_ALG_SHA256 is selected by default.

Based on the input, the corresponding algorithm is selected and used for computing digest operations. This enhancement improves flexibility by allowing users to test different basic SHA modes using a single binary.

Add support for new basic SHA algorithms:
- TEE_ALG_SHA1
- TEE_ALG_SHA224
- TEE_ALG_SHA256
- TEE_ALG_SHA384
- TEE_ALG_SHA512
- TEE_ALG_SHA3_224
- TEE_ALG_SHA3_256
- TEE_ALG_SHA3_384
- TEE_ALG_SHA3_512
- TEE_ALG_SHAKE128
- TEE_ALG_SHAKE256

Also add support to select algorithm at runtime. The user can now run the
`optee_example_base_sha <string to encrypt> <algo name>` command, and the
specified algorithm will be used for computing digest.

The user can now invoke:
optee_example_base_sha <string to encrypt> <algo name>

Supported values for <algo name> are:
- TA_ALG_SHA1
- TA_ALG_SHA224
- TA_ALG_SHA256
- TA_ALG_SHA384
- TA_ALG_SHA512
- TA_ALG_SHA3_224
- TA_ALG_SHA3_256
- TA_ALG_SHA3_384
- TA_ALG_SHA3_512
- TA_ALG_SHAKE128
- TA_ALG_SHAKE256

If no algorithm is specified, TA_ALG_SHA256 is selected by default.

Based on the input, the corresponding algorithm is selected and used for
computing digest operations. This enhancement improves flexibility by
allowing users to test different basic SHA modes using a single binary.

Signed-off-by: Amey Avinash Raghatate <[email protected]>
Changes:
- Sort header files alphabetically
- Annotate unused function arguments with __unused
- Declare and initialize local variables at the beginning of blocks
- Remove unnecessary casting

Signed-off-by: Amey Avinash Raghatate <[email protected]>
@Akshay-Belsare
Copy link
Author

@jenswi-linaro, @amey-raghatate has addressed the review comments.

@Akshay-Belsare
Copy link
Author

@jenswi-linaro,
As per your comment #132 (comment), a combined example is created and a separate PR #136 is raised for it.

Copy link

github-actions bot commented Oct 4, 2025

This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

@github-actions github-actions bot added the Stale label Oct 4, 2025
@github-actions github-actions bot closed this Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants