Beispiel #1
0
// GenerateKeyPair creates a public-secret keypair that can be used to sign and
// verify messages.
func GenerateSignatureKeys() (sk SecretKey, pk PublicKey, err error) {
	var entropy [EntropySize]byte
	_, err = rand.Read(entropy[:])
	if err != nil {
		return
	}

	skPointer, pkPointer := ed25519.GenerateKey(entropy)
	return *skPointer, *pkPointer, nil
}
Beispiel #2
0
// DeterministicSignatureKeys generates keys deterministically using the input
// entropy. The input entropy must be 32 bytes in length.
func DeterministicSignatureKeys(entropy [EntropySize]byte) (SecretKey, PublicKey) {
	skPointer, pkPointer := ed25519.GenerateKey(entropy)
	return *skPointer, *pkPointer
}
Beispiel #3
0
func (skd *stdKeyDeriver) deriveKeyPair(entropy [EntropySize]byte) (ed25519.SecretKey, ed25519.PublicKey) {
	return ed25519.GenerateKey(entropy)
}