Skip to content

leancrypto: add initial recipe#1031

Open
embetrix wants to merge 1 commit intoopenembedded:masterfrom
embetrix:feature/leancrypto
Open

leancrypto: add initial recipe#1031
embetrix wants to merge 1 commit intoopenembedded:masterfrom
embetrix:feature/leancrypto

Conversation

@embetrix
Copy link
Contributor

@embetrix embetrix commented Mar 9, 2026

Cryptographic library that exclusively contain Quantum resistant cryptographic algorithms. It is lean has minimal dependencies, supports stack-only operation and provides optimized implementations for ML-KEM (Kyber), ML-DSA (Dilithium), SLH-DSA (Sphincs+) and many more.

@embetrix embetrix force-pushed the feature/leancrypto branch 3 times, most recently from a130020 to ef379b3 Compare March 9, 2026 12:04
@OldManYellsAtCloud
Copy link
Contributor

Regarding the tests, do you think you could make them ptest compatible? That would allow them to be executed regularly, helping with regressions.

(Also, extra thanks a lot for the tests, they are always useful, and that is especially true for cryptography tools)

@embetrix
Copy link
Contributor Author

embetrix commented Mar 9, 2026

@OldManYellsAtCloud Thanks for the review. Implementing this would require additional effort and I can’t commit to it right now. However this could be considered as part of a future improvement in a separate pull request.

@kraj
Copy link
Contributor

kraj commented Mar 18, 2026

the recipe fails to build, see - https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/5867436/raw_inline

ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/bin/.debug/lc_pkcs7_generator in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
NOTE: Running task 51491 of 70997 (/srv/pokybuild/yocto-worker/meta-oe/build/meta-openembedded/meta-oe/recipes-extended/boinc/boinc-client_7.20.5.bb:do_create_spdx)
NOTE: recipe libiodbc-3.52.16-r0: task do_rm_work: Succeeded
NOTE: recipe piglit-1.0+gitr-r0: task do_create_package_spdx: Started
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/bin/.debug/lc_x509_generator in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/.debug/sha3-256sum in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/.debug/sha384sum in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/.debug/sha3-512sum in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/.debug/sha512sum in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/.debug/sha3-384sum in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/.debug/ascon256-sum in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/.debug/sha256sum in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_kyber_512_kem_x25519_tester in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_aes_enc_tester in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_kyber_kem_tester_common in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_sphincs_prehash_tester_256s in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_dilithium_44_tester_c in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_symkmac256_test in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_sha3_384_tester in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_symkmac128_large_test in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_hqc_256_tester_perf in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_hkdf_tester in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_hmac_sha2_drbg_tester_large in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_dilithium_tester_iuf_c in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_kyber_kem_kdf_tester_c in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_shake256_4x_avx2_tester in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_kmac_drng_tester_large_c in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_dilithium_65_invalid_tester in package leancrypto-dbg contains reference to TMPDIR [buildpaths]
ERROR: leancrypto-1.6.0-r0 do_package_qa: QA Issue: File /usr/libexec/leancrypto/tests/.debug/leancrypto_kyber_kex_x448_tester in package leancrypto-dbg contains reference to TMPDIR [buildpaths]

@embetrix embetrix force-pushed the feature/leancrypto branch from ef379b3 to cdcb222 Compare March 18, 2026 08:26
@embetrix
Copy link
Contributor Author

@kraj thanks for checking, I added INSANE_SKIP:${PN}-dbg = "buildpaths" it should now build correctly

@kraj
Copy link
Contributor

kraj commented Mar 18, 2026

@kraj thanks for checking, I added INSANE_SKIP:${PN}-dbg = "buildpaths" it should now build correctly

This sort of papers over the underlying problem but it does impact reproducible builds, which we are aggressively trying to achieve for meta-oe layers. I would expect a root cause and fix in the build scripts to not let the hard coding show up in ELF files. It might be some cflags/ldfags etc getting it wrong.

@embetrix
Copy link
Contributor Author

embetrix commented Mar 19, 2026

@kraj only test programs *_tester are affected by the contains reference to TMPDIR, usually they are not installed, I'm checking how to fix this

Cryptographic library that exclusively contains
Quantum resistant cryptographic algorithms. It is lean has minimal dependencies,
supports stack-only operation and provides optimized implementations for
ML-KEM (Kyber), ML-DSA (Dilithium), SLH-DSA (Sphincs+) and many more

Signed-off-by: Ayoub Zaki <ayoub.zaki@embetrix.com>
@embetrix embetrix force-pushed the feature/leancrypto branch from cdcb222 to 35cf3b0 Compare March 19, 2026 09:03
@embetrix
Copy link
Contributor Author

@kraj I fixed the issue upstream, got quickly merged and imported the backport patch so it should pass now :-)

PACKAGECONFIG[tests] = "-Dtests=enabled,-Dtests=disabled"

do_install:append () {
if ${@bb.utils.contains('PACKAGECONFIG', 'tests', 'true', 'false', d)}; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to use ptest distro feature to instrument the test related pieces of the recipe. Please check other recipes which inherit ptest and control it that way.

@kraj
Copy link
Contributor

kraj commented Mar 19, 2026

it still is not through the build errors see

https://autobuilder.yoctoproject.org/valkyrie/#/builders/81/builds/1363

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

Successfully merging this pull request may close these issues.

3 participants