ed25519

package module
v0.0.0-...-38002c4 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2015 License: BSD-3-Clause Imports: 5 Imported by: 68

Documentation

Overview

Edits copyright 2015 Factom Foundation under the MIT license.

Index

Constants

View Source
const (
	PublicKeySize  = 32
	PrivateKeySize = 64
	SignatureSize  = 64
)

Variables

This section is empty.

Functions

func CheckCanonicalSig

func CheckCanonicalSig(sig *[SignatureSize]byte) bool

func GenerateKey

func GenerateKey(rand io.Reader) (publicKey *[PublicKeySize]byte, privateKey *[PrivateKeySize]byte, err error)

GenerateKey generates a public/private key pair using randomness from rand.

func GetPublicKey

func GetPublicKey(privateKey *[PrivateKeySize]byte) (publicKey *[PublicKeySize]byte)

GetPublicKey returns a public key given a private key. in reference to this diagram http://i.stack.imgur.com/5afWK.png from this site http://crypto.stackexchange.com/questions/3596/is-it-possible-to-pick-your-ed25519-public-key Pass in a 64 byte slice with seed (k) as the private seed in the 32 MSBytes. The lower 32 bytes are overwritten with the calculated public key (A). The returned value is the same pubkey (A) in a 32 byte wide slice

func Sign

func Sign(privateKey *[PrivateKeySize]byte, message []byte) *[SignatureSize]byte

Sign signs the message with privateKey and returns a signature.

func Verify

func Verify(publicKey *[PublicKeySize]byte, message []byte, sig *[SignatureSize]byte) bool

Verify returns true iff sig is a valid signature of message by publicKey.

func VerifyCanonical

func VerifyCanonical(publicKey *[PublicKeySize]byte, message []byte, sig *[SignatureSize]byte) bool

VerifyCanonical returns true iff sig is valid and it is in the canonical form.

Types

This section is empty.

Directories

Path Synopsis
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519.
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519.

Jump to

Keyboard shortcuts

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