Skip to main content

Module cpu

Module cpu 

Source
Expand description

CPU feature detection.

Lives in ic-core so that both the implementation crates and the ontology can consult it without either depending on the other: ic-cipher uses it to pick a backend, and ic-ontology uses it to tell an agent which backend is live.

Detection is compile-time when the feature is already enabled for the build (-C target-cpu=native, or an explicit -C target-feature=+aes), and runtime otherwise. Under no_std only the compile-time path exists, because runtime detection needs std.

Every query here depends only on the CPU, never on key material, so none of it is a side channel.

Functionsยง

has_aes
Whether x86 AES-NI is available.
has_ghash_clmul
Whether GHASH will run on the carry-less multiply in this build.
has_pclmulqdq
Whether carry-less multiplication (PCLMULQDQ) is available.