# Generate a LUT via a vector

**URL:** <https://openfhe.discourse.group/t/generate-a-lut-via-a-vector/272>\
**Category:** Library Questions\
**Created:** [December 6, 2022, 7:27pm UTC](https://openfhe.discourse.group/t/generate-a-lut-via-a-vector/272 "2022-12-06T19:27:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sofianeazgh](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@sofianeazgh](https://openfhe.discourse.group/u/sofianeazgh)\
**Post date:** [December 6, 2022, 7:27pm UTC](https://openfhe.discourse.group/t/generate-a-lut-via-a-vector/272/1 "2022-12-06T19:27:35Z")

</div>

Hi, I wonder how to generate a LUT via a vector of inputs. I saw in the library that it’s only possible to generate a LUT via a 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:** [December 8, 2022, 12:56am UTC](https://openfhe.discourse.group/t/generate-a-lut-via-a-vector/272/2 "2022-12-08T00:56:45Z")

</div>

Hi @sofianeazgh,

Instead of calling `GenerateLUTviaFunction`, you can pass the vector directly ( I am referring to the example at [openfhe-development/eval-function.cpp at v1.0.1 · openfheorg/openfhe-development · GitHub](https://github.com/openfheorg/openfhe-development/blob/v1.0.1/src/binfhe/examples/eval-function.cpp)). Please see the code at [openfhe-development/binfhecontext.cpp at v1.0.1 · openfheorg/openfhe-development · GitHub](https://github.com/openfheorg/openfhe-development/blob/v1.0.1/src/binfhe/lib/binfhecontext.cpp#L283) to get an idea on how to populate the vector with data.

---

<div class="post-metadata">

**Author:** ![sofianeazgh](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@sofianeazgh](https://openfhe.discourse.group/u/sofianeazgh)\
**Post date:** [December 12, 2022, 12:56am UTC](https://openfhe.discourse.group/t/generate-a-lut-via-a-vector/272/3 "2022-12-12T00:56:17Z")

</div>

Hi @ypolyakov,

Thank you for your response and the pointers in it.  
I may have another question : would it be possible to evaluate a private LUT i.e all the element of the LUT will be encrypted.  
Thank you in advance.

---

<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:** [December 12, 2022, 10:51pm UTC](https://openfhe.discourse.group/t/generate-a-lut-via-a-vector/272/4 "2022-12-12T22:51:04Z")

</div>

Hi @sofianeazgh

So your question is whether the look-up table can be encrypted (the function evaluated using the look-up table is kept secret). I assume the data this function is applied to is also encrypted. It is an interesting question… OpenFHE does not support this setting. I don’t see an obvious way to do this efficiently right away.

Thanks,  
Yuriy
