Skip to content

Commit

Permalink
Remove copy of ECDSA384 (rely on solarity repo)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog committed Dec 4, 2024
1 parent c63aeab commit e94a3ec
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 1,105 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/solidity-lib"]
path = lib/solidity-lib
url = https://github.com/dl-solarity/solidity-lib
1 change: 1 addition & 0 deletions lib/solidity-lib
Submodule solidity-lib added at 79f75d
1 change: 1 addition & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
forge-std/=lib/forge-std/src/
@solarity/=lib/solidity-lib/contracts/
14 changes: 3 additions & 11 deletions src/CertManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ pragma solidity ^0.8.19;

import {Sha2Ext} from "./Sha2Ext.sol";
import {Asn1Decode, Asn1Ptr, LibAsn1Ptr} from "./Asn1Decode.sol";
import {ECDSA384} from "./ECDSA384.sol";
import {ECDSA384} from "@solarity/libs/crypto/ECDSA384.sol";
import {ECDSA384Curve} from "./ECDSA384Curve.sol";
import {LibBytes} from "./LibBytes.sol";
import {ICertManager} from "./ICertManager.sol";

Expand Down Expand Up @@ -262,15 +263,6 @@ contract CertManager is ICertManager {
}

function _verifySignature(bytes memory pubKey, bytes memory hash, bytes memory sig) internal view {
ECDSA384.Parameters memory CURVE_PARAMETERS = ECDSA384.Parameters({
a: ECDSA384.CURVE_A,
b: ECDSA384.CURVE_B,
gx: ECDSA384.CURVE_GX,
gy: ECDSA384.CURVE_GY,
p: ECDSA384.CURVE_P,
n: ECDSA384.CURVE_N,
lowSmax: ECDSA384.CURVE_LOW_S_MAX
});
require(ECDSA384.verify(CURVE_PARAMETERS, hash, sig, pubKey), "invalid sig");
require(ECDSA384.verify(ECDSA384Curve.p384(), hash, sig, pubKey), "invalid sig");
}
}
Loading

0 comments on commit e94a3ec

Please sign in to comment.