// fatal is [runtime.fatal], pushed via linkname. // //go:linkname fatal func fatal(string) var failfipscast … var testingOnlyCASTHook … // CAST runs the named Cryptographic Algorithm Self-Test (if compiled and // operated in FIPS mode) and aborts the program (stopping the module // input/output and entering the "error state") if the self-test fails. // // These are mandatory self-checks that must be performed by FIPS 140-3 modules // before the algorithm is used. See Implementation Guidance 10.3.A. // // The name must not contain commas, colons, hashes, or equal signs. // // When calling this function, also add the calling package to cast_test.go. func CAST(name string, f func() error) { … }