fhEVM
WebsiteLibrariesProduct & ServicesDevelopersSupport
0.2
0.2
  • What is Zama's fhEVM?
  • Getting started
    • Connect wallet
      • Metamask
    • Faucet
      • Zama Devnet
      • Local node
  • Writing contracts
    • Getting started
      • Hardhat
      • Remix
      • Docker
    • Types
    • Operations
    • Condition
    • Decryption and reencryption
    • Function specifications
    • Troubleshooting
    • Roadmap
    • Examples
  • Client
    • Getting started
      • Node
      • Browser
      • Templates
      • CLI
    • Setup an instance
    • Inputs
    • Reencryption
    • Examples
      • Transfer tokens (node)
      • Get balance (node)
  • Resources
    • Tutorials
    • Repositories
    • Whitepaper
  • 🔗Support
    • Community forum
    • Telegram
    • FHE.org discord
    • Twitter
Powered by GitBook

Libraries

  • TFHE-rs
  • Concrete
  • Concrete ML
  • fhEVM

Developers

  • Blog
  • Documentation
  • Github
  • FHE resources

Company

  • About
  • Introduction to FHE
  • Media
  • Careers
On this page

Was this helpful?

Export as PDF
  1. Writing contracts

Operations

The TFHE library defines the following operations with FHE ciphertexts:

name
function name
symbol
type

Add

TFHE.add

+

Binary

Sub

TFHE.sub

-

Binary

Mul

TFHE.mul

*

Binary

Div (plaintext divisor)

TFHE.div

Binary

Rem (plaintext divisor)

TFHE.rem

Binary

BitAnd

TFHE.and

&

Binary

BitOr

TFHE.or

|

Binary

BitXor

TFHE.xor

^

Binary

Shift Right

TFHE.shr

Binary

Shift Left

TFHE.shl

Binary

Equal

TFHE.eq

Binary

Not equal

TFHE.ne

Binary

Greater than or equal

TFHE.ge

Binary

Greater than

TFHE.gt

Binary

Less than or equal

TFHE.le

Binary

Less than

TFHE.lt

Binary

Min

TFHE.min

Binary

Max

TFHE.max

Binary

Neg

TFHE.neg

-

Unary

Not

TFHE.not

~

Unary

Cmux

TFHE.cmux

Ternary

Decrypt

TFHE.decrypt()

Decryption

Reencrypt

TFHE.reencrypt()

Reencryption

Optimistic Require

TFHE.optReq()

Decryption

Random unsigned int (mockup)

TFHE.randEuintX()

Random

NOTE 1: Random encrypted integers that are generated fully on-chain. Currently, implemented as a mockup by using a PRNG in the plain. Not for use in production!

PreviousTypesNextCondition

Last updated 1 year ago

Was this helpful?

Overloaded operators +, -, *, &, ... on encrypted integers are supported (). As of now, overloaded operators will call the versions without an overflow check.

More information about the supported operations can be found in the page or in the .

If you find yourself in search of a missing feature, we encourage you to for upcoming developments. Alternatively, don't hesitate to reach out to us on Discord or visit our community forum.

using for
function specifications
TFHE-rs docs
consult our roadmap