Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while passing multi dimensional array for encryption? #17

Open
ghost opened this issue Apr 24, 2017 · 2 comments
Open

Error while passing multi dimensional array for encryption? #17

ghost opened this issue Apr 24, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 24, 2017

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.

@Nora456
Copy link

Nora456 commented Oct 29, 2017

I tried the same code in the article, but I got error with the shape of the matrix . It is part 6 when you encrypt the XOR ANN. The code in the article need the methods ( innerProd, .. and the others) kindly if you could provide us with the full code. Thank you.

@fengchongwang
Copy link

Definitions of innerProd and innerProdClient are missing. Could you please kindly provide?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants