Lines Matching refs:privateKey
39 // PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer.
40 type PrivateKey []byte
43 func (priv PrivateKey) Public() crypto.PublicKey {
54 func (priv PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error) {
64 func GenerateKey(rand io.Reader) (publicKey PublicKey, privateKey PrivateKey, err error) {
75 publicKey, privateKey = NewKeyPairFromSeed(seed[:])
76 return publicKey, privateKey, nil
81 func NewKeyPairFromSeed(seed []byte) (publicKey PublicKey, privateKey PrivateKey) {
91 privateKey = make([]byte, PrivateKeySize)
101 copy(privateKey, seed[:])
102 copy(privateKey[32:], publicKeyBytes[:])
105 return publicKey, privateKey
108 // Sign signs the message with privateKey and returns a signature. It will
109 // panic if len(privateKey) is not PrivateKeySize.
110 func Sign(privateKey PrivateKey, message []byte) []byte {
111 if l := len(privateKey); l != PrivateKeySize {
116 h.Write(privateKey[:32])
141 h.Write(privateKey[32:])