package ecdsa
Import Path
crypto/internal/fips140/ecdsa (on go.dev)
Dependency Relation
imports 12 packages, and imported by one package
Package-Level Type Names (total 5)
Type Parameters:
P: Point[P]
N *bigmod.Modulus
func P224() *Curve[*nistec.P224Point]
func P256() *Curve[*nistec.P256Point]
func P384() *Curve[*nistec.P384Point]
func P521() *Curve[*nistec.P521Point]
func GenerateKey[P](c *Curve[P], rand io.Reader) (*PrivateKey, error)
func NewPrivateKey[P](c *Curve[P], D, Q []byte) (*PrivateKey, error)
func NewPublicKey[P](c *Curve[P], Q []byte) (*PublicKey, error)
func Sign[P, H](c *Curve[P], h func() H, priv *PrivateKey, rand io.Reader, hash []byte) (*Signature, error)
func SignDeterministic[P, H](c *Curve[P], h func() H, priv *PrivateKey, hash []byte) (*Signature, error)
func Verify[P](c *Curve[P], pub *PublicKey, hash []byte, sig *Signature) error
Type Parameters:
P: any
Point is a generic constraint for the [nistec] Point types.
( Point[P]) Add(p1, p2 P) P
( Point[P]) Bytes() []byte
( Point[P]) BytesX() ([]byte, error)
( Point[P]) ScalarBaseMult([]byte) (P, error)
( Point[P]) ScalarMult(P, []byte) (P, error)
( Point[P]) SetBytes([]byte) (P, error)
Point : github.com/apache/arrow-go/v18/internal/hashing.ByteSlice
(*PrivateKey) Bytes() []byte
(*PrivateKey) PublicKey() *PublicKey
*PrivateKey : github.com/apache/arrow-go/v18/internal/hashing.ByteSlice
func GenerateKey[P](c *Curve[P], rand io.Reader) (*PrivateKey, error)
func NewPrivateKey[P](c *Curve[P], D, Q []byte) (*PrivateKey, error)
func Sign[P, H](c *Curve[P], h func() H, priv *PrivateKey, rand io.Reader, hash []byte) (*Signature, error)
func SignDeterministic[P, H](c *Curve[P], h func() H, priv *PrivateKey, hash []byte) (*Signature, error)
(*PublicKey) Bytes() []byte
*PublicKey : github.com/apache/arrow-go/v18/internal/hashing.ByteSlice
func NewPublicKey[P](c *Curve[P], Q []byte) (*PublicKey, error)
func (*PrivateKey).PublicKey() *PublicKey
func Verify[P](c *Curve[P], pub *PublicKey, hash []byte, sig *Signature) error
Signature is an ECDSA signature, where r and s are represented as big-endian
byte slices of the same length as the curve order.
R []byte
S []byte
func Sign[P, H](c *Curve[P], h func() H, priv *PrivateKey, rand io.Reader, hash []byte) (*Signature, error)
func SignDeterministic[P, H](c *Curve[P], h func() H, priv *PrivateKey, hash []byte) (*Signature, error)
func Verify[P](c *Curve[P], pub *PublicKey, hash []byte, sig *Signature) error
Package-Level Functions (total 11)
Type Parameters:
P: Point[P]
GenerateKey generates a new ECDSA private key pair for the specified curve.
Type Parameters:
P: Point[P]
NewPrivateKey creates a new ECDSA private key from the given D and Q byte
slices. D must be the fixed-length big-endian encoding of the private scalar,
and Q must be the compressed or uncompressed encoding of the public point.
Type Parameters:
P: Point[P]
NewPublicKey creates a new ECDSA public key from the given Q byte slice.
Q must be the compressed or uncompressed encoding of the public point.
Type Parameters:
P: Point[P]
H: hash.Hash
Sign signs a hash (which shall be the result of hashing a larger message with
the hash function H) using the private key, priv. If the hash is longer than
the bit-length of the private key's curve order, the hash will be truncated
to that length.
Type Parameters:
P: Point[P]
H: hash.Hash
SignDeterministic signs a hash (which shall be the result of hashing a
larger message with the hash function H) using the private key, priv. If the
hash is longer than the bit-length of the private key's curve order, the hash
will be truncated to that length. This applies Deterministic ECDSA as
specified in FIPS 186-5 and RFC 6979.
Type Parameters:
H: hash.Hash
TestingOnlyNewDRBG creates an SP 800-90A Rev. 1 HMAC_DRBG with a plain
personalization string.
This should only be used for ACVP testing. hmacDRBG is not intended to be
used directly.
Type Parameters:
P: Point[P]
Verify verifies the signature, sig, of hash (which should be the result of
hashing a larger message) using the public key, pub. If the hash is longer
than the bit-length of the private key's curve order, the hash will be
truncated to that length.
The inputs are not considered confidential, and may leak through timing side
channels, or if an attacker has control of part of the inputs.
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |