ecdsa

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ecdsa provides Sign and Verify capabilities using ECDSA

I picked ethereum-go's implementation of ECDSA instead of the built in go libraries since it provides both build in marshaling/unmarshaling for the signature and a way to recover the Public Key from the signature. The reality is, we don't want to check if a given signature matches a given Public Key. Instead we want to know who signed this message, which is the Public Key. Then its easy to write logic to ensure nobody votes twice given a list of Public Keys or a list of hashed Public Keys, etc...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(data []byte) sig.Hash

Hash runs Keccak256 and returns a Hash

func NewFromPrivKey

func NewFromPrivKey(privKey *ecdsa.PrivateKey) sig.SignerVerifier

NewFromPrivKey takes a provided Private Key

func NewFromRandom

func NewFromRandom() (sig.SignerVerifier, error)

NewFromRandom generates a new random Private Key

func PubKeyToSignatory

func PubKeyToSignatory(pubKey *ecdsa.PublicKey) sig.Signatory

PubKeyToSignatory returns a `Signatory` using the same conversion that Ethereum uses to extract addresses from public keys.

Types

This section is empty.

Jump to

Keyboard shortcuts

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