diff --git a/src/vendor/ECDSA384.hinted.patch b/src/vendor/ECDSA384.hinted.patch index fadf737..fe18d96 100644 --- a/src/vendor/ECDSA384.hinted.patch +++ b/src/vendor/ECDSA384.hinted.patch @@ -2,7 +2,7 @@ diff --git a/contracts/libs/crypto/ECDSA384.sol b/contracts/libs/crypto/ECDSA384 index 9e43756..053803b 100644 --- a/contracts/libs/crypto/ECDSA384.sol +++ b/contracts/libs/crypto/ECDSA384.sol -@@ -64,6 +64,40 @@ library ECDSA384 { +@@ -64,6 +64,28 @@ library ECDSA384 { bytes memory signature_, bytes memory pubKey_ ) internal view returns (bool) { @@ -22,16 +22,6 @@ index 9e43756..053803b 100644 + require(consumed_ == inverseHints_.length, "unused inverse hints"); + } + -+ function verifyWithHintsConsumed( -+ Parameters memory curveParams_, -+ bytes memory hashedMessage_, -+ bytes memory signature_, -+ bytes memory pubKey_, -+ bytes memory inverseHints_ -+ ) internal view returns (bool ok_, uint256 consumed_) { -+ return _verify(curveParams_, hashedMessage_, signature_, pubKey_, inverseHints_, true); -+ } -+ + function _verify( + Parameters memory curveParams_, + bytes memory hashedMessage_, diff --git a/src/vendor/ECDSA384.sol b/src/vendor/ECDSA384.sol index 7c33ad7..24dfde2 100644 --- a/src/vendor/ECDSA384.sol +++ b/src/vendor/ECDSA384.sol @@ -2,8 +2,8 @@ // // Vendored from Solarity solidity-lib: https://github.com/dl-solarity/solidity-lib // Base (upstream, unmodified): commit b947757194de6436062c2d68118c0352be84ac4be -// Local modifications: "Add hinted P384 inverse verification" (verifyWithHints / -// verifyWithHintsConsumed and the U384 hint-consumption paths), plus strict public +// Local modifications: "Add hinted P384 inverse verification" (verifyWithHints and the U384 +// hint-consumption paths), plus strict public // key coordinate bounds. The exact upstream diff is committed alongside this file // as ECDSA384.hinted.patch for review. // Copyright (c) 2023 Solarity. Originally licensed MIT (see header above). @@ -88,16 +88,6 @@ library ECDSA384 { require(consumed_ == inverseHints_.length, "unused inverse hints"); } - function verifyWithHintsConsumed( - Parameters memory curveParams_, - bytes memory hashedMessage_, - bytes memory signature_, - bytes memory pubKey_, - bytes memory inverseHints_ - ) internal view returns (bool ok_, uint256 consumed_) { - return _verify(curveParams_, hashedMessage_, signature_, pubKey_, inverseHints_, true); - } - function _verify( Parameters memory curveParams_, bytes memory hashedMessage_, diff --git a/src/vendor/README.md b/src/vendor/README.md index 15fb960..618c5a9 100644 --- a/src/vendor/README.md +++ b/src/vendor/README.md @@ -22,8 +22,8 @@ from `solidity-lib` is used by this repo. `ECDSA384.sol` carries two functional changes on top of the base commit: -- **"Add hinted P384 inverse verification"** — adding `verifyWithHints` / - `verifyWithHintsConsumed` and the hint-consumption paths in `U384` +- **"Add hinted P384 inverse verification"** — adding `verifyWithHints` and the + hint-consumption paths in `U384` (`initCallWithHints`, `_nextInverseHint`, the hinted branches of `moddivAssign` / `modinv`). - **Strict public key coordinate bounds** — `_isOnCurve` rejects coordinates `>= p`, diff --git a/test/helpers/ECDSA384HintCollector.sol b/test/helpers/ECDSA384HintCollector.sol index f9922b9..068f748 100644 --- a/test/helpers/ECDSA384HintCollector.sol +++ b/test/helpers/ECDSA384HintCollector.sol @@ -80,16 +80,6 @@ library ECDSA384HintCollectorLib { require(consumed_ == inverseHints_.length, "unused inverse hints"); } - function verifyWithHintsConsumed( - Parameters memory curveParams_, - bytes memory hashedMessage_, - bytes memory signature_, - bytes memory pubKey_, - bytes memory inverseHints_ - ) internal returns (bool ok_, uint256 consumed_) { - return _verify(curveParams_, hashedMessage_, signature_, pubKey_, inverseHints_, true); - } - function _verify( Parameters memory curveParams_, bytes memory hashedMessage_,