Closed 1191000814 closed 8 months ago
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 secint = mpc.SecInt()
you can use b = secint.array(a)
to convert a Numpy array a
into a secret-shared version b
, and then work with b
using Numpy operations.
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?
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
secint = mpc.SecInt()
you can useb = secint.array(a)
to convert a Numpy arraya
into a secret-shared versionb
, and then work withb
using Numpy operations.
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?