AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 19 Bitcoin

feat(core/sys): expose time functions to Rust

Public commit record

What the developer wrote

Authored by matejcik

57/100 · Thin
feat(core/sys): expose time functions to Rust
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
The short version

What changed, and why it matters

This commit is a large internal refactoring that moves time-related code (Duration, Instant, sleep, tick counters) from one Rust module to another shared system module so it can be reused more cleanly. It does not change what the code does; it only reorganizes where the definitions live. There is no obvious security bug introduced, but any big refactor carries a small risk of accidental behavior changes.

Recommended action

Treat as a routine refactor. Review the `sysevent.rs` deadline conversion for equivalence under wraparound, verify that the new `sys::time` module is compiled with the same overflow/debug-assert behavior as the old one, and run existing timing/timeout tests. No immediate security response is warranted based on this diff alone.

Security signals we found

01

Large refactor touching 70 files and timing primitives used by security-sensitive flows (UI timeouts, bootloader delays, SMP/THP retransmission, sysevent polling)

02

One functional-looking change in `sysevent.rs`: poll deadline converted from `ticks_ms().wrapping_add(100)` to `Instant::now().checked_add(Duration::from_millis(100)).unwrap().to_millis()`; semantics appear equivalent

03

Removal of local `trezorhal::time` wrapper and centralization of unsafe FFI calls in `sys::time`

04

No input validation, parsing, or cryptographic code is modified

Risk score

Why this scored 19/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 3/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.