Skip to content

Commit

Permalink
chore: add KMSZeroSignature
Browse files Browse the repository at this point in the history
  • Loading branch information
PacificYield committed Dec 17, 2024
1 parent 5c45160 commit 013b90b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contracts/contracts/KMSVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 013b90b

Please sign in to comment.