Skip to content
Open
Changes from all 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
14 changes: 12 additions & 2 deletions contracts/ICofhe.sol
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,25 @@ library Utils {
return v;
}

function inputFromHashAndProof(bytes32 hash, bytes memory signature, uint8 utype) internal pure returns (EncryptedInput memory) {
function inputFromHashAndProof(
bytes32 hash,
bytes memory signature,
uint8 utype,
uint8 securityZone
) internal pure returns (EncryptedInput memory) {
return EncryptedInput({
ctHash: uint256(hash),
securityZone: 0,
securityZone: securityZone,
utype: utype,
signature: signature
});
}

/// @dev Convenience overload that defaults to securityZone 0.
function inputFromHashAndProof(bytes32 hash, bytes memory signature, uint8 utype) internal pure returns (EncryptedInput memory) {
return inputFromHashAndProof(hash, signature, utype, 0);
}

function expectUtype(uint8 actual, uint8 expected) internal pure {
if (actual != expected) {
revert InvalidEncryptedInput(actual, expected);
Expand Down