Documentation ¶
Overview ¶
Package crypto 加解密、签名接口定义
Index ¶
- Variables
- 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, isCGO bool)
- func RegisterType(name string, ty int)
- func Ripemd160(bytes []byte) []byte
- func Sha256(bytes []byte) []byte
- func Sm3Hash(msg []byte) []byte
- type AggregateCrypto
- type CertSignature
- type Crypto
- type PrivKey
- type PubKey
- type Signature
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotSupportAggr = errors.New("AggregateCrypto not support")
ErrNotSupportAggr 不支持聚合签名
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 AggregateCrypto ¶ added in v1.65.0
type AggregateCrypto interface { Aggregate(sigs []Signature) (Signature, error) AggregatePublic(pubs []PubKey) (PubKey, error) VerifyAggregatedOne(pubs []PubKey, m []byte, sig Signature) error VerifyAggregatedN(pubs []PubKey, ms [][]byte, sig Signature) error }
AggregateCrypto 聚合签名
func ToAggregate ¶ added in v1.65.0
func ToAggregate(c Crypto) (AggregateCrypto, error)
ToAggregate 判断签名是否可以支持聚合签名,并且返回聚合签名的接口
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.