Documentation ¶
Overview ¶
Package ecdsa implements the Elliptic Curve Digital Signature Algorithm, as defined in FIPS 186-3.
This implementation derives the nonce from an AES-CTR CSPRNG keyed by ChopMD(256, SHA2-512(priv.D || entropy || hash)). The CSPRNG key is IRO by a result of Coron; the AES-CTR stream is IRO under standard assumptions.
Index ¶
- func GenerateKeyBySeed(c elliptic.Curve, seed []byte) (*ecdsa.PrivateKey, error)
- func MarshalECDSASignature(r, s *big.Int) ([]byte, error)
- func MarshalPublicKey(publicKey *ecdsa.PublicKey) []byte
- func SignECDSA(k *ecdsa.PrivateKey, msg []byte) (signature []byte, err error)
- func SignV2ECDSA(k *ecdsa.PrivateKey, msg []byte) (signature []byte, err error)
- func UnmarshalECDSASignature(rawSig []byte) (*big.Int, *big.Int, error)
- func VerifyECDSA(k *ecdsa.PublicKey, sig, msg []byte) (valid bool, err error)
- func VerifyV2ECDSA(k *ecdsa.PublicKey, sig, msg []byte) (valid bool, err error)
- type ECDSASignature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKeyBySeed ¶
GenerateKey generates a public and private key pair.
func MarshalECDSASignature ¶
use DER-encoded ASN.1 octet standard to represent the signature 与比特币算法一样,基于DER-encoded ASN.1 octet标准,来表达使用椭圆曲线签名算法返回的结果
func SignV2ECDSA ¶
func SignV2ECDSA(k *ecdsa.PrivateKey, msg []byte) (signature []byte, err error)
func UnmarshalECDSASignature ¶
Types ¶
type ECDSASignature ¶
Click to show internal directories.
Click to hide internal directories.