Skip to content

Error while passing multi dimensional array for encryption? #17

Description

I was trying out your script in https://iamtrask.github.io/2017/03/17/safe-ai/ with multi dimensional arrays.

x = np.array([[0,1,2,5],
              [4,5,9,10],
              [8,3,7,1 ]])

m = len(x)
n = m
w = 16
S = generate_key(w,m,n)

T=get_T(n)
c,S=encrypt_via_switch(x,w,m,n,T)
decrypt(c,S,w)

but I am getting this error

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

though your example in the article works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions