exchange

package
v0.0.0-...-bb1a4e7 Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DHGroup

type DHGroup struct {
	// contains filtered or unexported fields
}

func CreateGroup

func CreateGroup(prime, generator *big.Int) (group *DHGroup)

This function enables users to create their own custom DHGroup. Most users will not however want to use this function, and should prefer the use of GetGroup which supplies DHGroups defined in RFCs 2409 and 3526

WARNING! You should only use this if you know what you are doing. The behavior of the group returned by this function is not defined if prime is not in fact prime.

func GetGroup

func GetGroup(groupID int) (group *DHGroup, err error)

This function fetches a DHGroup by its ID as defined in either RFC 2409 or RFC 3526.

If you are unsure what to use use group ID 0 for a sensible default value

func (*DHGroup) ComputeKey

func (gr *DHGroup) ComputeKey(pubkey *DHKey, privkey *DHKey) (key *DHKey, err error)

func (*DHGroup) G

func (gr *DHGroup) G() *big.Int

func (*DHGroup) GeneratePrivateKey

func (gr *DHGroup) GeneratePrivateKey(randReader io.Reader) (key *DHKey, err error)

func (*DHGroup) P

func (gr *DHGroup) P() *big.Int

type DHKey

type DHKey struct {
	// contains filtered or unexported fields
}

func NewPublicKey

func NewPublicKey(s []byte) *DHKey

func (*DHKey) Bytes

func (k *DHKey) Bytes() []byte

func (*DHKey) IsPrivateKey

func (k *DHKey) IsPrivateKey() bool

func (*DHKey) String

func (k *DHKey) String() string

Jump to

Keyboard shortcuts

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