Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

classify

Public Function
std.crypto.timing_safe.classify
pub fn classify(ptr: anytype) void

Mark a value as sensitive or secret, helping to detect potential side-channel vulnerabilities.

When Valgrind is enabled, this function allows for the detection of conditional jumps or lookups that depend on secrets or secret-derived data. Violations are reported by Valgrind as operations relying on uninitialized values.

If Valgrind is disabled, it has no effect.

Use this function to verify that cryptographic operations perform constant-time arithmetic on sensitive data, ensuring the confidentiality of secrets and preventing information leakage through side channels.

Params

  • ptr

File

crypto/timing_safe.zig:170
170
171
172
pub fn classify(ptr: anytype) void {
    markSecret(ptr, .classify);
}