How to use the class SecureArray? #81
-
How to use the class SecureArray? It is not seem in the document? I want to transfer a np.ndarray type to secure type, how can I do that? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 12 replies
-
It's best to look at a demo like demos/np_id3gini.py to see how to work with secure arrays. Also see the other demos listed in demos/np-run-all.sh For a basic secure type like |
Beta Was this translation helpful? Give feedback.
-
Thanks! I have another problem, the SecInt type is unhashable, but I want to use it as the key of a dict, How can I do?
|
Beta Was this translation helpful? Give feedback.
-
Instances of secure types like secure integers are not hashable because their values are secret-shared. Each party holds a share of the value, but these shares are random and different for each party. Depending on what you need to do, you might use operators like |
Beta Was this translation helpful? Give feedback.
-
Hi, today when I use await mpc.output() to get the real data of a variable, the program was stuck but not end or error, I don't know why it happens. Is there a dead lock or other reason? |
Beta Was this translation helpful? Give feedback.
Instances of secure types like secure integers are not hashable because their values are secret-shared. Each party holds a share of the value, but these shares are random and different for each party.
Depending on what you need to do, you might use operators like
==
and<
with secure integers to construct searchable datastructures but this may get quite involved.