# Calculating max size of q

**URL:** <https://openfhe.discourse.group/t/calculating-max-size-of-q/1463>\
**Category:** FHE Questions\
**Created:** [July 30, 2024, 9:07am UTC](https://openfhe.discourse.group/t/calculating-max-size-of-q/1463 "2024-07-30T09:07:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuriusStep](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@JuriusStep](https://openfhe.discourse.group/u/JuriusStep)\
**Post date:** [July 30, 2024, 9:07am UTC](https://openfhe.discourse.group/t/calculating-max-size-of-q/1463/1 "2024-07-30T09:07:00Z")

</div>

In paper ([https://arxiv.org/pdf/2202.07994](https://arxiv.org/pdf/2202.07994)) there is table with max size of q for differens security level and ring dimesion. How do they calculate such coeff modulus

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/5af745d21e4a1285198da1a3ea6792dd856bf8ed.png)

---

<div class="post-metadata">

**Author:** ![Caesar](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/caesar/32/63_2.png) [@Caesar](https://openfhe.discourse.group/u/Caesar)\
**Post date:** [July 30, 2024, 11:21am UTC](https://openfhe.discourse.group/t/calculating-max-size-of-q/1463/2 "2024-07-30T11:21:22Z")

</div>

The referenced paper does not cite any resource on how the table was generated!  
Anyway, most likely, they used the [LWE hardness estimator](https://github.com/malb/lattice-estimator), which is the most commonly used tool for assessing LWE/RLWE hardness.

---

<div class="post-metadata">

**Author:** ![shibaInu](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shibaInu](https://openfhe.discourse.group/u/shibaInu)\
**Post date:** [July 31, 2024, 5:55pm UTC](https://openfhe.discourse.group/t/calculating-max-size-of-q/1463/3 "2024-07-31T17:55:52Z")

</div>

[Homomorphic Encryption Standard](https://homomorphicencryption.org/wp-content/uploads/2018/11/HomomorphicEncryptionStandardv1.1.pdf) offers tables to decide the max size of q for different security level and ring dimension.

In this document, Table1, (-1, 1) distribution on page 27 has the max q values under different combination of security level and ring dimension.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/a514eef0d077b40c6f6d4f1550dac97a0501bca5.png)

---

<div class="post-metadata">

**Author:** ![Caesar](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/caesar/32/63_2.png) [@Caesar](https://openfhe.discourse.group/u/Caesar)\
**Post date:** [July 31, 2024, 6:25pm UTC](https://openfhe.discourse.group/t/calculating-max-size-of-q/1463/4 "2024-07-31T18:25:11Z")

</div>

Thank you for sharing this reference.  
For completeness, it might also be relevant to consider more recent publications such as this [work](https://eprint.iacr.org/2024/463.pdf).
