forked from mailchain/mailchain-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create a key exchange for ed25519 package mailchain#504 and sr2…
…5519 packange mailchain#505
- Loading branch information
1 parent
c452cc2
commit 8057a13
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package ed25519 | ||
|
||
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package sr25519 | ||
|
||
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) | ||
} |