nucypher/ferveo

Provide error messaging around AAD mismatch detection

piotr-roslaniec opened this issue · 2 comments

  • ferveo API users have trouble debugging cases where CiphertextVerificationFailed is thrown in tpke
  • This error is thrown by check_ciphertext_validity(ciphertext, aad, g_inv)
  • Currently, we return ThresholdEncryptionError from the ferveo API, which is a catch-all for all tpke errors, including CiphertextVerificationFailed
  • Since g_inv is invariant (higher-level ferveo API provided a hardcoded default), this error is only thrown when ciphertext and aad are mismatched
  • Knowing this we can re-interpret the CiphertextVerificationFailed error and provide more concrete error messaging instead of ThresholdEncryptionError, for example: AADMismatchDuringCiphertextVerification