storj.io/minio@v0.0.0-20230509071714-0cbc90f649b1/pkg/hash/sha256_fips.go (about) 1 // MinIO Cloud Storage, (C) 2021 MinIO, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 //go:build fips 16 // +build fips 17 18 package hash 19 20 import ( 21 "crypto/sha256" 22 "hash" 23 ) 24 25 // newSHA256 returns a new hash.Hash computing the SHA256 checksum. 26 // The SHA256 implementation is FIPS 140-2 compliant when the 27 // boringcrypto branch of Go is used. 28 // Ref: https://github.com/golang/go/tree/dev.boringcrypto 29 func newSHA256() hash.Hash { return sha256.New() }