chatcrypt

package
v0.0.0-...-97b5c88 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EConvertCurvePubKey = fmt.Errorf("convert ed25519 public key to curve25519 public key failed")
)
View Source
var KP = struct {
	S int
	N int
	R int
	P int
	L int
}{
	S: 8,
	N: 1 << 15,
	R: 8,
	P: 1,
	L: 32,
}

Functions

func Decrypt

func Decrypt(key []byte, cipherTxt []byte) ([]byte, error)

func DecryptAndIV

func DecryptAndIV(key []byte, cipherTxt []byte) (iv, plainTxt []byte, err error)

func DeriveGroupKey

func DeriveGroupKey(priv ed25519.PrivateKey, groupPKs [][]byte, pubkeys [][]byte) (aes []byte, err error)

func DeriveGroupKey2

func DeriveGroupKey2(priv ed25519.PrivateKey, groupPKs []string, pubkeys []string) (aes []byte, err error)

func DeriveKey

func DeriveKey(seed []byte) (pub ed25519.PublicKey, priv ed25519.PrivateKey)

func Encrypt

func Encrypt(key []byte, plainTxt []byte) ([]byte, error)

func EncryptWithIV

func EncryptWithIV(key, iv, plainTxt []byte) ([]byte, error)

func GenEd25519KeyAndSave

func GenEd25519KeyAndSave(password string) error

func GenGroupAesKey

func GenGroupAesKey(mainPriv ed25519.PrivateKey, pubkeys [][]byte) (aes []byte, groupKeys [][]byte, err error)

func GenGroupAesKey2

func GenGroupAesKey2(mainPriv ed25519.PrivateKey, pubkeys []string) (aes []byte, groupKeys []string, err error)

func GenerateAesKey

func GenerateAesKey(peerPub []byte, key ed25519.PrivateKey) ([]byte, error)

func InsertionSortDArray

func InsertionSortDArray(arr [][]byte) [][]byte

func KeyIsGenerated

func KeyIsGenerated() bool

func LoadKey

func LoadKey(password string)

func PrivateKeyToCurve25519

func PrivateKeyToCurve25519(curve25519Private *[32]byte, privateKey *[64]byte)

func PublicKeyToCurve25519

func PublicKeyToCurve25519(curve25519Public *[32]byte, publicKey *[32]byte) bool

func Sign

func Sign(priv ed25519.PrivateKey, message []byte) []byte

func Verify

func Verify(pub ed25519.PublicKey, message, sig []byte) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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