Documentation ¶
Index ¶
- Constants
- Variables
- func Decrypt(privKey libp2p.PrivKey, ciphertext []byte) ([]byte, error)
- func Encrypt(pubKey libp2p.PubKey, plaintext []byte) ([]byte, error)
- func NATtoString(i stunlib.NATType) string
- func Shuffle(a []string)
- func Stun() (int, error)
- type MessageRetriever
- type NetworkService
- type PointerRepublisher
Constants ¶
View Source
const ( // The version of the encryption algorithm used. Currently only 1 is supported CiphertextVersion = 1 // Length of the serialized version in bytes CiphertextVersionBytes = 4 // Length of the secret key used to generate the AES and MAC keys in bytes SecretKeyBytes = 32 // Length of the AES key in bytes AESKeyBytes = 32 // Length of the MAC key in bytes MacKeyBytes = 32 // Length of the RSA encrypted secret key ciphertext in bytes EncryptedSecretKeyBytes = 512 // Length of the MAC in bytes MacBytes = 32 )
Variables ¶
View Source
var ( // The ciphertext cannot be shorter than CiphertextVersionBytes + EncryptedSecretKeyBytes + aes.BlockSize + MacKeyBytes ErrShortCiphertext = errors.New("Ciphertext is too short") // The Hmac included in the ciphertext is invalid ErrInvalidHmac = errors.New("Invalid Hmac") // Satic salt used in the hdkf Salt = []byte("OpenBazaar Encryption Algorithm") )
View Source
var STUN_PORT int = 3478
View Source
var STUN_SERVERS []string = []string{
"stun.ekiga.net",
"stun.ideasip.com",
"stun.voiparound.com",
"stun.voipbuster.com",
"stun.voipstunt.com",
"stun.voxgratia.org",
}
Functions ¶
func NATtoString ¶
Types ¶
type MessageRetriever ¶
type MessageRetriever struct {
// contains filtered or unexported fields
}
func NewMessageRetriever ¶
func (*MessageRetriever) Run ¶
func (m *MessageRetriever) Run()
type NetworkService ¶
type NetworkService interface { // Handle incoming streams HandleNewStream(s inet.Stream) // Send request to a peer and wait for the response SendRequest(ctx context.Context, p peer.ID, pmes *pb.Message) (*pb.Message, error) // Send a message to a peer without requiring a response SendMessage(ctx context.Context, p peer.ID, pmes *pb.Message) error }
type PointerRepublisher ¶
type PointerRepublisher struct {
// contains filtered or unexported fields
}
func NewPointerRepublisher ¶
func NewPointerRepublisher(node *core.IpfsNode, database repo.Datastore) *PointerRepublisher
func (*PointerRepublisher) Run ¶
func (r *PointerRepublisher) Run()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.