venumML.venum_tools
def
encrypt_array(array, ctx):
Recursively encrypts every value in an n-dimensional numpy array.
Parameters
- array (np.ndarray): The n-dimensional numpy array to encrypt.
- ctx (EncryptionContext): Encryption context providing an encrypt method.
Returns
- np.ndarray: An n-dimensional numpy array with all values encrypted.
Raises
- ValueError: If the input is not a numpy array.
def
decrypt_array(array):
Recursively decrypts every value in an n-dimensional numpy array of encrypted objects.
Parameters
- array (np.ndarray): The n-dimensional numpy array containing encrypted objects to decrypt.
Returns
- np.ndarray: An n-dimensional numpy array with all values decrypted.
Raises
- ValueError: If the input is not a numpy array.