-
Notifications
You must be signed in to change notification settings - Fork 157
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
Add AES-CCM support #46
Conversation
So CI fails b/c of lint issues:
I can fix the first three, but I'm not so convinced about the last one. It's not strictly necessary I suppose but it does break with the symmetry going on in that block. |
Nice, this makes the next step a lot easier! I am 100% with merging after
It doesn't look like any ciphersuites use CCM and non-PSK right? that makes this a little harder to test, but not a big deal! It would just be great if we could confirm this all works before having to worry about PSK |
So I have one lint error I don't want to fix:
I agree with |
That was a lot of CI wrangling 😅. The commit linter is overly paranoid from my pov, commits with just a subject and no body should be allowed; sometimes there's just not that much to say. |
@Sean-Der So on the testing thing... I can add a few for simpler functions but ultimately I'd like to have some inputs/outputs to test At the end of RFC 3610, in section 8, are a number of test vectors: https://tools.ietf.org/html/rfc3610. Could you suggest how to transform one into a test, and then I can add the rest? |
@daenney You can use the following syntax in Go to represent hex: For testing we usually do this type of table testing setup: You would have the binary input and you can Seal/Open and verify if you get back where you started or verify against an expected result. |
Hey @daenney Those test vectors in the RFC look perfect! If you get a chance I would add them in, and this is a merge from me! After that I can help with getting the two DTLS implementations talking to each other (hack it up ugly in a branch) and we can just go from there, make it configurable and doing the right thing. thanks! |
@Sean-Der @backkem I've added a test based on the first vector in the RFC but it fails. I'm going to need someone to take a look at this and tell me what I've misunderstood b/c I'm stumped. I'm not going to be able to make any progress on this anymore without some help. I took a look at https://github.com/ircmaxell/quality-checker/blob/master/tmp/gh_18/PHP-PasswordLib-master/test/Data/Vectors/ccm-RFC3610.test-vectors but that's not helping me understand what I've missed either. |
This is the first step towards completing #45.
This is necessary in order to be able to define exclude-rules in the configuration
Though in general gocritic is correct, the usage of L relates directly to the CCM spec. Keeping it like this makes it easier to understand what the code is doing when reading the spec.
This also happens in stdlib's crypto/aes/aes_gcm in the Seal method so we should allow it too.
As mandated by the commit linter
Thanks @backkem for pointing out what was wrong with the tests on Slack. All fixed and good to go! The vectors run out of order b/c of the
|
This adds a number of tests based on the 24 vectors defined in RFC 3610 to ensure the implementation is correct.
Hey @daenney Everything LGTM! You should have a Really nice work on getting this done, onto the next step :) |
This is the first step towards completing #45.