Radar · Go · Archive · Week 48 · Nov 24 – 30, 2025
crypto/fips140: add Version
Nice to knowstdlib
- What changed
- The proposal adds
crypto/fips140.Version()to return the FIPS 140‑3 Go Cryptographic Module version. - Production impact
- The source does not say.
- Try it
- Call
fips140.Version()in a program. - Source
- github.com/golang/go/issues/75301
Understand it, then run it
The Go standard library now has a small helper in the crypto/fips140 package. If you build your program with the GOFIPS140 build tag, the function Version() will return the exact Go Cryptographic Module version that the build uses, such as "v1.0.0". When you are not building with that tag, or if the module is not frozen, it simply returns "latest". This lets you see which FIPS‑140‑3 version your binary is using without digging into build files.
Run it now
// This program demonstrates crypto/fips140.Version.
// It prints the FIPS 140-3 Go Cryptographic Module version
// if the build tag GOFIPS140 is set; otherwise it prints "latest".
package main
import (
"fmt"
"crypto/fips140"
)
func main() {
// Retrieve the module version.
v := fips140.Version()
fmt.Println("FIPS 140-3 Go Cryptographic Module version:", v)
}
What it printed when we ran it on Go 1.27.1
FIPS 140-3 Go Cryptographic Module version: latest
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed