Skip to content

Commit

Permalink
rename some functions
Browse files Browse the repository at this point in the history
publishComputationOutput --> publishCiphertextOutput

publishDecryptionOutput --> publishDecryptedOutput
  • Loading branch information
auryn-macmillan committed Jun 3, 2024
1 parent 9bc9340 commit 2bdadb6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/evm/contracts/Enclave.sol
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ contract Enclave is IEnclave, OwnableUpgradeable {
emit InputPublished(e3Id, input);
}

function publishComputationOutput(uint256 e3Id, bytes memory data) external returns (bool success) {
function publishCiphertextOutput(uint256 e3Id, bytes memory data) external returns (bool success) {
E3 memory e3 = getE3(e3Id);
require(e3.expiration <= block.timestamp, InputDeadlineNotPassed(e3Id, e3.expiration));
require(e3.ciphertextOutput.length == 0, CiphertextOutputAlreadyPublished(e3Id)); // TODO: should the output verifier be able to change its mind? i.e. should we be able to call this multiple times?
Expand All @@ -171,7 +171,7 @@ contract Enclave is IEnclave, OwnableUpgradeable {
emit CiphertextOutputPublished(e3Id, output);
}

function publishDecryptionOutput(uint256 e3Id, bytes memory data) external returns (bool success) {
function publishDecryptedOutput(uint256 e3Id, bytes memory data) external returns (bool success) {
E3 memory e3 = getE3(e3Id);
require(e3.ciphertextOutput.length > 0, CiphertextOutputNotPublished(e3Id));
require(e3.plaintextOutput.length == 0, PlaintextOutputAlreadyPublished(e3Id));
Expand Down
4 changes: 2 additions & 2 deletions packages/evm/contracts/interfaces/IEnclave.sol
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ interface IEnclave {
/// @param e3Id ID of the E3.
/// @param data ABI encoded output data to verify.
/// @return success True if the output was successfully published.
function publishComputationOutput(uint256 e3Id, bytes memory data) external returns (bool success);
function publishCiphertextOutput(uint256 e3Id, bytes memory data) external returns (bool success);

/// @notice This function should be called to decrypt the output of an Encrypted Execution Environment (E3).
/// @dev This function MUST revert if the output has not been published.
/// @dev This function MUST emit the PlaintextOutputPublished event.
/// @param e3Id ID of the E3.
/// @param data ABI encoded output data to decrypt.
/// @return success True if the output was successfully decrypted.
function publishDecryptionOutput(uint256 e3Id, bytes memory data) external returns (bool success);
function publishDecryptedOutput(uint256 e3Id, bytes memory data) external returns (bool success);

////////////////////////////////////////////////////////////
// //
Expand Down
4 changes: 2 additions & 2 deletions packages/evm/test/encalve/Enclave.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ describe("Enclave", function () {
it("emits InputPublished event");
});

describe("publishComputationOutput()", function () {
describe("publishCiphertextOutput()", function () {
it("reverts if E3 does not exist");
it("reverts if E3 has not been activated");
it("reverts if input deadline has not passed");
Expand All @@ -521,7 +521,7 @@ describe("Enclave", function () {
it("emits CiphertextOutputPublished event");
});

describe("publishExecutionOutput()", function () {
describe("publishPlaintextOutput()", function () {
it("reverts if E3 does not exist");
it("reverts if E3 has not been activated");
it("reverts if ciphertextOutput has not been published");
Expand Down

0 comments on commit 2bdadb6

Please sign in to comment.