make_program_cache_key (added in #1912) uses hashlib.blake2b for cache key derivation. blake2b is not FIPS-approved, so hashlib.blake2b() raises ValueError on FIPS-compliant Linux systems:
ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS
This is common in government/DOE supercomputer environments — exactly where CUDA workloads run. CuPy hit the same issue with hashlib.md5 (cupy/cupy#5959, fixed in cupy/cupy#5988 by switching to SHA-1).
Note: FileStreamProgramCache._path_for_key also uses hashlib.blake2b to hash keys into filesystem paths — this needs the same fix.
Proposed fix
- Switch from blake2b to a FIPS-approved hash. Two options:
- SHA-1 (20-byte digest, FIPS-approved) — matches CuPy's choice. Faster than SHA-256. 160-bit collision resistance is more than sufficient for cache keys.
- SHA-256 (32-byte digest, FIPS-approved) — drop-in replacement for the current
blake2b(digest_size=32). Slightly slower but stronger.
- Remove both the hash algorithm name AND the digest size from the public
make_program_cache_key docstring — the Returns section currently says "A 32-byte blake2b digest." Both the algorithm and the size are implementation details that may change (e.g., switching to SHA-1 changes the size from 32 to 20 bytes). The return type should just be documented as bytes.
- Bump
_KEY_SCHEMA_VERSION to invalidate old caches (old blake2b entries become orphans, reaped by eviction).
make_program_cache_key(added in #1912) useshashlib.blake2bfor cache key derivation. blake2b is not FIPS-approved, sohashlib.blake2b()raisesValueErroron FIPS-compliant Linux systems:This is common in government/DOE supercomputer environments — exactly where CUDA workloads run. CuPy hit the same issue with
hashlib.md5(cupy/cupy#5959, fixed in cupy/cupy#5988 by switching to SHA-1).Note:
FileStreamProgramCache._path_for_keyalso useshashlib.blake2bto hash keys into filesystem paths — this needs the same fix.Proposed fix
blake2b(digest_size=32). Slightly slower but stronger.make_program_cache_keydocstring — theReturnssection currently says "A 32-byte blake2b digest." Both the algorithm and the size are implementation details that may change (e.g., switching to SHA-1 changes the size from 32 to 20 bytes). The return type should just be documented asbytes._KEY_SCHEMA_VERSIONto invalidate old caches (old blake2b entries become orphans, reaped by eviction).