Import
All functions are prefixed with
FHE. when called. For example: FHE.add(a, b) or FHE.allowPublic(value).Encrypted Data Types
Input Types
Each encrypted type has a corresponding input struct used when receiving encrypted data from the client SDK:Security Considerations
- Initialization: All FHE functions check if their inputs are initialized and set them to 0 if not.
-
Decryption: Decryption is a two-phase process — mark values with
allowPublicon-chain, decrypt off-chain via the Client SDK, then publish/verify the result withpublishDecryptResultorverifyDecryptResult. Only reveal values when absolutely necessary. -
Security Zones: Some functions accept a
securityZoneparameter to isolate different encrypted computations. FHE operations can only be performed between ciphertexts that share the same security zone. -
Access Control: The library provides fine-grained access control through the
allow*functions. Always set proper permissions before accessing encrypted values. - Type Safety: Ensure encrypted values use compatible types when performing operations. Type mismatches will cause errors.