Documentation ¶
Index ¶
- Constants
- Variables
- func Exp(x, y []byte) []byte
- func Scheme(rng io.Reader) *scheme
- type PrivateKey
- func (p *PrivateKey) Bytes() []byte
- func (k *PrivateKey) Exp(publicKey *PublicKey) []byte
- func (p *PrivateKey) FromBytes(data []byte) error
- func (p *PrivateKey) MarshalBinary() ([]byte, error)
- func (p *PrivateKey) MarshalText() ([]byte, error)
- func (p *PrivateKey) Public() nike.PublicKey
- func (p *PrivateKey) Reset()
- func (p *PrivateKey) UnmarshalBinary(data []byte) error
- func (p *PrivateKey) UnmarshalText(data []byte) error
- type PublicKey
- func (p *PublicKey) Blind(blindingFactor nike.PrivateKey) error
- func (p *PublicKey) Bytes() []byte
- func (p *PublicKey) FromBytes(data []byte) error
- func (p *PublicKey) MarshalBinary() ([]byte, error)
- func (p *PublicKey) MarshalText() ([]byte, error)
- func (p *PublicKey) Reset()
- func (p *PublicKey) UnmarshalBinary(data []byte) error
- func (p *PublicKey) UnmarshalText(data []byte) error
Constants ¶
View Source
const ( // GroupElementLength is the length of a ECDH group element in bytes. GroupElementLength = 32 // PublicKeySize is the size of a serialized PublicKey in bytes. PublicKeySize = GroupElementLength // PrivateKeySize is the size of a serialized PrivateKey in bytes. PrivateKeySize = GroupElementLength )
Variables ¶
View Source
var ( // ErrBlindDataSizeInvalid indicates that the blinding data size was invalid. ErrBlindDataSizeInvalid error = errors.New("ecdh: blinding data size invalid") )
Functions ¶
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func NewKeypair ¶
func NewKeypair(r io.Reader) (*PrivateKey, error)
NewKeypair generates a new PrivateKey sampled from the provided entropy source.
func (*PrivateKey) Bytes ¶
func (p *PrivateKey) Bytes() []byte
func (*PrivateKey) Exp ¶
func (k *PrivateKey) Exp(publicKey *PublicKey) []byte
Exp calculates the shared secret with the provided public key.
func (*PrivateKey) FromBytes ¶
func (p *PrivateKey) FromBytes(data []byte) error
func (*PrivateKey) MarshalBinary ¶
func (p *PrivateKey) MarshalBinary() ([]byte, error)
func (*PrivateKey) MarshalText ¶
func (p *PrivateKey) MarshalText() ([]byte, error)
func (*PrivateKey) Public ¶
func (p *PrivateKey) Public() nike.PublicKey
func (*PrivateKey) Reset ¶
func (p *PrivateKey) Reset()
func (*PrivateKey) UnmarshalBinary ¶
func (p *PrivateKey) UnmarshalBinary(data []byte) error
func (*PrivateKey) UnmarshalText ¶
func (p *PrivateKey) UnmarshalText(data []byte) error
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func (*PublicKey) MarshalBinary ¶
func (*PublicKey) MarshalText ¶
func (*PublicKey) UnmarshalBinary ¶
func (*PublicKey) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.