optee-teec: API improvements and dependency cleanup#283
Open
manoj23 wants to merge 2 commits intoapache:mainfrom
Open
optee-teec: API improvements and dependency cleanup#283manoj23 wants to merge 2 commits intoapache:mainfrom
manoj23 wants to merge 2 commits intoapache:mainfrom
Conversation
The optee-teec-macros crate provides plugin_init and plugin_invoke procedural macros that are not used by the optee-teec library itself. These macros were re-exported but serve no purpose in the core TEEC client API implementation. This change: - Removes the optee-teec-macros dependency from Cargo.toml - Removes the re-export of plugin_init and plugin_invoke macros from lib.rs This simplifies the dependency tree and reduces build time for users who only need the TEEC client API without the plugin macros. Signed-off-by: Georges Savoundararadj <savoundg@amazon.com>
Add ParamTmpRef::new_inout() constructor to create temporary memory references with bidirectional data flow (input/output). The existing API only provided: - new_input(): for read-only memory references (TA can only read) - new_output(): for write-only memory references (TA can only write) This change adds: - new_inout(): for read-write memory references (TA can both read and write) This is useful for operations where the TA needs to read initial data from the buffer, process it, and write the results back to the same buffer. The new method sets the ParamType to MemrefTempInout, which corresponds to TEEC_MEMREF_TEMP_INOUT in the GlobalPlatform TEE Client API specification. Example use case: Encryption/decryption operations where plaintext is passed in and ciphertext is returned in the same buffer. Signed-off-by: Georges Savoundararadj <savoundg@amazon.com>
Contributor
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.

This PR enhances the optee-teec parameter API and cleans up unused dependencies.
Changes
Add bidirectional memory reference support
Adds
ParamTmpRef::new_inout()to create temporary memory references with bidirectional data flow. This completes the memory reference API alongside the existingnew_input()andnew_out put()methods, corresponding toTEEC_MEMREF_TEMP_INOUTin the GlobalPlatform TEE Client API specification.Use case: Operations where the TA needs to read initial data, process it, and write results back to the same buffer (e.g., encryption/decryption).
Remove unused optee-teec-macros dependency
The
optee-teec-macroscrate was a dependency but its exports (plugin_init,plugin_invoke) are not used by the core TEEC client API. Removing it simplifies the dependency tree and reduces build time.
Testing