# Composability of function in Homomorphic encryption

**URL:** https://openfhe.discourse.group/t/composability-of-function-in-homomorphic-encryption/732
**Category:** FHE Questions
**Created:** [August 3, 2023, 4:37am UTC](https://openfhe.discourse.group/t/composability-of-function-in-homomorphic-encryption/732 "2023-08-03T04:37:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Atwo](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@Atwo](https://openfhe.discourse.group/u/Atwo)
#### Post date: [August 3, 2023, 4:37am UTC](https://openfhe.discourse.group/t/composability-of-function-in-homomorphic-encryption/732/1 "2023-08-03T04:37:07Z")

</div>

As we know in FHE server computes:

Eval[f, Dec(c)]  
= Dec(f(c))

That shows f and Dec are commutative.

Is it a limitation of FHE that a function should be commutative.

What is the proof of above scenario.

---

<div class="post-metadata">

### Author: ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)
#### Post date: [August 3, 2023, 1:19pm UTC](https://openfhe.discourse.group/t/composability-of-function-in-homomorphic-encryption/732/2 "2023-08-03T13:19:51Z")

</div>

You can think of `Dec` as an identity function. `Dec` preserves the message as is; it simply removes the mask. So one can apply `Dec` at any point during the computation.

---

<div class="post-metadata">

### Author: ![Atwo](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@Atwo](https://openfhe.discourse.group/u/Atwo)
#### Post date: [August 9, 2023, 2:11pm UTC](https://openfhe.discourse.group/t/composability-of-function-in-homomorphic-encryption/732/3 "2023-08-09T14:11:06Z")

</div>

Thanks!

Is there any mathematical proof ?  
or it’s limitation that we have to consider Dec as an identity function.

---

<div class="post-metadata">

### Author: ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)
#### Post date: [August 11, 2023, 2:37am UTC](https://openfhe.discourse.group/t/composability-of-function-in-homomorphic-encryption/732/4 "2023-08-11T02:37:51Z")

</div>

Each exact homomorphic encryption scheme, such as BGV or BFV, requires correctness proofs, i.e., it shows that the decrypted result matches the result obtained in the clear as long as the noise is below the appropriate threshold. So the correctness proof is the main way to argue this.
