crypto

package
v0.0.0-...-2af7037 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

NonceSize is the size of nonce used by EncryptBytes

Variables

This section is empty.

Functions

func CreatePublicKey

func CreatePublicKey(sk []byte) []byte

CreatePublicKey generates a public key give a secret key sk

func DecryptBytes

func DecryptBytes(c, otherPk, userSk []byte) (uint32, []byte, error)

DecryptBytes takes an encrypted packet and returns (packet id, plaintext)

func EncryptBytes

func EncryptBytes(otherPk, userSk, plaintext []byte, packetID uint32) []byte

EncryptBytes creates an encrypted packet and consumes the plaintext storage

func RandomBytes

func RandomBytes(n int) []byte

RandomBytes return a []byte of n size with random content

Types

This section is empty.

Jump to

Keyboard shortcuts

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