X3DH

package
v0.0.0-...-1dd84db Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitiatorCurve25519

func InitiatorCurve25519(
	hashString string,
	publicIdentityKeyReceiver ed25519.PublicKey,
	publicSignedPreKeyReceiver ed25519.PublicKey,
	publicOneTimePreKeyReceiver ed25519.PublicKey,
	privateIdentityKeySender ed25519.PrivateKey,
	privateEphemeralKeySender ed25519.PrivateKey) ([]byte, error)

InitiatorCurve25519 performs the X3DH Keyexchange using Curve25519. It is used by the initiator of the Keyexchange.

It returns the shared secret and an error wich is nil if nothing bad happened.

!!Make sure to check the signature of the Public Keys before using this function!!

Parameters:

hashString: a string that specifies the used hash function (SHA256, SHA512)

The rest is exacty what the names of the parameters are.
The Private Keys have the type ed25519.PrivateKey and the Public Keys the type ed25519.PublicKey.
To get those types import the package golang.org/x/crypto/ed25519.

func ReceiverCurve25519

func ReceiverCurve25519(
	hashString string,
	privateIdentityKeyReceiver ed25519.PrivateKey,
	privateSignedPreKeyReceiver ed25519.PrivateKey,
	privateOneTimePreKeyReceiver ed25519.PrivateKey,
	publicIdentityKeySender ed25519.PublicKey,
	publicEphemeralKeySender ed25519.PublicKey) ([]byte, error)

ReceiverCurve25519 performs the X3DH Keyexchange using Curve25519. It is used by the receiver of the Keyexchange.

It returns the shared secret and an error wich is nil if nothing bad happened.

!!Make sure to check the signature of the Public Keys before using this function!!

Parameters:

hashString: a string that specifies the used hash function (SHA256, SHA512)

The rest is exacty what the names of the parameters are.
The Private Keys have the type ed25519.PrivateKey and the Public Keys the type ed25519.PublicKey.
To get those types import the package golang.org/x/crypto/ed25519.

Types

This section is empty.

Jump to

Keyboard shortcuts

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