summaryrefslogtreecommitdiff
path: root/examples/fips_validation
AgeCommit message (Collapse)Author
2024-11-19examples/fips_validation: fix EdDSA signature sizeGowrishankar Muthukrishnan
Fix EdDSA signature size. Fixes: 12ede9ac497f ("examples/fips_validation: support EdDSA") Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2024-11-19examples/fips_validation: prehash input for RSAGowrishankar Muthukrishnan
Plain text needs to be prehashed for RSA as well in asymmetric crypto validation. Fixes: 12ede9ac497f ("examples/fips_validation: support EdDSA") Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2024-10-09cryptodev: move RSA padding information into xformGowrishankar Muthukrishnan
RSA padding information could be a xform entity rather than part of crypto op, as it seems associated with hashing algorithm used for the entire crypto session, where this algorithm is used in message digest itself. Even in virtIO standard spec, this info is associated in the asymmetric session creation. Hence, moving this info from crypto op into xform structure. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Arkadiusz Kusztal <[email protected]> Acked-by: Akhil Goyal <[email protected]>
2024-10-09examples/fips_validation: support EdDSAGowrishankar Muthukrishnan
Add EdDSA support in fips_validation app. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2024-07-02examples/fips_validation: fix dereference and out-of-boundGowrishankar Muthukrishnan
Fix NULL dereference, out-of-bound, bad bit shift issues reported by coverity scan. Coverity issue: 384440, 384435, 384433, 384429 Fixes: 36128a67c27e ("examples/fips_validation: add asymmetric validation") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2024-02-16eal: add helper to skip whitespacesDavid Marchand
Reduce code duplication by providing a simple inline helper. Signed-off-by: David Marchand <[email protected]> Acked-by: Tyler Retzlaff <[email protected]> Acked-by: Bruce Richardson <[email protected]>
2024-02-12examples/fips_validation: remove use of PMD logtypeStephen Hemminger
Replace PMD with USER1 since that is already used in main Fixes: 41d561cbdd24 ("examples/fips_validation: add power on self test") Signed-off-by: Stephen Hemminger <[email protected]>
2023-10-09cryptodev: set private and public keys in EC sessionGowrishankar Muthukrishnan
The EC private and public keys can be maintained per session, hence, moved these keys from per packet asym op to EC xform. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Ciara Power <[email protected]>
2023-09-05use abstracted bit count functionsDavid Marchand
Now that DPDK provides such bit count functions, make use of them. This patch was prepared with a "brutal" commandline: $ old=__builtin_clzll; new=rte_clz64; git grep -lw $old :^lib/eal/include/rte_bitops.h | xargs sed -i -e "s#\<$old\>#$new#g" $ old=__builtin_clz; new=rte_clz32; git grep -lw $old :^lib/eal/include/rte_bitops.h | xargs sed -i -e "s#\<$old\>#$new#g" $ old=__builtin_ctzll; new=rte_ctz64; git grep -lw $old :^lib/eal/include/rte_bitops.h | xargs sed -i -e "s#\<$old\>#$new#g" $ old=__builtin_ctz; new=rte_ctz32; git grep -lw $old :^lib/eal/include/rte_bitops.h | xargs sed -i -e "s#\<$old\>#$new#g" $ old=__builtin_popcountll; new=rte_popcount64; git grep -lw $old :^lib/eal/include/rte_bitops.h | xargs sed -i -e "s#\<$old\>#$new#g" $ old=__builtin_popcount; new=rte_popcount32; git grep -lw $old :^lib/eal/include/rte_bitops.h | xargs sed -i -e "s#\<$old\>#$new#g" Then inclusion of rte_bitops.h was added were necessary. Signed-off-by: David Marchand <[email protected]> Acked-by: Tyler Retzlaff <[email protected]> Reviewed-by: Long Li <[email protected]>
2023-07-11examples/fips_validation: fix digest length in AES-GCMSamina Arshad
For AES GCM non JSON decrypt test cases the digest length is being set incorrectly.The digest length is not being cleared after test cases, causing an issue when running tests individually without the --path-is-folder flag. This fix adds the digest length correctly to the decrypt cases and clears the digest length after each test file. Fixes: 4aaad2995e13 ("examples/fips_validation: support GCM parsing") Cc: [email protected] Signed-off-by: Samina Arshad <[email protected]> Acked-by: Brian Dooley <[email protected]> Acked-by: Gowrishankar Muthukrishnan <[email protected]>
2023-06-22examples/fips_validation: fix external buildDavid Marchand
Added sources were not referenced in the makefile used when compiling this example externally. Fixes: 36128a67c27e ("examples/fips_validation: add asymmetric validation") Fixes: b455d261eb89 ("examples/fips_validation: validate ECDSA") Cc: [email protected] Signed-off-by: David Marchand <[email protected]> Acked-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Bruce Richardson <[email protected]>
2023-03-28examples/fips_validation: fix digest in non-JSON SHA MCTGowrishankar Muthukrishnan
Non JSON SHA MCT tests produce incorrect digest due to a regression while handling MD blocks in common for all kind of SHA, SHA2, SHA3 and SHAKE algorithms. Fixing this along with some cleanup to use only rte_malloc API for storing test vectors as in other tests. Fixes: 1ea7940e0f44 ("examples/fips_validation: add SHA3 validation") Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Tested-by: Brian Dooley <[email protected]>
2023-03-23examples/fips_validation: remove unneeded null checksStephen Hemminger
No check for null pointer is necessary before calling free(). Fixes: 1ea7940e0f44 ("examples/fips_validation: add SHA3 validation") Fixes: 225f04fb3e4c ("examples/fips_validation: add SHAKE validation") Signed-off-by: Stephen Hemminger <[email protected]>
2023-03-01examples/fips_validation: add extra space in JSON bufferGowrishankar Muthukrishnan
Current test buffer to copy input data of maximum possible length did not account NULL character, due to which a last input character is always ignored and it causes tests like RSA SIGVER for modulo of 4096 bits to fail. This patch fixes it. Fixes: 0b65d54f3a4 ("examples/fips_validation: fix JSON buffer size") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2023-03-01examples/fips_validation: fix AES-XTS sequence numberGowrishankar Muthukrishnan
Fix AES XTS test to read sequence number correctly. Fixes: f8e431ed8f6 ("examples/fips_validation: add parsing for AES-XTS") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2023-03-01examples/fips_validation: fix AES-GCM testsGowrishankar Muthukrishnan
AES GCM validation tests fail in FIPS validation due to incorrect fields populated in response file. This patch fixes them. Fixes: 5b540bebac8e ("examples/fips_validation: fix GMAC decryption output") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2023-03-01examples/fips_validation: add SHA3 in ECDSA testGowrishankar Muthukrishnan
Add SHA3 algorithms in ECDSA as supported. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2023-03-01examples/fips_validation: support ECDSA keygenGowrishankar Muthukrishnan
Add support to validate ECDSA keygen mode tests. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2023-03-01examples/fips_validation: add CCM JSON validationGowrishankar Muthukrishnan
Add support in fips_validation to parse CCM JSON vectors. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2023-03-01examples/fips_validation: add SHAKE validationGowrishankar Muthukrishnan
Add support in fips_validation to parse SHAKE algorithms. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2023-03-01examples/fips_validation: fix integer parsingGowrishankar Muthukrishnan
Parsing integer value in test case vector does not store it because only string was expected. This patch adds handling for integer value as well. Fixes: 58cc98801eb ("examples/fips_validation: add JSON parsing") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2023-03-01examples/fips_validation: add SHA3 validationGowrishankar Muthukrishnan
Add support in fips_validation to parse SHA3 algorithms. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2023-03-01examples/fips_validation: fix MCT output for SHAGowrishankar Muthukrishnan
MCT test for SHA need not print message string along with digest value. Fixes: d5c247145c2 ("examples/fips_validation: add parsing for SHA") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2022-11-15examples: remove unnecessary null checksStephen Hemminger
The function rte_free() already handles NULL argument; therefore the checks in this code are unnecessary. Signed-off-by: Stephen Hemminger <[email protected]>
2022-11-08examples/fips_validation: fix typo in error logPablo de Lara
Digest length is being printed out, not IV length. Fixes: ac026f4668d0 ("examples/fips_validation: support CMAC parsing") Fixes: f64adb6714e0 ("examples/fips_validation: support HMAC parsing") Cc: [email protected] Signed-off-by: Pablo de Lara <[email protected]> Reviewed-by: Brian Dooley <[email protected]>
2022-11-03examples/fips_validation: fix GMAC IV generationBrian Dooley
Replace rand() call in fips validation example with rte_rand(). Coverity issue: 381668 Fixes: e27268bd2103 ("examples/fips_validation: add parsing for AES-GMAC") Signed-off-by: Brian Dooley <[email protected]>
2022-10-29examples/fips_validation: fix block parsingBrian Dooley
When parsing request files check for file type. This fix will remove dependence on command line parameter for using libjansson Fixes: 0f42f3d6034c ("examples/fips_validation: share callback with multiple keys") Signed-off-by: Brian Dooley <[email protected]> Acked-by: Ciara Power <[email protected]> Acked-by: Gowrishankar Muthukrishnan <[email protected]>
2022-10-29examples/fips_validation: validate ECDSAGowrishankar Muthukrishnan
This patch adds support in fips_validation app to validate ECDSA. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2022-10-29examples/fips_validation: fix GMAC decryption outputGowrishankar Muthukrishnan
AES GMAC decrypt test should output only whether test passed or failed. Fixes: ad42b228c6e2 ("examples/fips_validation: fix print for zero length payload") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Reviewed-by: Brian Dooley <[email protected]>
2022-10-29examples/fips_validation: randomize message for conformance testGowrishankar Muthukrishnan
FIPS conformance tests require randomizing message based on SP 800-106. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]>
2022-10-29examples/fips_validation: encode digest with hash OIDGowrishankar Muthukrishnan
FIPS RSA validation requires hash digest be encoded with ASN.1 value for digest info. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]>
2022-10-29examples/fips_validation: add asymmetric validationGowrishankar Muthukrishnan
Add support for asymmetric crypto validation starting with RSA. For the generation of crypto values which is multiprecision in math, openssl library is used only for this purpose. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2022-10-29examples/fips_validation: add parsing for AES-CTRBrian Dooley
Added functionality to parse algorithm for AES CTR test Signed-off-by: Brian Dooley <[email protected]> Acked-by: Kai Ji <[email protected]> Acked-by: Gowrishankar Muthukrishnan <[email protected]>
2022-10-29examples/fips_validation: add parsing for AES-GMACBrian Dooley
Added functionality to parse algorithm for AES GMAC test. Signed-off-by: Brian Dooley <[email protected]> Acked-by: Kai Ji <[email protected]> Acked-by: Gowrishankar Muthukrishnan <[email protected]>
2022-10-07examples/fips_validation: fix JSON buffer sizeGowrishankar Muthukrishnan
In asym op, while parsing test interim info, existing buffer of size 256 bytes is not sufficient, hence setting it to maximum that a test would need. Fixes: 58cc98801eb ("examples/fips_validation: add JSON parsing") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2022-10-07examples/fips_validation: fix SHA hash size calculationGowrishankar Muthukrishnan
Added function to calculate hash size for a given SHA hash algorithm. Fixes: d5c247145c2 ("examples/fips_validation: add parsing for SHA") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2022-10-07examples/fips_validation: add interim parse writebackGowrishankar Muthukrishnan
Asym tests need a callback to write interim info in expected output. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2022-10-07examples/fips_validation: fix parsing test group infoGowrishankar Muthukrishnan
If a test group does not have expected key, it should not crash. This patch fixes parsing test group info to continue further when a key does not exist (as in asym tests). Fixes: 58cc98801eb ("examples/fips_validation: add JSON parsing") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2022-10-07examples/fips_validation: fix crash in SHA MCTGowrishankar Muthukrishnan
In case of FIPS 140-2 format of test vectors in MCT test, msg is not given in the test vector, hence pt will be NULL which test function has to handle correctly. Fixes: d5c247145c2c ("examples/fips_validation: add parsing for SHA") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Tested-by: Brian Dooley <[email protected]>
2022-10-07examples/fips_validation: add TDES parsingGowrishankar Muthukrishnan
Added function to parse algorithm for TDES CBC and ECB tests in JSON. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2022-10-07examples/fips_validation: share callback with multiple keysGowrishankar Muthukrishnan
Make use of key param in test callbacks so that, test callback can be shared with multiple keys. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2022-10-07examples/fips_validation: fix SHA test type parsingGowrishankar Muthukrishnan
Store SHA test type in its own interim info struct instead of AES. Fixes: d5c247145c2 ("examples/fips_validation: add parsing for SHA") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Tested-by: Brian Dooley <[email protected]>
2022-10-07examples/fips_validation: fix memory allocation in AES MCTGowrishankar Muthukrishnan
Instead of allocating memory in every external iteration, do once in the beginning of AES MCT tests and free at the end. Fixes: 8b8546aaedf ("examples/fips_validation: add parsing for AES-CBC") Cc: [email protected] Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Brian Dooley <[email protected]>
2022-10-04cryptodev: hide symmetric session structureAkhil Goyal
Structure rte_cryptodev_sym_session is moved to internal headers which are not visible to applications. The only field which should be used by app is opaque_data. This field can now be accessed via set/get APIs added in this patch. Subsequent changes in app and lib are made to compile the code. Signed-off-by: Akhil Goyal <[email protected]> Signed-off-by: Fan Zhang <[email protected]> Acked-by: Kai Ji <[email protected]> Tested-by: Gagandeep Singh <[email protected]> Tested-by: David Coyle <[email protected]> Tested-by: Kevin O'Sullivan <[email protected]>
2022-10-04cryptodev: rework session frameworkAkhil Goyal
As per current design, rte_cryptodev_sym_session_create() and rte_cryptodev_sym_session_init() use separate mempool objects for a single session. And structure rte_cryptodev_sym_session is not directly used by the application, it may cause ABI breakage if the structure is modified in future. To address these two issues, the rte_cryptodev_sym_session_create will take one mempool object that the session and session private data are virtually/physically contiguous, and initializes both fields. The API rte_cryptodev_sym_session_init is removed. rte_cryptodev_sym_session_create will now return an opaque session pointer which will be used by the app and other APIs. In data path, opaque session pointer is attached to rte_crypto_op and the PMD can call an internal library API to get the session private data pointer based on the driver id. Note: currently single session may be used by different device drivers, given it is initialized by them. After the change the session created by one device driver cannot be used or reinitialized by another driver. Signed-off-by: Akhil Goyal <[email protected]> Signed-off-by: Fan Zhang <[email protected]> Signed-off-by: Ruifeng Wang <[email protected]> Acked-by: Kai Ji <[email protected]> Tested-by: Gagandeep Singh <[email protected]> Tested-by: David Coyle <[email protected]> Tested-by: Kevin O'Sullivan <[email protected]>
2022-09-21eal: remove unneeded includes from a public headerDmitry Kozlyuk
Do not include <ctype.h>, <errno.h>, and <stdlib.h> from <rte_common.h>, because they are not used by this file. Include the needed headers directly from the files that need them. Signed-off-by: Dmitry Kozlyuk <[email protected]> Acked-by: Bruce Richardson <[email protected]>
2022-07-04examples/fips_validation: fix print for zero length payloadArchana Muniganti
NIST GCM decrypt result vectors expects to have following print for zero length payload instead of having no print. "pt" = "" Fixes: b09aac2d6e2b ("examples/fips_validation: add JSON to GCM test") Signed-off-by: Archana Muniganti <[email protected]>
2022-07-04examples/fips_validation: add parsing for SHAGowrishankar Muthukrishnan
Added function to parse algorithm for SHA test. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Fan Zhang <[email protected]>
2022-06-30examples/fips_validation: add parsing for AES-XTSGowrishankar Muthukrishnan
Added function to parse algorithm for AES XTS test. Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Fan Zhang <[email protected]>
2022-06-30examples/fips_validation: add AES-CBC in the enumGowrishankar Muthukrishnan
Add algorithm enum specifically for AES_CBC instead of relying on AES as such. Fixes: 8b8546aaedf ("examples/fips_validation: add parsing for AES-CBC") Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Fan Zhang <[email protected]>