Lines Matching full:hash
9 "hash"
14 // Hash identifies a cryptographic hash function that is implemented in another
16 type Hash uint
18 // HashFunc simply returns the value of h so that Hash implements SignerOpts.
19 func (h Hash) HashFunc() Hash {
24 MD4 Hash = 1 + iota // import golang.org/x/crypto/md4
68 // Size returns the length, in bytes, of a digest resulting from the given hash
69 // function. It doesn't require that the hash function in question be linked
71 func (h Hash) Size() int {
75 panic("crypto: Size of unknown hash function")
78 var hashes = make([]func() hash.Hash, maxHash)
80 // New returns a new hash.Hash calculating the given hash function. New panics
81 // if the hash function is not linked into the binary.
82 func (h Hash) New() hash.Hash {
89 panic("crypto: requested hash function #" + strconv.Itoa(int(h)) + " is unavailable")
92 // Available reports whether the given hash function is linked into the binary.
93 func (h Hash) Available() bool {
98 // hash function. This is intended to be called from the init function in
99 // packages that implement hash functions.
100 func RegisterHash(h Hash, f func() hash.Hash) {
102 panic("crypto: RegisterHash of unknown hash function")
125 // Hash implements the SignerOpts interface and, in most cases, one can
126 // simply pass in the hash function used as opts. Sign may also attempt
130 // Note that when a signature of a hash of a larger message is needed,
132 // the hash (as digest) and the hash function (as opts) to Sign.
138 // HashFunc returns an identifier for the hash function used to produce
141 HashFunc() Hash