xcrypto

package
v0.0.0-...-5e9972d Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ed25519Sign

func Ed25519Sign(prv *PrivateKey, message []byte) ([]byte, error)

Ed25519Sign -- sign.

func Ed25519Verify

func Ed25519Verify(pub *PublicKey, message []byte, sig []byte) bool

Ed25519Verify -- verfiy.

func GenerateEd25519KeyPair

func GenerateEd25519KeyPair() (*PrivateKey, *PublicKey, error)

GenerateEd25519KeyPair -- generate prv/pub pair by random.

func NewEd25519KeyFromSeed

func NewEd25519KeyFromSeed(seed []byte) (*PrivateKey, *PublicKey)

NewEd25519KeyFromSeed -- generate prv/pub pair by the seed hash.

Types

type Ed25519Party

type Ed25519Party struct {
	// contains filtered or unexported fields
}

Ed25519Party -- Ed25519 party struct.

func NewEd25519Party

func NewEd25519Party(prv *edwards.PrivateKey) *Ed25519Party

NewEd25519Party -- create new Ed25519Party.

func (*Ed25519Party) Phase1

func (party *Ed25519Party) Phase1(pub2 *edwards.PublicKey) *edwards.PublicKey

Phase1 -- return the aggregate public key.

func (*Ed25519Party) Phase2

func (party *Ed25519Party) Phase2(hash []byte) (*edwards.PublicKey, error)

Phase2 -- return the local RFC6979 nonce*G.

func (*Ed25519Party) Phase3

func (party *Ed25519Party) Phase3(pubnonce2 *edwards.PublicKey) *edwards.PublicKey

Phase3 -- returns the share nonce.

func (*Ed25519Party) Phase4

func (party *Ed25519Party) Phase4(hash []byte, groupPubkey *edwards.PublicKey, groupPubnonce *edwards.PublicKey) ([]byte, error)

Phase4 -- returns the local sign.

func (*Ed25519Party) Phase5

func (party *Ed25519Party) Phase5(sigs ...[]byte) ([]byte, error)

Phase5 -- returns the final sign.

type KeyPair

type KeyPair struct {
	Private *PrivateKey
	Public  *PublicKey
}

KeyPair --

type PrivateKey

type PrivateKey struct {
	Value *edwards.PrivateKey
}

PrivateKey --

type PublicKey

type PublicKey struct {
	Value *edwards.PublicKey
}

PublicKey --

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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