diff --git a/contracts/contracts/KMSVerifier.sol b/contracts/contracts/KMSVerifier.sol index bed089b..df1ec17 100644 --- a/contracts/contracts/KMSVerifier.sol +++ b/contracts/contracts/KMSVerifier.sol @@ -30,6 +30,9 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea /// @param numSignatures Number of signatures. error KMSSignatureThresholdNotReached(uint256 numSignatures); + /// @notice Returned if the number of signatures is equal to 0. + error KMSZeroSignature(); + struct DecryptionResult { address aclAddress; uint256[] handlesList; @@ -250,6 +253,11 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea /// @return true if enough provided signatures are valid, false otherwise function verifySignaturesDigest(bytes32 digest, bytes[] memory signatures) internal virtual returns (bool) { uint256 numSignatures = signatures.length; + + if (numSignatures == 0) { + revert KMSZeroSignature(); + } + uint256 threshold = getThreshold(); if (numSignatures < threshold) {