main
Raw Download raw file
 1package openpgp
 2
 3import (
 4	"crypto"
 5
 6	"github.com/ProtonMail/go-crypto/openpgp/internal/algorithm"
 7)
 8
 9// HashIdToHash returns a crypto.Hash which corresponds to the given OpenPGP
10// hash id.
11func HashIdToHash(id byte) (h crypto.Hash, ok bool) {
12	return algorithm.HashIdToHash(id)
13}
14
15// HashIdToString returns the name of the hash function corresponding to the
16// given OpenPGP hash id.
17func HashIdToString(id byte) (name string, ok bool) {
18	return algorithm.HashIdToString(id)
19}
20
21// HashToHashId returns an OpenPGP hash id which corresponds the given Hash.
22func HashToHashId(h crypto.Hash) (id byte, ok bool) {
23	return algorithm.HashToHashId(h)
24}