Documentation ¶
Overview ¶
Package gen contains routines that perform expensive cryptographic operations. These should only be used when absolutely needed by top-level commands, and not in, for example, in test code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptoGenerator ¶
type CryptoGenerator interface { // GeneratePrivateKeyAndPeerID returns a base64 encoded private key, and a peerID GeneratePrivateKeyAndPeerID() (string, string) // GenerateNickname uses a peerID to return a human-friendly nickname GenerateNickname(peerID string) string }
CryptoGenerator is an interface for generating cryptographic info like private keys and peerIDs
type CryptoSource ¶
type CryptoSource struct { }
CryptoSource is a source of cryptographic info
func NewCryptoSource ¶
func NewCryptoSource() *CryptoSource
NewCryptoSource returns a source of p2p cryptographic info that performs expensive computations like repeated primality testing
func (*CryptoSource) GenerateNickname ¶
func (g *CryptoSource) GenerateNickname(peerID string) string
GenerateNickname returns a nickname using a peerID as a seed
func (*CryptoSource) GeneratePrivateKeyAndPeerID ¶
func (g *CryptoSource) GeneratePrivateKeyAndPeerID() (privKey, peerID string)
GeneratePrivateKeyAndPeerID returns a private key and peerID
Click to show internal directories.
Click to hide internal directories.