diff --git a/crypto/ecies.go b/crypto/ecies.go index ea4e785c80..e263a7ca9b 100644 --- a/crypto/ecies.go +++ b/crypto/ecies.go @@ -78,7 +78,7 @@ func EncryptECIES(plainText []byte, publicKey *ecdh.PublicKey, associatedData [] return nil, fmt.Errorf("failed KDF operation for HMAC key: %w", err) } - cipherText, _, err := EncryptAES(plainText, aesKey, makeAAD(ephemeralPrivate.Bytes(), associatedData), true) + cipherText, _, err := EncryptAES(plainText, aesKey, makeAAD(ephemeralPublic.Bytes(), associatedData), true) if err != nil { return nil, fmt.Errorf("failed to encrypt: %w", err) }