fhevm-arithmetic-ops

Installation
SKILL.md

FHE Arithmetic Operations

Use this skill when a contract performs computation on encrypted values. Every FHE operation has constraints that differ from plaintext Solidity math. Some misuse panics immediately (for example encrypted divisors in div/rem), while other mistakes create silent fallbacks or inaccessible handles.

When To Use

  • Writing arithmetic logic over euint64, euint128, or ebool values
  • Reviewing whether division or modulo uses a plaintext divisor
  • Checking for overflow in encrypted computations
  • Deciding which operands should be public vs encrypted
  • Optimizing gas by restructuring operations to use ciphertext-scalar forms
  • Implementing comparisons or conditional logic with FHE.select

Core Mental Model

FHE arithmetic produces new ciphertext handles. Every operation returns a fresh handle

Related skills
Installs
11
First Seen
Apr 14, 2026