Provide error messaging around AAD mismatch detection
piotr-roslaniec opened this issue · 2 comments
piotr-roslaniec commented
ferveo
API users have trouble debugging cases whereCiphertextVerificationFailed
is thrown intpke
- This error is thrown by
check_ciphertext_validity(ciphertext, aad, g_inv)
- Currently, we return
ThresholdEncryptionError
from theferveo
API, which is a catch-all for alltpke
errors, includingCiphertextVerificationFailed
- Since
g_inv
is invariant (higher-levelferveo
API provided a hardcoded default), this error is only thrown whenciphertext
andaad
are mismatched - Knowing this we can re-interpret the
CiphertextVerificationFailed
error and provide more concrete error messaging instead ofThresholdEncryptionError
, for example:AADMismatchDuringCiphertextVerification