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
Polynomials for CMAC and GCM mode #423
Comments
The library already had the 256-bit CMAC polynomial. The 512 and 1024-bit CMAC polynomials were handled at:
|
Table of Low-Weight Binary Irreducible Polynomial (http://www.hpl.hp.com/techreports/98/HPL-98-135.pdf) lists 256,10,5,2 for 256-bit polynomial, which means x^256 + x^10 + x^5 + x^2 + 1. See also this thread: http://sci.crypt.narkive.com/3lS5EbY4/omac-cmac-constants-for-different-block-sizes |
Thanks @kerukuro. Crud, it looks like a typo on out part. I think we need this change:
I was suspect of that for a long time. I think I convinced myself it was correct when it was wrong. My apologies for that. Before I check it in, can you confirm it? |
This looks like the correct fix. Thanks. (FWIW I've also found an online gp calculator where one can test if a polynomial is irreducible using commands from the sci.crypt thread) |
Thanks. Committed at fca8adc54976. |
Thanks to @kerukuro we got the polynomials straitened out. Closing this ticket. |
We recently added variable block sizes and ciphers that incorporate them. Refer to the bug reports below. The larger block sizes require different polynomials. This ticket will track the related work.
We already accomplished the work for the polynomials for CMAC, but it should be documented. GCM mode is still outstanding.
According to Table of Low-Weight Binary Irreducible Polynomials, here are the 256, 512 and 1024-bit polynomials:
Also see OMAC/CMAC constant for different block sizes on Crypto Stack Exchange.
Related bug reports:
The text was updated successfully, but these errors were encountered: