Documentation
¶
Overview ¶
Example ¶
// Generate a P-256 ECDH key pair.
k, err := ecdh.P256().GenerateKey(rand.Reader)
if err != nil {
panic(err)
}
// Encode the public key.
encoded, err := Encode(k.PublicKey().Bytes(), rand.Reader)
if err != nil {
panic(err)
}
// Decode the public key.
qP, err := Decode(encoded)
if err != nil {
panic(err)
}
// Compare the two.
fmt.Println(bytes.Equal(k.PublicKey().Bytes(), qP))
Output: true
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidEncoding is returned when the given encoded point is malformed. ErrInvalidEncoding = errors.New("elligator: invalid encoding") // ErrInvalidPoint is returned when the given point is not an uncompressed SEC point. ErrInvalidPoint = errors.New("elligator: invalid point") )
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.