Skip to content

Encrypting and operating with 2D numpy arrays (images) #212

@elyasgoli

Description

@elyasgoli

Description
When I try Demo_3_Float_CKKS.py with a 2-dimensional numpy array, I get an error.

Code To Reproduce Error

arr_x [[1. 2. 3.]
 [4. 5. 6.]
 [7. 8. 9.]]
Traceback (most recent call last):
  File "/home/elyas/Pyfhel/examples/Try_Float_CKKS.py", line 60, in <module>
    ptxt_x = HE.encodeFrac(arr_x)   # Creates a PyPtxt plaintext with the encoded arr_x
  File "Pyfhel/Pyfhel.pyx", line 742, in Pyfhel.Pyfhel.Pyfhel.encodeFrac
ValueError: Buffer has wrong number of dimensions (expected 1, got 2)

Setup:

  • OS: Ubuntu
  • Python: 3.9.2
  • C compiler version: GCC 10.2.1 20210110
  • Pyfhel Version: most-recent

Metadata

Metadata

Assignees

No one assigned

    Labels

    HowToHow to accomplish something with Pyfhel. Candidate to a demo/example.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions