Skip to content

Conversation

Akshay-Belsare
Copy link

Add new example for MAC and digest algorithms

The user can now invoke:
optee_example_sha

: algorithm name. Supported values for algo are:

  • TA_ALGO_HMAC_SHA256 (default)
  • TA_ALGO_HMAC_SHA1
  • TA_ALGO_HMAC_SHA224
  • TA_ALGO_HMAC_SHA384
  • TA_ALGO_HMAC_SHA512
  • 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

@jenswi-linaro
Copy link
Contributor

This PR has code style issues, and I think it's more complicated than necessary. However, if no one else cares, I'm going to ack this by the end of the week.

@jenswi-linaro
Copy link
Contributor

Acked-by: Jens Wiklander <[email protected]>

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

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

The name sha for the example may be confusing since the example does far more that SHAx operations. May be call it 'hash`?

@etienne-lms
Copy link
Contributor

Sorry @jenswi-linaro, maybe I'm a bit too nitpicking on examples. Feel free to tell if some of my comments are overkilling.

@jenswi-linaro
Copy link
Contributor

I don't mind. The code in this git isn't as consistent as in the repositories under http://github.com/OP-TEE.

@etienne-lms
Copy link
Contributor

Maybe worth to have a cleanup on these. They are expected to be examples. Not critical though :-)

@amey-raghatate
Copy link
Contributor

The name sha for the example may be confusing since the example does far more that SHAx operations. May be call it 'hash`?

Hi @etienne-lms since the TA specifically focuses on SHA HMAC and SHA digest functionalities, I thought naming the TA 'SHA' would be more accurate as it reflects its purpose and scope.

@etienne-lms
Copy link
Contributor

The name sha for the example may be confusing since the example does far more that SHAx operations. May be call it 'hash`?

Hi @etienne-lms since the TA specifically focuses on SHA HMAC and SHA digest functionalities, I thought naming the TA 'SHA' would be more accurate as it reflects its purpose and scope.

Fair enough.

Akshay-Belsare pushed a commit to Xilinx/optee_examples that referenced this pull request Sep 29, 2025
Add new example for MAC and digest algorithms

The user can now invoke:
optee_example_sha <string> <algo>

<algo>: algorithm name. Supported values for algo are:
- TA_ALGO_HMAC_SHA256 (default)
- TA_ALGO_HMAC_SHA1
- TA_ALGO_HMAC_SHA224
- TA_ALGO_HMAC_SHA384
- TA_ALGO_HMAC_SHA512
- 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

Signed-off-by: Amey Avinash Raghatate <[email protected]>
State: waiting
Link: linaro-swg#136
@Akshay-Belsare
Copy link
Author

@etienne-lms can we close on this?

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

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

Sorry for this late feedback.

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

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

Some minor comments. Otherwise LGTM.

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

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

Some last comments.
My Reviewed-by: Etienne Carriere <[email protected]> tag once addressed.
Thanks for this example (and all the others you also submitted).

Add new example for MAC and digest algorithms

The user can now invoke:
optee_example_sha <string> <algo>

<algo>: algorithm name. Supported values for algo are:
- HMAC_SHA1
- HMAC_SHA224
- HMAC_SHA256 (default)
- HMAC_SHA384
- HMAC_SHA512
- AES_CMAC
- SHA1
- SHA224
- SHA256
- SHA384
- SHA512
- SHA3_224
- SHA3_256
- SHA3_384
- SHA3_512
- SHAKE128
- SHAKE256

Signed-off-by: Amey Avinash Raghatate <[email protected]>
Reviewed-by: Jerome Forissier <[email protected]>
Reviewed-by: Etienne Carriere <[email protected]>
Acked-by: Jens Wiklander <[email protected]>
@Akshay-Belsare
Copy link
Author

@etienne-lms all review comments are addressed.
@jenswi-linaro @jforissier all tags are applied.

@jforissier jforissier merged commit 6939295 into linaro-swg:master Oct 13, 2025
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.

5 participants