Source File
hash.go
Belonging Package
crypto/internal/fips140hash
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package fips140hash
import (
fsha3
_
)
//go:linkname sha3Unwrap
func sha3Unwrap(*sha3.SHA3) *fsha3.Digest
// Unwrap returns h, or a crypto/internal/fips140 inner implementation of h.
//
// The return value can be type asserted to one of
// [crypto/internal/fips140/sha256.Digest],
// [crypto/internal/fips140/sha512.Digest], or
// [crypto/internal/fips140/sha3.Digest] if it is a FIPS 140-3 approved hash.
func ( hash.Hash) hash.Hash {
if , := .(*sha3.SHA3); {
return sha3Unwrap()
}
return
}
// UnwrapNew returns a function that calls newHash and applies [Unwrap] to the
// return value.
func [ hash.Hash]( func() ) func() hash.Hash {
return func() hash.Hash { return Unwrap(()) }
}
![]() |
The pages are generated with Golds v0.7.6-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |