Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contracts/solidity/TEEInferenceVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ contract TEEInferenceVerifier is AccessControl {
uint256 timestamp,
bytes calldata signature
) public view returns (bool) {
// 1. TEE must be active in the registry
if (!registry.isActive(teeId)) return false;
// 1. TEE must be enabled in the registry
if (!registry.isTEEEnabled(teeId)) return false;

// 2. Timestamp bounds
uint256 minTs = block.timestamp > MAX_INFERENCE_AGE
Expand All @@ -109,7 +109,7 @@ contract TEEInferenceVerifier is AccessControl {
if (timestamp < minTs || timestamp > maxTs) return false;

// 3. Cryptographic verification
bytes memory pubKey = registry.getPublicKey(teeId);
bytes memory pubKey = registry.getTEEPublicKey(teeId);
bytes32 msgHash = computeMessageHash(inputHash, outputHash, timestamp);
return VERIFIER.verifyRSAPSS(pubKey, msgHash, signature);
}
Expand Down
86 changes: 17 additions & 69 deletions contracts/solidity/TEERegistry.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@
"name": "PCRAlreadyExists",
"type": "error"
},
{
"inputs": [],
"name": "PCRExpired",
"type": "error"
},
{
"inputs": [],
"name": "PCRNotApproved",
Expand All @@ -88,7 +83,7 @@
},
{
"inputs": [],
"name": "TEENotActive",
"name": "TEENotEnabled",
"type": "error"
},
{
Expand Down Expand Up @@ -152,12 +147,6 @@
"internalType": "bytes32",
"name": "pcrHash",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "uint256",
"name": "gracePeriod",
"type": "uint256"
}
],
"name": "PCRRevoked",
Expand Down Expand Up @@ -248,7 +237,7 @@
"type": "bytes32"
}
],
"name": "TEEActivated",
"name": "TEEEnabled",
"type": "event"
},
{
Expand All @@ -261,7 +250,7 @@
"type": "bytes32"
}
],
"name": "TEEDeactivated",
"name": "TEEDisabled",
"type": "event"
},
{
Expand Down Expand Up @@ -308,19 +297,6 @@
"name": "TEETypeAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint8",
"name": "typeId",
"type": "uint8"
}
],
"name": "TEETypeDeactivated",
"type": "event"
},
{
"inputs": [],
"name": "DEFAULT_ADMIN_ROLE",
Expand Down Expand Up @@ -368,7 +344,7 @@
"type": "bytes32"
}
],
"name": "activateTEE",
"name": "enableTEE",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
Expand Down Expand Up @@ -439,11 +415,11 @@
"type": "bytes32"
}
],
"name": "approvedPCRs",
"name": "pcrRecords",
"outputs": [
{
"internalType": "bool",
"name": "active",
"name": "approved",
"type": "bool"
},
{
Expand All @@ -456,11 +432,6 @@
"name": "approvedAt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "expiresAt",
"type": "uint256"
},
{
"internalType": "string",
"name": "version",
Expand Down Expand Up @@ -575,27 +546,14 @@
"type": "bytes32"
}
],
"name": "deactivateTEE",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint8",
"name": "typeId",
"type": "uint8"
}
],
"name": "deactivateTEEType",
"name": "disableTEE",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getActivePCRs",
"name": "getApprovedPCRs",
"outputs": [
{
"internalType": "bytes32[]",
Expand Down Expand Up @@ -646,7 +604,7 @@
"type": "bytes32"
}
],
"name": "getPublicKey",
"name": "getTEEPublicKey",
"outputs": [
{
"internalType": "bytes",
Expand Down Expand Up @@ -725,7 +683,7 @@
},
{
"internalType": "bool",
"name": "active",
"name": "enabled",
"type": "bool"
},
{
Expand All @@ -735,7 +693,7 @@
},
{
"internalType": "uint256",
"name": "lastUpdatedAt",
"name": "lastHeartbeatAt",
"type": "uint256"
}
],
Expand Down Expand Up @@ -763,11 +721,6 @@
"name": "name",
"type": "string"
},
{
"internalType": "bool",
"name": "active",
"type": "bool"
},
{
"internalType": "uint256",
"name": "addedAt",
Expand Down Expand Up @@ -889,7 +842,7 @@
"type": "bytes32"
}
],
"name": "isActive",
"name": "isTEEEnabled",
"outputs": [
{
"internalType": "bool",
Expand Down Expand Up @@ -1008,9 +961,9 @@
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "gracePeriod",
"type": "uint256"
"internalType": "uint8",
"name": "teeType",
"type": "uint8"
}
],
"name": "revokePCR",
Expand Down Expand Up @@ -1083,11 +1036,6 @@
"name": "name",
"type": "string"
},
{
"internalType": "bool",
"name": "active",
"type": "bool"
},
{
"internalType": "uint256",
"name": "addedAt",
Expand Down Expand Up @@ -1144,7 +1092,7 @@
},
{
"internalType": "bool",
"name": "active",
"name": "enabled",
"type": "bool"
},
{
Expand All @@ -1154,7 +1102,7 @@
},
{
"internalType": "uint256",
"name": "lastUpdatedAt",
"name": "lastHeartbeatAt",
"type": "uint256"
}
],
Expand Down
Loading