# How to find Hamming weight

**URL:** <https://openfhe.discourse.group/t/how-to-find-hamming-weight/1523>\
**Category:** FHE Questions\
**Created:** [August 30, 2024, 10:51pm UTC](https://openfhe.discourse.group/t/how-to-find-hamming-weight/1523 "2024-08-30T22:51:44Z")\
**Posts on this page:** 2\
**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:** [August 30, 2024, 10:51pm UTC](https://openfhe.discourse.group/t/how-to-find-hamming-weight/1523/1 "2024-08-30T22:51:44Z")

</div>

For KeyGen is used Hamming weight is exactly h. I do not understand how to define h

> **[421.pdf](https://eprint.iacr.org/2016/421.pdf)**
>
> 463.00 KB

> **[Homomorphic Encryption for Arithmetic of Approximate Numbers](https://link.springer.com/chapter/10.1007/978-3-319-70694-8_15)**
>
> We suggest a method to construct a homomorphic encryption scheme for approximate arithmetic. It supports an approximate addition and multiplication of encrypted messages, together with a new rescaling procedure for managing the magnitude of...

---

<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 31, 2024, 12:35am UTC](https://openfhe.discourse.group/t/how-to-find-hamming-weight/1523/2 "2024-08-31T00:35:30Z")

</div>

The Hamming weight for a given security level depends on the ring dimension and ciphertext modulus Q. See [On the Feasibility and Impact of Standardising Sparse-secret LWE Parameter Sets for Homomorphic Encryption](https://eprint.iacr.org/2019/1148) for more details (there are many other papers on the subject as well). In OpenFHE, we use the hamming weight of 192, which is sufficient for most of practical ring dimensions.
