Is there a limit to plaintext size?

Theoretically, the maximum number of slots one BFV ciphertext may contain is equal to the underlying ring dimension N. Do print N in your main program after initializing the cryptocontext. You can use the line below to print the ring dimension:

std::cout << "N: " << cryptoContext->GetRingDimension() << "\n";

You can increase N by increasing the multiplicative depth via parameters.SetMultiplicativeDepth(depth);. Or you can break down your input data into multiple vectors of size less than or equal to N and use multiple ciphertexts instead.

Note that increasing N unnecessarily may degrade the performance as this will amplify low-level FHE data structures and induce more complex computations.

Also, note that to get the maximum number of slots in BFV, your plaintext modulus should be a prime integer that satisfies the following condition:
1 \equiv t \mod 2N

1 Like