# Values generated in BFV parameter generation

**URL:** <https://openfhe.discourse.group/t/values-generated-in-bfv-parameter-generation/366>\
**Category:** Library Questions\
**Created:** [February 16, 2023, 11:39am UTC](https://openfhe.discourse.group/t/values-generated-in-bfv-parameter-generation/366 "2023-02-16T11:39:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmall](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@jmall](https://openfhe.discourse.group/u/jmall)\
**Post date:** [February 16, 2023, 11:39am UTC](https://openfhe.discourse.group/t/values-generated-in-bfv-parameter-generation/366/1 "2023-02-16T11:39:13Z")

</div>

I was curious about values generated in function `ParamsGenBFVRNS` linked [here](https://github.com/openfheorg/openfhe-development/blob/bfa46d3098de181fd84733cc891ab86fdaec9811/src/pke/lib/scheme/bfvrns/bfvrns-parametergeneration.cpp#L45).

To be specific,

1. What’s assurance measure?
2. What’s Bound of gaussian error polynomial. I understand error polynomial is sampled from gaussian dist, but what role does its bound play ?
3. How are formulas for `delta`, `Vnorm`, `nRLWE`, `noiseKS` derived?

---

<div class="post-metadata">

**Author:** ![jmall](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@jmall](https://openfhe.discourse.group/u/jmall)\
**Post date:** [February 16, 2023, 12:21pm UTC](https://openfhe.discourse.group/t/values-generated-in-bfv-parameter-generation/366/2 "2023-02-16T12:21:34Z")

</div>

> Although a Gaussian distribution is not bounded by nature, the probability for a Gaussian coefficient to be larger than Berr = 6σerr, is less than 2−30, therefore the two distributions are very close in practice. UQ denotes the uniform distribution over RQ, where every coefficient of a is sampled uniformly and independently from ZQ

Above is from page 5 of [2021/204](https://eprint.iacr.org/2021/204.pdf) (last line in background of Section). Is this the reason why alpha in BFV set to 36?

---

<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:** [February 18, 2023, 1:45am UTC](https://openfhe.discourse.group/t/values-generated-in-bfv-parameter-generation/366/3 "2023-02-18T01:45:35Z")

</div>

> [@jmall](#):
>
> delta

Let me try to answer for each parameter.

1. `delta` = 2 \sqrt{N}. See background in [https://eprint.iacr.org/2021/204.pdf](https://eprint.iacr.org/2021/204.pdf). It is often referred to in literature, e.g., in the FV paper, as the expansion factor.
2. `Vnorm` is the fresh ciphertext noise (becomes smaller if we call modulus switching before first multiplication). See beginning of Section 3.1 in the same paper.
3. `nRLWE` finds secure ring dimension for a given \log Q
4. `noiseKS` - key switching noise; described in the same paper.
5. assurance measure is the coefficient used for setting the bound for Gaussians in estimating the noise, i.e., 6 standard deviations. Your later comment is correct.
