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

Tests do not pass with alternative AES circuits. #14

Open
themighty1 opened this issue Jan 26, 2022 · 1 comment
Open

Tests do not pass with alternative AES circuits. #14

themighty1 opened this issue Jan 26, 2022 · 1 comment

Comments

@themighty1
Copy link

Hi, I tried to plug in the aes_128.txt circuit from https://homes.esat.kuleuven.be/~nsmart/MPC/ by first "downgrading" its header into the old format:

36663 36919
128 128  128 

and also changing key,msg input ordering and reversing the output bits.

It passed the first 2 tests in parser.rs but failed on the 3rd:

let mut key = vec![0u16; 128];
for i in 0..8 {
key[i] = 1;
}
let pt = vec![0u16; 128];
let output = circ.eval_plain(&pt, &key).unwrap();

Then I took another AES circuit from here https://github.com/n-for-1-auth/circuits/tree/main/aes (aes128_full.txt) , adjusted input/output ordering and set its header to

36548 36804
128 128 128

this time the test failed on test2

How can such non-deterministic behaviour happen? Does swanky choose different code paths based on the gate ordering of the circuit?
Either way, you probably want to look at this as some corner case is triggering a bug.

@amaloz
Copy link
Collaborator

amaloz commented Mar 28, 2022

Interesting... is the only format difference between the two formats the header, or could there be something else in the new format that's causing problems when downgrading to the old format?

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