Beispiel #1
0
func (key PrivKeyEd25519) Sign(msg []byte) Signature {
	pubKey := key.PubKey().(PubKeyEd25519)
	keyBytes := new([64]byte)
	copy(keyBytes[:32], key[:])
	copy(keyBytes[32:], pubKey[:])
	signatureBytes := ed25519.Sign(keyBytes, msg)
	return SignatureEd25519(signatureBytes[:])
}
Beispiel #2
0
func (key PrivKeyEd25519) Sign(msg []byte) Signature {
	privKeyBytes := [64]byte(key)
	signatureBytes := ed25519.Sign(&privKeyBytes, msg)
	return SignatureEd25519(*signatureBytes)
}