-
Notifications
You must be signed in to change notification settings - Fork 127
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
[PATCH API-NEXT v4] crypto: add new algorithms #434
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Most of the Checkpatch issues are false positives, but dropping the URLs will fix one "line too long" check.
If PR #422 is a pre-req it needs to have Travis issues resolved first. PR #430 can be merged first and that deleted from v2 of this patch, unless @psavol wants to withdraw it and use this PR's copy.
static crypto_test_reference_t aes_ccm_reference[] = { | ||
/* | ||
* AES-CCM reference from RFC 3610: | ||
* https://tools.ietf.org/html/rfc3610#section-8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RFC citation is sufficient. URLs should not be included as they tend to get stale.
/* | ||
* Test vector from RFC 7539, sections 2.8.2, A.5: | ||
* https://tools.ietf.org/html/rfc7539#section-2.8.2 | ||
* https://tools.ietf.org/html/rfc7539#appendix-A.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RFC citation is sufficient.
@@ -477,6 +606,244 @@ static crypto_test_reference_t aes_gmac_reference[] = { | |||
}, | |||
}; | |||
|
|||
/* Test vectors from SP800-38B / CSRC examples: | |||
* https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/AES_CMAC.pdf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NIST SP citation is sufficient. Any reader can easily Google it if needed. URLs tend to get stale quickly, and checkpatch flags it as too long.
#422 is not a prereq. |
Codecov Report
@@ Coverage Diff @@
## api-next #434 +/- ##
============================================
Coverage ? 78.463%
============================================
Files ? 196
Lines ? 35308
Branches ? 0
============================================
Hits ? 27704
Misses ? 7604
Partials ? 0
|
Remaining checkpatch issues are false positives. |
#436 is merged. You can refresh this one. |
Add enumeration for AES CMAC authentication algorithm. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
ChaCha20-Poly1305 is a promising AEAD algorithm. Add decarations to support it. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Checking that cipher is not NULL was required because GMAC used NULL cipher to specify it's IV. Now it is obosolete, as auths has their own IV. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Merge defines for AES-CBC/CTR/GCM keys. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Neither RFC 3610 nor SP 800-38C contains test vectors for 192 and 256 bit keys and none contains test vectors for 11-bit IV (used in IPsec). So I've used 1st test vector from RFC 3610 and generated the rest of test vectors. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Drop crypto_kind_t, unused now. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
OpenSSL >= 1.1.0 supports ChaCha20-Poly1305 AEAD cipher, so let's support it in linux-generic. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
AES-CCM support in OpenSSL is quite unique: it requires whole data to be passed in single EVP_EncryptUpdate/EVP_DecryptUpdate call. Supporting this requires copying data back-and-forth between packet and temporary buffer. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Point that current authentication functions use HMAC by including hmac in their names. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Support IPsec ChaCha20-Poly1305 on top of linux-generic's crypto support. Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API modifications OK.
Reviewed-by: Petri Savolainen petri.savolainen@linaro.org
Merged. |
This is a copy of #430 , incorporating changes from #428 , implementation of CCM (declared at #430) and declaration and implentation of AES-CMAC, requested by our customers. I'd like to get #422 in for TigerMoth. Otherwise we seem more or less complete.