Imports #
"hash"
"io"
"strconv"
"hash"
"io"
"strconv"
const BLAKE2b_256
const BLAKE2b_384
const BLAKE2b_512
const BLAKE2s_256
const MD4 Hash = *ast.BinaryExpr
const MD5
const MD5SHA1
const RIPEMD160
const SHA1
const SHA224
const SHA256
const SHA384
const SHA3_224
const SHA3_256
const SHA3_384
const SHA3_512
const SHA512
const SHA512_224
const SHA512_256
var digestSizes = []uint8{...}
var hashes = *ast.CallExpr
const maxHash
type DecrypterOpts any
Hash identifies a cryptographic hash function that is implemented in another package.
type Hash uint
PrivateKey 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 any
PublicKey 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 any
Decrypter 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() bool
HashFunc simply returns the value of h so that [Hash] implements [SignerOpts].
func (h Hash) HashFunc() Hash
New 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.Hash
RegisterHash 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() int
func (h Hash) String() string
Generated with Arrow