Steffen Jaeckel
94287f0480
Merge pull request #721 from cyanogilvie/fix/pclmul-cache-init-msvc
...
Fix s_pclmul_is_supported() cache flag on MSVC
2026-04-14 13:36:27 +02:00
Cyan Ogilvie
baac704391
Fix s_pclmul_is_supported() cache flag on MSVC
...
Move initialized=1 out of the #else branch so that on MSVC it doesn't
call __cpuid every time.
2026-04-14 07:45:41 -03:00
Steffen Jaeckel
cf29490bfc
Introduce LTC_ALIGNED_BUF_SIZE(). [skip ci]
...
Since there's absolutely no way to ensure that a struct is somehow
aligned -- all those compile-time mechanism are best-effort and no
guarantee -- we align the necessary buffers at run-time.
AES-NI already introduced that, let's improve a bit upon its usage.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-14 09:55:43 +02:00
Steffen Jaeckel
14352f5036
Improve timing demo a bit. [skip ci]
...
Allow more classes to be filtered.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-14 09:17:11 +02:00
Karel Miko
66925c259c
Fix helper.pl. [skip ci]
...
Fix matching of other uses of a descriptor type, besides their declaration.
2026-04-13 19:48:05 +02:00
Steffen Jaeckel
25e93e39cf
Add uninstall_hooks make command. [skip ci]
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-13 14:45:12 +02:00
Steffen Jaeckel
5abd33ea32
Merge pull request #718 from libtom/pr/argon2-rfc9106
...
Argon2 password hashing function (RFC 9106)
2026-04-13 10:47:50 +02:00
Steffen Jaeckel
c68b9c0b3f
Minor changes of argon2 implementation.
...
* We continue using `LTC_ARGCHK()` until we've decided on something else.
* Call the enum/struct the same as the typedef.
* Some other small adjustments/fixes.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-12 16:06:53 +02:00
Karel Miko
458b392d01
Argon2 password hashing function (RFC 9106)
2026-04-12 14:48:32 +02:00
Steffen Jaeckel
3223b87588
Merge pull request #709 from MarekKnapek/sha-stack
...
Smaller stack usage for SHA-1, SHA-256 and SHA-512.
2026-04-09 17:04:26 +02:00
Steffen Jaeckel
cc53195945
Update docs.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-09 15:40:07 +02:00
Steffen Jaeckel
11929885a4
Basic algo self-tests should be run before the ones using them.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-09 15:40:07 +02:00
Steffen Jaeckel
77afa82d14
Add option LTC_SMALL_STACK.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-09 15:40:07 +02:00
Steffen Jaeckel
a9cd3cd0ff
Slightly improve timing demo.
...
* Add the option to only run for a subset of algos.
* Improve `hash` to show something meaningful.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-09 08:29:50 +02:00
Marek Knápek
17cbd2be0a
Smaller stack usage for SHA-1, SHA-256 and SHA-512.
2026-04-09 08:29:50 +02:00
Steffen Jaeckel
d0e09092f9
Re-format gitignore. [skip ci]
...
I wasn't aware that the gitignore file had DOS line endings. Changed that
to UNIX line endings.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-09 08:29:38 +02:00
Steffen Jaeckel
ecc36868a9
Merge pull request #714 from sjlombardo/develop
...
Optimize gcm_gf_mult using PCLMULQDQ and PMULL
2026-04-07 18:31:43 +02:00
Steffen Jaeckel
93eed8d3fa
Add CMake CI testrun w/o ASM
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-07 16:51:37 +02:00
Stephen Lombardo
46e0137e55
Optimize gcm_gf_mult using PCLMULQDQ and PMULL
...
GCM table setup disproportionately hurts LTC performance
with small messages. Disabling LTC_GCM_TABLES helps for
small payloads but hurts large ones.
This implements hardware carry-less multiplication for GCM that
performs well for both cases using PCLMULQDQ on x86/x86_64 and
PMULL on AArch64.
There are no public API changes.
These features can be disabled with LTC_NO_GCM_PCLMUL,
LTC_NO_GCM_PMULL, or LTC_NO_ASM. LTC_GCM_TABLES is disabled
automatically when no opt-out macro is set.
2026-04-07 16:51:37 +02:00
Steffen Jaeckel
6ad2ce97a4
Merge pull request #715 from libtom/add-cmake-tests
...
Add CMake & arm64 tests to CI
2026-04-07 15:45:09 +02:00
Steffen Jaeckel
0572f9564f
Update nick-fields/retry GH action
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-07 12:40:22 +02:00
Steffen Jaeckel
97be312324
Add CMake tests to CI
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-07 12:19:33 +02:00
Steffen Jaeckel
63af5f6dc1
Update docs of ecc_free().
...
This fixes #710
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-02-04 11:30:24 +01:00
Steffen Jaeckel
9a13375d47
Merge pull request #708 from MarekKnapek/KangarooTwelve
...
KangarooTwelve
2025-11-28 22:27:59 +01:00
Marek Knápek
6832f3c106
Add KangarooTwelve XOF functions.
...
KangarooTwelve 128bits and KangarooTwelve 256 bits.
https://keccak.team/files/TurboSHAKE.pdf
https://www.rfc-editor.org/rfc/rfc9861.txt
https://datatracker.ietf.org/doc/html/rfc9861
2025-11-28 19:05:31 +01:00
Marek Knápek
189f9ccdf0
LTC_TURBO_SHAKE requires LTC_SHA3
2025-11-28 19:05:31 +01:00
Marek Knápek
e20fff1f3d
Add more TurboSHAKE unit tests.
2025-11-28 19:05:31 +01:00
Marek Knápek
d31ca86251
Introduce the concept of "domain" for SHAKE XOF.
2025-11-27 14:28:00 +01:00
Steffen Jaeckel
4db24a7d08
Merge pull request #692 from MarekKnapek/turboshake
...
Add TurboSHAKE XOF functions.
2025-11-26 11:08:29 +01:00
Steffen Jaeckel
2c487a2e4b
Update docs.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-25 10:09:14 +01:00
Steffen Jaeckel
e33128e18c
Fix LTC_COMPARE_TESTVECTOR()
...
Fixes: 6daff83d ("Deprecate `compare_testvector()`.")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-25 09:28:20 +01:00
Marek Knápek
709572e22e
Add TurboSHAKE XOF functions.
...
TurboSHAKE128 and TurboSHAKE256.
https://datatracker.ietf.org/doc/html/rfc9861
https://www.rfc-editor.org/rfc/rfc9861.txt
https://keccak.team/files/TurboSHAKE.pdf
https://github.com/libtom/libtomcrypt/issues/691
2025-11-25 09:22:35 +01:00
Steffen Jaeckel
34b6ad9a2e
Merge pull request #707 from libtom/improve-tests
...
Improve tests
2025-11-24 16:15:18 +01:00
Steffen Jaeckel
dda1c7eedf
Re-factor modes_test().
...
... also funny that no static analyzer complained about `ret` being
assigned, but never read ...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-24 14:58:13 +01:00
Steffen Jaeckel
6daff83d82
Deprecate compare_testvector().
...
This should never have been public API.
Also introduce a `LTC_COMPARE_TESTVECTOR()` macro to be used within the
library, which doesn't exit, but only returns an error.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-24 14:58:13 +01:00
Steffen Jaeckel
03881e4abc
Merge pull request #699 from libtom/some-improvements
...
Some improvements
2025-11-19 00:22:08 +01:00
Steffen Jaeckel
369650ccd3
Update makefiles
2025-11-18 23:20:01 +01:00
Steffen Jaeckel
e2918971fa
Re-order PEM headers to prepare for X.509 APIs
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:20:01 +01:00
Steffen Jaeckel
ea672df7a3
Put realloc logic into pem_read()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:20:01 +01:00
Steffen Jaeckel
9abf12305a
Add SubjectPublicKeyInfo support to dsa_import()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:20:01 +01:00
Steffen Jaeckel
d77afd6a68
Use rsa_init() to initialize an rsa_key
...
(and you should do that too)
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:03:42 +01:00
Steffen Jaeckel
c9b609a0b7
Extend der_flexi_sequence_cmp()
...
To be able to do a bit more, add an optional handler callback function.
Additional to that, also make it possible to mark elements as optional.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:03:42 +01:00
Steffen Jaeckel
7e78899af6
Re-factor s_import_pkcs8()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:03:42 +01:00
Steffen Jaeckel
002a6c8330
Export static function as x509_import_spki()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:03:42 +01:00
Steffen Jaeckel
06b7a7e416
Extract static function as x509_get_pka()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:03:41 +01:00
Steffen Jaeckel
eda303df0f
Merge pull request #705 from libtom/new-ecc-api
...
New ECC API
2025-11-18 21:41:41 +01:00
Steffen Jaeckel
7f73f83853
Update docs
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 18:53:26 +01:00
Steffen Jaeckel
a642e69afb
Update makefiles
2025-11-18 18:53:26 +01:00
Steffen Jaeckel
b46c695505
Add tests for deprecated APIs
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 18:53:26 +01:00
Steffen Jaeckel
35a4a5fc1b
Move RFC6979 hash alg to a new ecc signature options struct
...
Fixes #700
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 18:53:26 +01:00