Skip to content

Doubts regarding MPC for AES #66

Answered by lschoe
aarav22 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can use mpc.input() to accomplish this, in much the same way as it's done in the Oblivious Transfer demo ot.py. If you start from the Numpy-based AES demo np_aes.py, you can for instance let party 1 privately input a plaintext p by replacing the line:

p = secfld.array(f256.array([[17 * (4*j + i) for j in range(4)] for i in range(4)]))

with:

    if mpc.pid == 1:
        p = secfld.array(f256.array([[17 * (4*j + i) for j in range(4)] for i in range(4)]))
    else:
        p = secfld.array(None, (4, 4))  # dummy array value with shape (4,4)
    p = mpc.input(p, 1)  # private input from party 1

Similarly, replace the line:

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lschoe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #65 on August 17, 2023 14:34.