Concrete
WebsiteLibrariesProducts & ServicesDevelopersSupport
2.6
2.6
  • Welcome
  • Get Started
    • What is Concrete?
    • Installation
    • Quick start
    • Compatibility
    • Terminology
  • Core features
    • Overview
    • Table lookups
    • Bit extraction
    • Rounding
    • Truncating
    • Floating points
    • Comparisons
    • Min/Max operations
    • Bitwise operations
    • Common tips
    • Extensions
    • Tagging
  • Compilation
    • Composition
    • Compression
    • Reuse arguments
    • Multi precision
    • Multi parameters
    • Modules
    • Decorator
    • Direct circuits
  • Execution / Analysis
    • Simulation
    • Progressbar
    • Statistics
    • Formatting and drawing
    • Debug
  • Guides
    • Configure
    • Manage keys
    • Deploy
  • Tutorials
    • See all tutorials
    • Part I: Concrete - FHE compiler
    • Part II: The Architecture of Concrete
  • References
    • API
  • Explanations
    • Compiler workflow
    • Frontend fusing
    • Compiler backend
      • Adding a new backend
    • Optimizer
    • MLIR FHE dialects
      • FHELinalg dialect
      • FHE dialect
      • TFHE dialect
      • Concrete dialect
      • Tracing dialect
      • Runtime dialect
      • SDFG dialect
    • Security
    • Call FHE circuits from other languages
    • Project layout
  • Developers
    • Contributing
    • Release note
    • Feature request
    • Bug report
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. Compilation

Decorator

If you are trying to compile a regular function, you can use the decorator interface instead of the explicit Compiler interface to simplify your code:

from concrete import fhe

@fhe.compiler({"x": "encrypted"})
def f(x):
    return x + 42

inputset = range(10)
circuit = f.compile(inputset)

assert circuit.encrypt_run_decrypt(10) == f(10)

This decorator is a way to add the compile method to the function object without changing its name elsewhere.

PreviousModulesNextDirect circuits

Last updated 1 year ago

Was this helpful?