Skip to content

Commit

Permalink
shrink function signature
Browse files Browse the repository at this point in the history
  • Loading branch information
rohenaz committed Oct 30, 2020
1 parent 1638e25 commit e45724e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ func DecryptWithPrivateKeyString(privateKey, data string) (string, error) {
}

// EncryptShared will encrypt data and provide shared keys for decryption
func EncryptShared(user1PrivateKey *bsvec.PrivateKey, user2PrivateKey *bsvec.PublicKey, data []byte) (*bsvec.PrivateKey, *bsvec.PublicKey, []byte, error) {
func EncryptShared(u1priv *bsvec.PrivateKey, u2pub *bsvec.PublicKey, in []byte) (*bsvec.PrivateKey, *bsvec.PublicKey, []byte, error) {
// Generate shared keys that can be decrypted by either user
sharedPrivKey, sharedPubKey := GenerateSharedKeyPair(user1PrivateKey, user2PrivateKey)
sharedPrivKey, sharedPubKey := GenerateSharedKeyPair(u1priv, u2pub)
// Encrypt data with shared key
encryptedData, err := bsvec.Encrypt(sharedPubKey, data)
encryptedData, err := bsvec.Encrypt(sharedPubKey, in)
return sharedPrivKey, sharedPubKey, encryptedData, err
}

0 comments on commit e45724e

Please sign in to comment.