Skip to content

Commit

Permalink
feat: create key exchange (#497)
Browse files Browse the repository at this point in the history
* create key exchange

* missing import statement
  • Loading branch information
robdefeo committed Jan 5, 2020
1 parent 6766057 commit dad75b5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crypto/cipher/keyexchange.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package cipher

import (
"github.com/mailchain/mailchain/crypto"
)

type KeyExchange interface {
// EphemeralKey generates a private/public key pair.
EphemeralKey() (private crypto.PrivateKey, public crypto.PublicKey, err error)

// SharedSecret computes a secret value from ephemeralKey private key and recipientKey public key.
SharedSecret(ephemeralKey crypto.PrivateKey, recipientKey crypto.PublicKey) ([]byte, error)
}

0 comments on commit dad75b5

Please sign in to comment.