# Are there examples of how to use EvalMultMany()

**URL:** <https://openfhe.discourse.group/t/are-there-examples-of-how-to-use-evalmultmany/1762>\
**Category:** Library Questions\
**Created:** [December 5, 2024, 3:34am UTC](https://openfhe.discourse.group/t/are-there-examples-of-how-to-use-evalmultmany/1762 "2024-12-05T03:34:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![capibala](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@capibala](https://openfhe.discourse.group/u/capibala)\
**Post date:** [December 5, 2024, 3:34am UTC](https://openfhe.discourse.group/t/are-there-examples-of-how-to-use-evalmultmany/1762/1 "2024-12-05T03:34:20Z")

</div>

I tried to run the following code to multiply 16 ciphertexts with slot=32768 ,all 1 elements  
But report an error

> interrupted by signal 11:SIGSEGV

```auto
    vector<double> filterResult(slot, 1.0);
    vector<Ciphertext<DCRTPoly>> many(16);
    auto filterResultPlain = cc->MakeCKKSPackedPlaintext(filterResult);
    auto filterResultCipher = cc->Encrypt(keys.publicKey, filterResultPlain);
    for (int i = 0; i < 16; i++) {
        many.emplace_back(filterResultCipher);
    }
    TIC(t);
    auto resultCipher = cc->EvalMultMany(many);
    time = TOC(t);
    Plaintext resultPlain;
    cc->Decrypt(keys.secretKey, resultCipher, &resultPlain);
    cout << "result Plain" << resultPlain << "time is" << time << endl;

```

---

<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:** [December 5, 2024, 5:18pm UTC](https://openfhe.discourse.group/t/are-there-examples-of-how-to-use-evalmultmany/1762/2 "2024-12-05T17:18:10Z")

</div>

There is an issue with your code.

Replace `vector<Ciphertext<DCRTPoly>> many(16);` with  
`vector<Ciphertext<DCRTPoly>> many;` and it should work.

The issue is that you created 16 uninitialized ciphertexts, which is causing a segmentation fault.
