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

Duplicate symbol appears in alphabet for FF1 base85 test file #100

Open
dspdon opened this issue Dec 24, 2023 · 7 comments
Open

Duplicate symbol appears in alphabet for FF1 base85 test file #100

dspdon opened this issue Dec 24, 2023 · 7 comments

Comments

@dspdon
Copy link

dspdon commented Dec 24, 2023

The alphabet definition contains a duplicate symbol in the FF1 test file:
testfolders_v1/aes_ff1_base85_test.json

@dspdon dspdon closed this as completed Dec 24, 2023
@dspdon
Copy link
Author

dspdon commented Dec 24, 2023

Sorry, I believe I opened this in error.

@dspdon dspdon reopened this Dec 29, 2023
@dspdon
Copy link
Author

dspdon commented Dec 29, 2023

I paused on this issue due to some insight I was receiving from Daniel regarding a KW and a KWP issue I opened. However, I see a different basis for concern here. The base85 test file contains a duplicate underscore symbol in the alphabet. The same alphabet is defined for all test cases. Having a duplicate symbol seems appropropriate for some test cases, but it seems unlikely to have been intended for all test cases.

Do you confirm two underscore symbols in the alphabet? I wonder if it downloaded properly.

@bleichenbacher-daniel
Copy link

Yes, this is a mistake. aes_ff1_radix85_test.json contains the same test vectors in a different format.

@dspdon
Copy link
Author

dspdon commented Jan 14, 2024

Thanks - I ran those radix85 test cases, they work fine. Will you be able to regenerate the base85 test with a unique alphabet? It would be nice to have that case for validation purposes.

@bleichenbacher-daniel
Copy link

Unfortunately, I don't have access to the generation code anymore since I'm no longer working at Google. This is sad because fixing this would probably require just 2 lines of change.
I'm working on it but regenerating the whole set of test vectors from scratch will take some time. FF1 is an algorithm that has many opportunities for mistakes. E.g., BouncyCastle had flaw that was caused by a floating point rounding error. After noticing this flaw, I did add quite a large number of additional test vectors for more edge cases. As far as I can see these test cases have not yet been uploaded.

@dspdon
Copy link
Author

dspdon commented Jan 18, 2024 via email

@bleichenbacher-daniel
Copy link

Thanks a lot for looking into this issue.

Please note, that I can't upload any new files, since I don't have access. All the test vector files are generated and fixing them would best be done by fixing the generation code.

I was forced to write my own formatter for the test vector. Mainly, since the only pretty printer that generated reasonably looking output ran afoul with the style checkers and generated test vector files would trigger thousands of style violations. Personally, I don't care a lot about the amount of spaces used. Also, no spaces before ':' does indeed look better. More important is the format of the files, which could be checked with JSON schemas. Unfortunately, the schemas for testvector_v1 files are still missing on github. I would think that many test implementations would fail if "tests" just contain a single test vector instead of an array.

Thanks again, it is really sad that this issue cannot be fixed in reasonable time.

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