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
  • FhevmInstance.encrypt8
  • Parameters
  • Returns
  • Example
  • FhevmInstance.encrypt16
  • Parameters
  • Returns
  • Example
  • FhevmInstance.encrypt32
  • Parameters
  • Returns
  • Example

Was this helpful?

Export as PDF
  1. Client

Inputs

The library provides a set of functions to encrypt integers of various sizes (8, 16, and 32 bits) using the blockchain's public key. These encrypted integers can then be securely used as parameters for smart contract methods within the blockchain ecosystem.

FhevmInstance.encrypt8

Parameters

  • value: number (required): A number between 0 and 255.

Returns

  • Uint8Array

Example

const instance = await createInstance({ chainId, publicKey });
const encryptedParam = instance.encrypt8(14);

FhevmInstance.encrypt16

Parameters

  • value: number (required): A number between 0 and 65535.

Returns

  • Uint8Array

Example

const instance = await createInstance({ chainId, publicKey });
const encryptedParam = instance.encrypt16(1234);

FhevmInstance.encrypt32

Parameters

  • value: number (required): A number between 0 and 4294967295.

Returns

  • Uint8Array

Example

const instance = await createInstance({ chainId, publicKey });
const encryptedParam = instance.encrypt32(94839304);
PreviousSetup an instanceNextReencryption

Last updated 1 year ago

Was this helpful?