lib

package
v0.0.0-...-83e1d0d Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(client, server kyber.Point) []byte

Context returns the context slice to be used when encrypting a share

func DhExchange

func DhExchange(ownPrivate kyber.Scalar, remotePublic kyber.Point) kyber.Point

DhExchange computes the shared key from a private key and a public key

func GenEphemeralKeys

func GenEphemeralKeys(r *onet.Roster) (map[string]kyber.Scalar, map[string]kyber.Point)

GenEphemeralKeys generate an ephemeral key pair for every conode in the roster. Note: the security of this function should be verified, because we return also the private keys

func GenNonce

func GenNonce() []byte

GenNonce generates a 32 bytes nonce

func NewAEAD

func NewAEAD(fn func() hash.Hash, preSharedKey kyber.Point, context []byte) (cipher.AEAD, error)

NewAEAD returns the AEAD cipher to be use to encrypt a share

func SignWithNonce

func SignWithNonce(privateKey kyber.Scalar, msg []byte, nonce []byte) ([]byte, error)

SignWithNonce signs the message concatenated with the nonce using a Schnorr signature.

func VerifyWithNonce

func VerifyWithNonce(publicKey kyber.Point, msg []byte, nonce []byte, sig []byte) error

VerifyWithNonce verifies a signature of the message concatenated with the nonce.

Types

type Resource

type Resource struct {
	URL         string
	ContentType string
	Data        []byte
}

Resource is used to store everything is needed about the resource to run the protocol

func FetchAllResources

func FetchAllResources(URL string) ([]*Resource, error)

FetchAllResources fetches the main content and (part of) the files referenced in it

func FetchMainResource

func FetchMainResource(URL string) (*Resource, error)

FetchMainResource fetches the resource referenced by URL and return it as a format-agnostic array of bytes, together with the content type. Note that this function only fetches the main content referenced by the URL and not other contents present in the resource.

Jump to

Keyboard shortcuts

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