Skip to main content

try_fips_self_test

Function try_fips_self_test 

Source
pub fn try_fips_self_test() -> Result<(), Unspecified>
Expand description

Runs the AWS-LC cryptographic algorithm self-tests on demand.

In FIPS builds, AWS-LC runs its known-answer self-tests automatically at power-on or before an algorithm’s first use. This re-runs all of them (BORINGSSL_self_test) on demand; it does not re-run the module integrity test.

In a FIPS build, a known-answer mismatch is a FIPS failure and, by default, AWS-LC aborts the process before this function returns. Other failures during a self-test (e.g. allocation, or an operation returning an error) are reported as Err. In a non-FIPS build nothing aborts; every failure is reported as Err.

A successful result does not indicate that the library is operating in FIPS mode; use try_fips_mode() for that.

§Errors

error::Unspecified if any self-test fails or cannot be completed. Treat any Err as a self-test failure.