Documentation
¶
Overview ¶
Package crypto 加解密、签名接口定义
Index ¶
- Constants
- func CRandBytes(numBytes int) []byte
- func CRandHex(numDigits int) string
- func CReader() io.Reader
- func GetName(ty int) string
- func GetType(name string) int
- func MixEntropy(seedBytes []byte)
- func Register(name string, driver Crypto)
- func RegisterType(name string, ty int)
- func Ripemd160(bytes []byte) []byte
- func Sha256(bytes []byte) []byte
- func Sm3Hash(msg []byte) []byte
- type CertSignature
- type Crypto
- type PrivKey
- type PubKey
- type Signature
Constants ¶
View Source
const (
SignNameED25519 = "ed25519"
)
const
Variables ¶
This section is empty.
Functions ¶
func MixEntropy ¶
func MixEntropy(seedBytes []byte)
MixEntropy Mix additional bytes of randomness, e.g. from hardware, user-input, etc. It is OK to call it multiple times. It does not diminish security.
Types ¶
type Crypto ¶
type Crypto interface { GenKey() (PrivKey, error) SignatureFromBytes([]byte) (Signature, error) PrivKeyFromBytes([]byte) (PrivKey, error) PubKeyFromBytes([]byte) (PubKey, error) }
Crypto 加密
type PrivKey ¶
type PrivKey interface { Bytes() []byte Sign(msg []byte) Signature PubKey() PubKey Equals(PrivKey) bool }
PrivKey 私钥
Directories
¶
Path | Synopsis |
---|---|
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
|
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202. |
Click to show internal directories.
Click to hide internal directories.