crypto.BLAKE2b_256
const BLAKE2b_256 = iota
crypto.BLAKE2b_384
const BLAKE2b_384 = iota
crypto.BLAKE2b_512
const BLAKE2b_512 = iota
crypto.BLAKE2s_256
const BLAKE2s_256 = iota
crypto.MD4
const MD4 = iota
crypto.MD5
const MD5 = iota
crypto.MD5SHA1
const MD5SHA1 = iota
crypto.RIPEMD160
const RIPEMD160 = iota
crypto.SHA1
const SHA1 = iota
crypto.SHA224
const SHA224 = iota
crypto.SHA256
const SHA256 = iota
crypto.SHA384
const SHA384 = iota
crypto.SHA3_224
const SHA3_224 = iota
crypto.SHA3_256
const SHA3_256 = iota
crypto.SHA3_384
const SHA3_384 = iota
crypto.SHA3_512
const SHA3_512 = iota
crypto.SHA512
const SHA512 = iota
crypto.SHA512_224
const SHA512_224 = iota
crypto.SHA512_256
const SHA512_256 = iota
crypto.Decrypter
// 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 returns the public key corresponding to the opaque,
// private key.
Public() PublicKey
// Decrypt decrypts msg. The opts argument should be appropriate for
// the primitive used. See the documentation in each implementation for
// details.
Decrypt(rand io.Reader, msg []byte, opts DecrypterOpts) (plaintext []byte, err error)
}
crypto.Signer
// 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 returns the public key corresponding to the opaque,
// private key.
Public() PublicKey
// Sign signs digest with the private key, possibly using entropy from
// rand. For an RSA key, the resulting signature should be either a
// PKCS #1 v1.5 or PSS signature (as indicated by opts). For an (EC)DSA
// key, it should be a DER-serialised, ASN.1 signature structure.
//
// Hash implements the SignerOpts interface and, in most cases, one can
// simply pass in the hash function used as opts. Sign may also attempt
// to type assert opts to other types in order to obtain algorithm
// specific values. See the documentation in each package for details.
//
// Note that when a signature of a hash of a larger message is needed,
// the caller is responsible for hashing the larger message and passing
// the hash (as digest) and the hash function (as opts) to Sign.
Sign(rand io.Reader, digest []byte, opts SignerOpts) (signature []byte, err error)
}
crypto.SignerOpts
// SignerOpts contains options for signing with a Signer.
type SignerOpts interface {
// HashFunc returns an identifier for the hash function used to produce
// the message passed to Signer.Sign, or else zero to indicate that no
// hashing was done.
HashFunc() Hash
}
crypto.RegisterHash
// 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)