keymgr

package
v0.0.0-...-06a504d Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKey

func NewKey() *[32]byte

NewKey generates a new random 32 byte key

func Pubkey

func Pubkey(seckey *[32]byte) *[32]byte

Pubkey takes a secret key and perform a scalar base multiplication to obtain the public key

func SharedKey

func SharedKey(peerPublic, mySecret *[32]byte) (shared, myPublic *[32]byte)

SharedKey takes a peer's public key and our own secret key to obtain a shared secret through elliptic-curve Diffie-Hellmann. If mySecret is nil, a random secret key will be generated and the ephemeral public key will be output in myPublic. The peer needs our public key to be able to obtain the shared secret.

func Shred

func Shred(b *[32]byte)

Shred overwrites the contents of an *array with random data and then sets the pointer to nil in an attempt to clear secret data from memory

Types

This section is empty.

Jump to

Keyboard shortcuts

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