Skip to content

optee-teec: API improvements and dependency cleanup#283

Open
manoj23 wants to merge 2 commits intoapache:mainfrom
manoj23:main
Open

optee-teec: API improvements and dependency cleanup#283
manoj23 wants to merge 2 commits intoapache:mainfrom
manoj23:main

Conversation

@manoj23
Copy link

@manoj23 manoj23 commented Feb 21, 2026

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 existing new_input() and new_out put() methods, corresponding to TEEC_MEMREF_TEMP_INOUT in 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-macros crate 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 redu
ces build time.

Testing

  • Build verification passed
  • No breaking changes to existing API

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>
@ivila
Copy link
Contributor

ivila commented Feb 24, 2026

image

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.

2 participants