Skip to content

Add timer functions - #60

Open
padelsbach wants to merge 1 commit into
wolfSSL:masterfrom
padelsbach:timing
Open

padelsbach wants to merge 1 commit into
wolfSSL:masterfrom
padelsbach:timing

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

Adds 4 timer functions enabled with MBEDTLS_TIMING_C: get_timer, set_delay, get_delay and get_final_delay

Copilot AI balanced review requested due to automatic review settings November 17, 2026 05:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The timer fallback mixes monotonic and wall-clock timestamps when clock reads fail, producing enormous elapsed values that can cause delays to expire prematurely.

1 open issue
What changed in this PR

Adds four timer APIs to the Mbed TLS compatibility layer, enabled by MBEDTLS_TIMING_C on Windows and Unix-like systems.

Changes:

  • Implements timer and delay APIs with platform clock support and shared-library exports.
  • Adds timer unit tests and a load_roots integration case.
  • Documents timer availability and test coverage.
File Description
wolfpsa/​mbedtls_compat/​mbedtls/​timing.h Declares timer contexts and four public APIs.
wolfpsa.map Exports timing symbols.
tools/​psa_want_probe.c Enables timing support on supported platforms.
test/​mbedtls_compat/​timing_test.c Tests elapsed time, delays, cancellation, and null arguments.
test/​mbedtls_compat/​programs.sh Adds load_roots and supports server-free cases.
test/​mbedtls_compat/​Makefile Builds timer tests and load_roots.
src/​mbedtls/​timing.c Implements clock reads and timer operations.
README.md Documents timer support and unit tests.

Review effort: Balanced

Comment thread src/mbedtls/timing.c Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the Mbed TLS-compatible timer changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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.

3 participants