Imports #
"hash"
"io"
"strconv"
"hash"
"io"
"strconv"
const BLAKE2b_256const BLAKE2b_384const BLAKE2b_512const BLAKE2s_256const MD4 Hash = *ast.BinaryExprconst MD5const MD5SHA1const RIPEMD160const SHA1const SHA224const SHA256const SHA384const SHA3_224const SHA3_256const SHA3_384const SHA3_512const SHA512const SHA512_224const SHA512_256var digestSizes = []uint8{...}var hashes = *ast.CallExprconst maxHashtype DecrypterOpts anyHash identifies a cryptographic hash function that is implemented in another package.
type Hash uintPrivateKey represents a private key using an unspecified algorithm. Although this type is an empty interface for backwards compatibility reasons, all private key types in the standard library implement the following interface interface{ Public() crypto.PublicKey Equal(x crypto.PrivateKey) bool } as well as purpose-specific interfaces such as [Signer] and [Decrypter], which can be used for increased type safety within applications.
type PrivateKey anyPublicKey represents a public key using an unspecified algorithm. Although this type is an empty interface for backwards compatibility reasons, all public key types in the standard library implement the following interface interface{ Equal(x crypto.PublicKey) bool } which can be used for increased type safety within applications.
type PublicKey anyDecrypter is an interface for an opaque private key that can be used for asymmetric decryption operations. An example would be an RSA key kept in a hardware module.
type Decrypter interface {
Public() PublicKey
Decrypt(rand io.Reader, msg []byte, opts DecrypterOpts) (plaintext []byte, err error)
}Signer is an interface for an opaque private key that can be used for signing operations. For example, an RSA key kept in a hardware module.
type Signer interface {
Public() PublicKey
Sign(rand io.Reader, digest []byte, opts SignerOpts) (signature []byte, err error)
}SignerOpts contains options for signing with a [Signer].
type SignerOpts interface {
HashFunc() Hash
}Available reports whether the given hash function is linked into the binary.
func (h Hash) Available() boolHashFunc simply returns the value of h so that [Hash] implements [SignerOpts].
func (h Hash) HashFunc() HashNew returns a new hash.Hash calculating the given hash function. New panics if the hash function is not linked into the binary.
func (h Hash) New() hash.HashRegisterHash registers a function that returns a new instance of the given hash function. This is intended to be called from the init function in packages that implement hash functions.
func RegisterHash(h Hash, f func() hash.Hash)Size returns the length, in bytes, of a digest resulting from the given hash function. It doesn't require that the hash function in question be linked into the program.
func (h Hash) Size() intfunc (h Hash) String() stringGenerated with Arrow