Skip to content

Commit

Permalink
Fix mistake in AAD
Browse files Browse the repository at this point in the history
  • Loading branch information
islamaliev committed Aug 18, 2024
1 parent c02e5f7 commit a01faa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/ecies.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit a01faa1

Please sign in to comment.