Documentation ¶
Overview ¶
Edits copyright 2015 Factom Foundation under the MIT license.
Index ¶
- Constants
- func CheckCanonicalSig(sig *[SignatureSize]byte) bool
- func GenerateKey(rand io.Reader) (publicKey *[PublicKeySize]byte, privateKey *[PrivateKeySize]byte, err error)
- func GetPublicKey(privateKey *[PrivateKeySize]byte) (publicKey *[PublicKeySize]byte)
- func Sign(privateKey *[PrivateKeySize]byte, message []byte) *[SignatureSize]byte
- func Verify(publicKey *[PublicKeySize]byte, message []byte, sig *[SignatureSize]byte) bool
- func VerifyCanonical(publicKey *[PublicKeySize]byte, message []byte, sig *[SignatureSize]byte) bool
Constants ¶
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. |