Add ciphertext check (#5930)

This commit is contained in:
Shawn Xie
2025-10-23 11:57:18 -04:00
committed by GitHub
parent 8e9cb3c1da
commit 35e4fad557
6 changed files with 53 additions and 6 deletions

View File

@@ -130,6 +130,14 @@ serializeEcPair(
secp256k1_pubkey const& in2,
Buffer& buffer);
/**
* @brief Verifies that a buffer contains two valid, parsable EC public keys.
* @param buffer The input buffer containing two concatenated components.
* @return true if both components can be parsed successfully, false otherwise.
*/
bool
isValidCiphertext(Slice const& buffer);
TER
homomorphicAdd(Slice const& a, Slice const& b, Buffer& out);

View File

@@ -141,6 +141,7 @@ enum TEMcodes : TERUnderlyingType {
temARRAY_TOO_LARGE,
temBAD_TRANSFER_FEE,
temINVALID_INNER_BATCH,
temBAD_CIPHERTEXT,
};
//------------------------------------------------------------------------------