gmcrypto

package module
v0.0.0-...-b3a68a9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

README

gmcrypto

国密版Golang crypto

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHash

func RegisterHash(h Hash2, f func() 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.

Types

type Hash2

type Hash2 uint

Hash2 identifies a cryptographic hash function that is implemented in another package.

const (
	MD4         Hash2 = 1 + iota // import golang.org/x/crypto/md4
	MD5                          // import crypto/md5
	SHA1                         // import crypto/sha1
	SHA224                       // import crypto/sha256
	SHA256                       // import crypto/sha256
	SHA384                       // import crypto/sha512
	SHA512                       // import crypto/sha512
	MD5SHA1                      // no implementation; MD5+SHA1 used for TLS RSA
	RIPEMD160                    // import golang.org/x/crypto/ripemd160
	SHA3_224                     // import golang.org/x/crypto/sha3
	SHA3_256                     // import golang.org/x/crypto/sha3
	SHA3_384                     // import golang.org/x/crypto/sha3
	SHA3_512                     // import golang.org/x/crypto/sha3
	SHA512_224                   // import crypto/sha512
	SHA512_256                   // import crypto/sha512
	BLAKE2s_256                  // import golang.org/x/crypto/blake2s
	BLAKE2b_256                  // import golang.org/x/crypto/blake2b
	BLAKE2b_384                  // import golang.org/x/crypto/blake2b
	BLAKE2b_512                  // import golang.org/x/crypto/blake2b
	SM3                          // import github.com/studyzy/gmcrypto/sm3

)

func NewHash2

func NewHash2(h crypto.Hash) Hash2

func (Hash2) Available

func (h Hash2) Available() bool

Available reports whether the given hash function is linked into the binary.

func (Hash2) HashFunc

func (h Hash2) HashFunc() Hash2

HashFunc simply returns the value of h so that Hash2 implements SignerOpts.

func (Hash2) New

func (h Hash2) New() hash.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 (Hash2) Size

func (h Hash2) Size() int

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 (Hash2) ToHash

func (h Hash2) ToHash() crypto.Hash

Directories

Path Synopsis
internal
cfg
Package cfg holds configuration shared by the Go command and internal/testenv.
Package cfg holds configuration shared by the Go command and internal/testenv.
cpu
Package cpu implements processor feature detection used by the Go standard library.
Package cpu implements processor feature detection used by the Go standard library.
testenv
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
Package tls partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.
Package tls partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.
Package x509 parses X.509-encoded keys and certificates.
Package x509 parses X.509-encoded keys and certificates.
pkix
Package pkix contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP.
Package pkix contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL