Browse Source

Comment about ed25519 private key format on Sign (#2632)

Closes #2001
pull/2635/head
Dev Ojha 6 years ago
committed by Ethan Buchman
parent
commit
0790223518
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      crypto/ed25519/ed25519.go

+ 6
- 0
crypto/ed25519/ed25519.go View File

@ -46,6 +46,12 @@ func (privKey PrivKeyEd25519) Bytes() []byte {
}
// Sign produces a signature on the provided message.
// This assumes the privkey is wellformed in the golang format.
// The first 32 bytes should be random,
// corresponding to the normal ed25519 private key.
// The latter 32 bytes should be the compressed public key.
// If these conditions aren't met, Sign will panic or produce an
// incorrect signature.
func (privKey PrivKeyEd25519) Sign(msg []byte) ([]byte, error) {
signatureBytes := ed25519.Sign(privKey[:], msg)
return signatureBytes[:], nil


Loading…
Cancel
Save