crypto

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package crypto

@author: xwc1125

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ECDSA

type ECDSA interface {
	GenerateKey(curve elliptic.Curve) (*ecdsa.PrivateKey, error)

	HashType(curveName string) crypto.Hash
	HashFunc(cryptoName string) func() hash.Hash
	HashMsg(cryptoName string, data []byte) ([]byte, error)

	ToECDSA(prv crypto.PrivateKey) *ecdsa.PrivateKey
	FromECDSA(prv *ecdsa.PrivateKey) crypto.PrivateKey
	ToECDSAPubKey(pub crypto.PublicKey) *ecdsa.PublicKey
	FromECDSAPubKey(pub *ecdsa.PublicKey) crypto.PublicKey

	MarshalPrivateKey(key *ecdsa.PrivateKey) ([]byte, error)
	UnmarshalPrivateKey(curve elliptic.Curve, keyBytes []byte) (*ecdsa.PrivateKey, error)
	MarshalPublicKey(pub *ecdsa.PublicKey) ([]byte, error)
	UnmarshalPublicKey(curve elliptic.Curve, data []byte) (*ecdsa.PublicKey, error)

	MarshalPrivateKeyX509(key *ecdsa.PrivateKey) ([]byte, error)
	UnmarshalPrivateKeyX509(curve elliptic.Curve, keyBytes []byte) (*ecdsa.PrivateKey, error)
	MarshalPublicKeyX509(pub *ecdsa.PublicKey) ([]byte, error)
	UnmarshalPublicKeyX509(curve elliptic.Curve, data []byte) (*ecdsa.PublicKey, error)

	Sign(prv *ecdsa.PrivateKey, hash []byte) (sig []byte, err error)
	Verify(pub *ecdsa.PublicKey, hash []byte, signature []byte) bool
}

Directories

Path Synopsis
base
base36
Package base36
Package base36
base58
Package base58
Package base58
base64
Package base64 base64编码
Package base64 base64编码
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
cloudflare
Package bn256 implements a particular bilinear group at the 128-bit security level.
Package bn256 implements a particular bilinear group at the 128-bit security level.
google
Package bn256 implements a particular bilinear group.
Package bn256 implements a particular bilinear group.
Package hashalg
Package hashalg
blake2b
Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xb.
Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xb.
sha3
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.
Package icap
Package icap
Package keccak
Package keccak
Package scrypt
Package scrypt
Package signature
Package signature
gmsm
Package gmsm
Package gmsm
prime256v1
Package prime256v1
Package prime256v1
secp256k1
Package secp256k1
Package secp256k1

Jump to

Keyboard shortcuts

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