# Does there exist a solution that can extract all MSBs from an RLWE ciphertext, like in BGV or BFV?

**URL:** <https://openfhe.discourse.group/t/does-there-exist-a-solution-that-can-extract-all-msbs-from-an-rlwe-ciphertext-like-in-bgv-or-bfv/363>\
**Category:** FHE Questions\
**Tags:** questions, openfhe-help\
**Created:** [February 15, 2023, 9:42am UTC](https://openfhe.discourse.group/t/does-there-exist-a-solution-that-can-extract-all-msbs-from-an-rlwe-ciphertext-like-in-bgv-or-bfv/363 "2023-02-15T09:42:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamm](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hamm](https://openfhe.discourse.group/u/hamm)\
**Post date:** [February 15, 2023, 9:42am UTC](https://openfhe.discourse.group/t/does-there-exist-a-solution-that-can-extract-all-msbs-from-an-rlwe-ciphertext-like-in-bgv-or-bfv/363/1 "2023-02-15T09:42:26Z")

</div>

I want to extract all MSB with an RLWE Ciphertext into an vector.I I’m not sure if exist an solution.

---

<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:53am UTC](https://openfhe.discourse.group/t/does-there-exist-a-solution-that-can-extract-all-msbs-from-an-rlwe-ciphertext-like-in-bgv-or-bfv/363/2 "2023-02-18T01:53:24Z")

</div>

I am not sure I understand your question. Could you please fix the grammatical errors in both the title and question.

OpenFHE includes `EvalSign` (based on FHEW/TFHE) to find MSB of an LWE ciphertext. Are you asking whether such a capability exists for BGV or BFV?

If yes, then this can be achieved using BGV/BFV bootstrapping (more general case) or special polynomials. Please clarify your question so I could answer it more definitively.

---

<div class="post-metadata">

**Author:** ![hamm](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hamm](https://openfhe.discourse.group/u/hamm)\
**Post date:** [February 18, 2023, 7:43am UTC](https://openfhe.discourse.group/t/does-there-exist-a-solution-that-can-extract-all-msbs-from-an-rlwe-ciphertext-like-in-bgv-or-bfv/363/3 "2023-02-18T07:43:56Z")

</div>

Sorry,  
Yes,My problem is that how to find MSB vector ciphertext of an RLWE ciphertext without decomposition.

---

<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 22, 2023, 10:27pm UTC](https://openfhe.discourse.group/t/does-there-exist-a-solution-that-can-extract-all-msbs-from-an-rlwe-ciphertext-like-in-bgv-or-bfv/363/4 "2023-02-22T22:27:56Z")

</div>

The two potential solutions are:

1. [Logistic regression over encrypted data from fully homomorphic encryption](https://eprint.iacr.org/2018/462) (section 3.5)
2. [Faster homomorphic comparison operations for BGV and BFV](https://eprint.iacr.org/2021/315)

Alternatively, you use `EvalSign` with scheme switching to/from FHEW/TFHE from/to BGV/BFV

---

<div class="post-metadata">

**Author:** ![Fobow](https://avatars.discourse-cdn.com/v4/letter/f/e79b87/32.png) [@Fobow](https://openfhe.discourse.group/u/Fobow)\
**Post date:** [April 9, 2024, 1:41pm UTC](https://openfhe.discourse.group/t/does-there-exist-a-solution-that-can-extract-all-msbs-from-an-rlwe-ciphertext-like-in-bgv-or-bfv/363/5 "2024-04-09T13:41:54Z")

</div>

Hi there! I am wondering if the second solution (Faster homomorphic comparison operations for BGV and BFV]([Faster homomorphic comparison operations for BGV and BFV](https://eprint.iacr.org/2021/315)) can be extended to CKKS?
