Serialize/deserialize evalSumRowKeys and evalSumColKeys in Python

Internally, EvalSumColsKeyGen amd EvalSumRowsKeyGen add automorphism keys to the cryptocontext authomorphism map. But for backwards (API) compatibility (we did not want to change API yet), they still return a map with keys. In other words, the following examples still works: Is there any example about how to use EvalSumRows/EvalSumCols? - #2 by Caesar You can see a python version at openfhe-logreg-training-examples/enc_matrix.h at main · openfheorg/openfhe-logreg-training-examples · GitHub

For instance, you can deserialize the EvalSumRows and EvalSumCols keys (they will get added to the internal autmorphism map). Then you can pass a pointer to the automorphism map as either EvalSumRows or EvalSumCols keys. You can access the (full automorphism) map using GetEvalSumKeyMap (see CryptoContext — openfhe-python 0.8.0 documentation for more information on the method).

You can also use (De)SerializeEvalAutomorphismKey method to (de)serialize all automorphism keys at once (not always the most efficient method but it is simpler). EvalAtIndex, EvalRotate, and all EvalSum* methods use this automorphism map for all operations. The map can be read from the crypto context usng GetEvalSumKeyMap (as described in the paragraph above).