-
Notifications
You must be signed in to change notification settings - Fork 15
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
counter i is reset to 0 for each round #11
Comments
I agree that reusing the variable like that is ugly. The round number Thanks for bringing the post to my attention, I hadn't seen that before! |
In my testing it is not incremented in the generator and is set to 0 each round. The way I see the code, i is set in the encrypt function using the range of self.rounds:
In this way, i is incrementing already and there doesn't seem to be a reason to attempt to increment again. To test, I simply put a print(i) in the round function:
However, if you want to keep the increment inside round, you just have to move the i += 1 to inside the for loop (this brings up that the assignment of key should also be moved if that is indeed needed):
|
pyffx/pyffx/ffx.py
Line 26 in 1e7f289
In reading the accompanying doc on this: https://medium.com/asecuritysite-when-bob-met-alice/ffx-schemes-for-format-preserving-encryption-a2a7aa4f1377 I noticed that the counter is reset each round. Works fine removing the initialization and allows the value to be carried.
The text was updated successfully, but these errors were encountered: