Completed
Push — main ( 523495...f20dc9 )
by Yume
25s queued 13s
created

pkg/crypto/ed25519.go   A

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 10
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A crypto.GenerateKeyPair 0 7 2
1
package crypto
2
3
import (
4
	"crypto/ed25519"
5
	"crypto/rand"
6
7
	"github.com/pkg/errors"
8
)
9
10
func GenerateKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error) {
11
	publicKey, privateKey, err := ed25519.GenerateKey(rand.Reader)
12
	if err != nil {
13
		return nil, nil, errors.Wrap(err, "Error generating keys")
14
	}
15
16
	return publicKey, privateKey, nil
17
}
18