bitrot: add selftest for server startup (#11917)

This commit adds a self-test for all bitrot algorithms:
 - SHA-256
 - BLAKE2b
 - HighwayHash

The self-test computes an incremental checksum of pseudo-random
messages. If a bitrot algorithm implementation stops working on
some CPU architecture or with a certain Go version this self-test
will prevent the server from starting and silently corrupting data.

For additional context see: minio/highwayhash#19
This commit is contained in:
Andreas Auernhammer
2021-04-06 17:38:22 +02:00
committed by GitHub
parent 075bccda42
commit d5d2fc9850
2 changed files with 42 additions and 0 deletions

View File

@@ -413,6 +413,7 @@ func serverMain(ctx *cli.Context) {
logger.AddTarget(globalConsoleSys)
// Perform any self-tests
bitrotSelfTest()
erasureSelfTest()
compressSelfTest()