Pickle-able items in multiprocessing

53 views
Skip to first unread message

Duc Trinh

unread,
Jun 5, 2016, 1:45:04 PM6/5/16
to Charm-Crypto Help
I'm applying multiprocessing for pairing elements in a group, but when i used Queue() to collect the results, it yields an error of:
PicklingError: Can't pickle <type 'pairing.Element'>: import of module pairing failedEnter code here...
Anyone can help with this problem?

Thanks in advance

Marcos Portnoi

unread,
Jun 7, 2016, 9:38:25 AM6/7/16
to Charm-Crypto Help
It seems the Pickle module is complaining it does not know how to serialize the pairing.Element object. You might have to implement an additional helper function such that Pickle can call the proper serialize() function from the charm.toolbox.pairinggroup or similar.

The same happens when using JSON with pairing.Element: one has to implement a KeyDecoder/KeyEncoder helper class to serialize pairing.Element objects.

Edoardo Marangone

unread,
Apr 6, 2022, 1:20:54 PM4/6/22
to Charm-Crypto Help
Is there a solution now? I'm trying to save the ciphertext and the key in a database, but I can't because there is no possibility to create a JSON from the pairing.Element object.

How can I save the ciphertext and the key in a database?

Thanks.
Reply all
Reply to author
Forward
0 new messages