@@ -130,11 +130,11 @@ function handleSolidityBinaryOperatorForImpl(op: Operator): string {
130130 return (
131131 `
132132 /**
133- * @dev Returns the FHEVM config.
133+ * @dev Returns the HTTPZ config.
134134 */
135135 function ${ op . name } (bytes32 lhs, bytes32 rhs${ scalarArg } ) internal returns (bytes32 result) {
136136 ${ scalarSection }
137- FHEVMConfigStruct storage $ = getFHEVMConfig ();
137+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
138138 result = ITFHEExecutor($.TFHEExecutorAddress).${ op . fheLibName } (lhs, rhs, scalarByte);
139139 }` + '\n'
140140 ) ;
@@ -166,28 +166,28 @@ ${generateInputVerifierInterface()}
166166 * @notice This library is the core implementation for computing FHE operations (e.g. add, sub, xor).
167167 */
168168library Impl {
169- /// keccak256(abi.encode(uint256(keccak256("fhevm .storage.FHEVMConfig ")) - 1)) & ~bytes32(uint256(0xff))
170- bytes32 private constant FHEVMConfigLocation = 0xed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600 ;
169+ /// keccak256(abi.encode(uint256(keccak256("httpz .storage.HTTPZConfig ")) - 1)) & ~bytes32(uint256(0xff))
170+ bytes32 private constant HTTPZConfigLocation = 0x15b1d18ad3df4183245a6a11b17d9fa31dc4c35ffbf591bdfd0f9704a799c300 ;
171171
172172 /**
173- * @dev Returns the FHEVM config.
173+ * @dev Returns the HTTPZ config.
174174 */
175- function getFHEVMConfig () internal pure returns (FHEVMConfigStruct storage $) {
175+ function getHTTPZConfig () internal pure returns (HTTPZConfigStruct storage $) {
176176 assembly {
177- $.slot := FHEVMConfigLocation
177+ $.slot := HTTPZConfigLocation
178178 }
179179 }
180180
181181 /**
182- * @notice Sets the FHEVM addresses.
183- * @param fhevmConfig FHEVM config struct that contains contract addresses.
182+ * @notice Sets the coprocessor addresses.
183+ * @param httpzConfig HTTPZ config struct that contains contract addresses.
184184 */
185- function setFHEVM(FHEVMConfigStruct memory fhevmConfig ) internal {
186- FHEVMConfigStruct storage $ = getFHEVMConfig ();
187- $.ACLAddress = fhevmConfig .ACLAddress;
188- $.TFHEExecutorAddress = fhevmConfig .TFHEExecutorAddress;
189- $.KMSVerifierAddress = fhevmConfig .KMSVerifierAddress;
190- $.InputVerifierAddress = fhevmConfig .InputVerifierAddress;
185+ function setCoprocessor(HTTPZConfigStruct memory httpzConfig ) internal {
186+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
187+ $.ACLAddress = httpzConfig .ACLAddress;
188+ $.TFHEExecutorAddress = httpzConfig .TFHEExecutorAddress;
189+ $.KMSVerifierAddress = httpzConfig .KMSVerifierAddress;
190+ $.InputVerifierAddress = httpzConfig .InputVerifierAddress;
191191 }
192192` ) ;
193193
@@ -214,10 +214,10 @@ function generateImplCoprocessorInterface(operators: Operator[]): string {
214214
215215 res . push ( `
216216 /**
217- * @title FHEVMConfigStruct
217+ * @title HTTPZConfigStruct
218218 * @notice This struct contains all addresses of core contracts, which are needed in a typical dApp.
219219 */
220- struct FHEVMConfigStruct {
220+ struct HTTPZConfigStruct {
221221 address ACLAddress;
222222 address TFHEExecutorAddress;
223223 address KMSVerifierAddress;
@@ -414,7 +414,7 @@ function generateInputVerifierInterface(): string {
414414 ` ;
415415}
416416
417- export function generateSolidityTFHELib ( operators : Operator [ ] , fheTypes : FheType [ ] ) : string {
417+ export function generateSolidityHTTPZLib ( operators : Operator [ ] , fheTypes : FheType [ ] ) : string {
418418 const res : string [ ] = [ ] ;
419419
420420 res . push ( `// SPDX-License-Identifier: BSD-3-Clause-Clear
@@ -426,11 +426,11 @@ export function generateSolidityTFHELib(operators: Operator[], fheTypes: FheType
426426 ${ createSolidityTypeAliasesFromFheTypes ( fheTypes ) }
427427
428428 /**
429- * @title TFHE
429+ * @title HTTPZ
430430 * @notice This library is the interaction point for all smart contract developers
431- * that interact with TFHE .
431+ * that interact with the HTTPZ protocol .
432432 */
433- library TFHE {
433+ library HTTPZ {
434434
435435 /// @notice Returned if the input's length is greater than 64 bytes.
436436 error InputLengthAbove64Bytes(uint256 inputLength);
@@ -442,11 +442,11 @@ export function generateSolidityTFHELib(operators: Operator[], fheTypes: FheType
442442 error InputLengthAbove256Bytes(uint256 inputLength);
443443
444444 /**
445- * @notice Sets the FHEVM addresses.
446- * @param fhevmConfig FHEVM config struct that contains contract addresses.
445+ * @notice Sets the coprocessor addresses.
446+ * @param httpzConfig HTTPZ config struct that contains contract addresses.
447447 */
448- function setFHEVM(FHEVMConfigStruct memory fhevmConfig ) internal {
449- Impl.setFHEVM(fhevmConfig );
448+ function setCoprocessor(HTTPZConfigStruct memory httpzConfig ) internal {
449+ Impl.setCoprocessor(httpzConfig );
450450 }
451451 ` ) ;
452452
@@ -973,7 +973,7 @@ function handleSolidityTFHEConvertPlaintextAndEinputToRespectiveType(fheType: Ad
973973function handleUnaryOperatorForImpl ( op : Operator ) : string {
974974 return `
975975 function ${ op . name } (bytes32 ct) internal returns (bytes32 result) {
976- FHEVMConfigStruct storage $ = getFHEVMConfig ();
976+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
977977 result = ITFHEExecutor($.TFHEExecutorAddress).${ op . fheLibName } (ct);
978978 }
979979 ` ;
@@ -1089,7 +1089,7 @@ function generateCustomMethodsForImpl(): string {
10891089 * If 'control's value is 'false', the result has the same value as 'ifFalse'.
10901090 */
10911091 function select(bytes32 control, bytes32 ifTrue, bytes32 ifFalse) internal returns (bytes32 result) {
1092- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1092+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
10931093 result = ITFHEExecutor($.TFHEExecutorAddress).fheIfThenElse(control, ifTrue, ifFalse);
10941094 }
10951095
@@ -1105,7 +1105,7 @@ function generateCustomMethodsForImpl(): string {
11051105 bytes memory inputProof,
11061106 FheType toType
11071107 ) internal returns (bytes32 result) {
1108- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1108+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
11091109 result = ITFHEExecutor($.TFHEExecutorAddress).verifyCiphertext(inputHandle, msg.sender, inputProof, toType);
11101110 IACL($.ACLAddress).allowTransient(result, msg.sender);
11111111 }
@@ -1120,7 +1120,7 @@ function generateCustomMethodsForImpl(): string {
11201120 bytes32 ciphertext,
11211121 FheType toType
11221122 ) internal returns (bytes32 result) {
1123- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1123+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
11241124 result = ITFHEExecutor($.TFHEExecutorAddress).cast(ciphertext, toType);
11251125 }
11261126
@@ -1134,7 +1134,7 @@ function generateCustomMethodsForImpl(): string {
11341134 uint256 value,
11351135 FheType toType
11361136 ) internal returns (bytes32 result) {
1137- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1137+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
11381138 result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, toType);
11391139 }
11401140
@@ -1148,7 +1148,7 @@ function generateCustomMethodsForImpl(): string {
11481148 bytes memory value,
11491149 FheType toType
11501150 ) internal returns (bytes32 result) {
1151- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1151+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
11521152 result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, toType);
11531153 }
11541154
@@ -1166,7 +1166,7 @@ function generateCustomMethodsForImpl(): string {
11661166 } else {
11671167 scalarByte = 0x00;
11681168 }
1169- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1169+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
11701170 result = ITFHEExecutor($.TFHEExecutorAddress).fheEq(lhs, rhs, scalarByte);
11711171 }
11721172
@@ -1184,17 +1184,17 @@ function generateCustomMethodsForImpl(): string {
11841184 } else {
11851185 scalarByte = 0x00;
11861186 }
1187- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1187+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
11881188 result = ITFHEExecutor($.TFHEExecutorAddress).fheNe(lhs, rhs, scalarByte);
11891189 }
11901190
11911191 function rand(FheType randType) internal returns(bytes32 result) {
1192- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1192+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
11931193 result = ITFHEExecutor($.TFHEExecutorAddress).fheRand(randType);
11941194 }
11951195
11961196 function randBounded(uint256 upperBound, FheType randType) internal returns(bytes32 result) {
1197- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1197+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
11981198 result = ITFHEExecutor($.TFHEExecutorAddress).fheRandBounded(upperBound, randType);
11991199 }
12001200
@@ -1207,7 +1207,7 @@ function generateCustomMethodsForImpl(): string {
12071207 * @param account Address of the account.
12081208 */
12091209 function allowTransient(bytes32 handle, address account) internal {
1210- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1210+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
12111211 IACL($.ACLAddress).allowTransient(handle, account);
12121212 }
12131213
@@ -1219,7 +1219,7 @@ function generateCustomMethodsForImpl(): string {
12191219 * @param account Address of the account.
12201220 */
12211221 function allow(bytes32 handle, address account) internal {
1222- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1222+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
12231223 IACL($.ACLAddress).allow(handle, account);
12241224 }
12251225
@@ -1228,7 +1228,7 @@ function generateCustomMethodsForImpl(): string {
12281228 * with Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor.
12291229 */
12301230 function cleanTransientStorageACL() internal {
1231- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1231+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
12321232 IACL($.ACLAddress).cleanTransientStorage();
12331233 }
12341234
@@ -1238,7 +1238,7 @@ function generateCustomMethodsForImpl(): string {
12381238 * with Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor.
12391239 */
12401240 function cleanTransientStorageInputVerifier() internal {
1241- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1241+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
12421242 IInputVerifier($.InputVerifierAddress).cleanTransientStorage();
12431243 }
12441244
@@ -1251,7 +1251,7 @@ function generateCustomMethodsForImpl(): string {
12511251 * @return isAllowed Whether the account can access the handle.
12521252 */
12531253 function isAllowed(bytes32 handle, address account) internal view returns (bool) {
1254- FHEVMConfigStruct storage $ = getFHEVMConfig ();
1254+ HTTPZConfigStruct storage $ = getHTTPZConfig ();
12551255 return IACL($.ACLAddress).isAllowed(handle, account);
12561256 }
12571257 ` ;
0 commit comments