# Serialize/deserialize evalSumRowKeys and evalSumColKeys in Python

**URL:** <https://openfhe.discourse.group/t/serialize-deserialize-evalsumrowkeys-and-evalsumcolkeys-in-python/1357>\
**Category:** OpenFHE ports/wrappers\
**Created:** [June 14, 2024, 11:47am UTC](https://openfhe.discourse.group/t/serialize-deserialize-evalsumrowkeys-and-evalsumcolkeys-in-python/1357 "2024-06-14T11:47:15Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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:** [June 30, 2024, 5:23pm UTC](https://openfhe.discourse.group/t/serialize-deserialize-evalsumrowkeys-and-evalsumcolkeys-in-python/1357/7 "2024-06-30T17:23:59Z")

</div>

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](https://openfhe.discourse.group/t/is-there-any-example-about-how-to-use-evalsumrows-evalsumcols/687/2) You can see a python version at [openfhe-logreg-training-examples/enc\_matrix.h at main · openfheorg/openfhe-logreg-training-examples · GitHub](https://github.com/openfheorg/openfhe-logreg-training-examples/blob/main/enc_matrix.h#L56)

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](https://openfheorg.github.io/openfhe-python/html/cryptocontext.html) 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).

---

_[View the full topic](https://openfhe.discourse.group/t/serialize-deserialize-evalsumrowkeys-and-evalsumcolkeys-in-python/1357)._
