Commit graph

160 commits

Author SHA1 Message Date
Steffen Jaeckel
c17e5ed051 Update makefiles 2026-05-19 13:29:49 +02:00
Karel Miko
96d2d09d7a Update makefiles 2026-05-19 13:12:32 +02:00
Karel Miko
7bcdb63950 Update makefiles 2026-05-19 13:03:25 +02:00
Karel Miko
2f6b257def Update makefiles 2026-05-16 11:38:42 +02:00
Steffen Jaeckel
078fd15f69 Apply V option to make clean
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-04 10:08:07 +02:00
Karel Miko
e0599e2b3a Update makefiles 2026-04-24 11:50:39 +02:00
Steffen Jaeckel
b6d4e6384e Update makefiles 2026-04-24 10:45:27 +02:00
Karel Miko
b0a1804d50 Update makefiles 2026-04-24 09:41:08 +02:00
Steffen Jaeckel
760d09031e Add Project Wycheproof testvectors for SIV.
Gemini proposed this to convert
```
import json
import requests

def to_c_hex(hex_str):
    if not hex_str: return "NULL"
    bytes_list = [f"0x{hex_str[i:i+2]}" for i in range(0, len(hex_str), 2)]
    return "{" + ",".join(bytes_list) + "}"

url = "https://raw.githubusercontent.com/C2SP/wycheproof/main/testvectors_v1/aes_siv_cmac_test.json"
data = requests.get(url).json()

print("#include <stdint.h>\n#include <stddef.h>\n")
print("typedef struct { int tcId; const char* comment; uint8_t key[64]; size_t keyLen; const uint8_t* aad; size_t aadLen; const uint8_t* msg; size_t msgLen; const uint8_t* ct; size_t ctLen; const char* result; } aes_siv_test_case;\n")

for group in data['testGroups']:
    for test in group['tests']:
        tid = test['tcId']
        if test['aad']: print(f"static const uint8_t aad_{tid}[] = {to_c_hex(test['aad'])};")
        if test['msg']: print(f"static const uint8_t msg_{tid}[] = {to_c_hex(test['msg'])};")
        if test['ct']:  print(f"static const uint8_t ct_{tid}[]  = {to_c_hex(test['ct'])};")

print("\nstatic const aes_siv_test_case aes_siv_tests[] = {")
for group in data['testGroups']:
    for test in group['tests']:
        tid = test['tcId']
        key_hex = to_c_hex(test['key'])
        aad_ptr = f"aad_{tid}" if test['aad'] else "NULL"
        msg_ptr = f"msg_{tid}" if test['msg'] else "NULL"
        ct_ptr  = f"ct_{tid}"  if test['ct']  else "NULL"

        print(f"    {{ {tid}, \"{test['comment']}\", {key_hex}, {len(test['key'])//2}, {aad_ptr}, {len(test['aad'])//2}, {msg_ptr}, {len(test['msg'])//2}, {ct_ptr}, {len(test['ct'])//2}, \"{test['result']}\" }},")
print("};")
```

I manually modified the result type to be an enum.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 10:30:32 +02:00
Steffen Jaeckel
070d613d26 Update makefiles 2026-04-15 15:22:32 +02:00
Karel Miko
3aed12c410 The scrypt Password-Based Key Derivation Function (RFC 7914) 2026-04-14 13:59:38 +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
Karel Miko
458b392d01 Argon2 password hashing function (RFC 9106) 2026-04-12 14:48:32 +02:00
Steffen Jaeckel
369650ccd3 Update makefiles 2025-11-18 23:20:01 +01:00
Steffen Jaeckel
a642e69afb Update makefiles 2025-11-18 18:53:26 +01:00
Steffen Jaeckel
d8a62f3367 Create table of supported ECC curves programmatically
Related to #349

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:56:58 +01:00
Steffen Jaeckel
47162b9609 Add demos/der_print_flexi.c
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:56:42 +01:00
Steffen Jaeckel
0c15edb22c Don't abort() in "release" builds
Change the default behavior of `LTC_ARGCHK()` for Release, resp.
Release+Shared Library builds to be non-fatal.

This closes #458

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:51:45 +01:00
Steffen Jaeckel
1978245572 Update makefiles 2025-09-13 12:04:38 +02:00
Steffen Jaeckel
6fe391956d Fix/improve some install/uninstall make targets
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-06 15:00:00 +02:00
orbea
d2f50cc16d makefile.shared: Don't use libtool
Gentoo Bug: https://bugs.gentoo.org/777084
2025-09-04 20:59:48 +02:00
Steffen Jaeckel
d05119491b Update makefiles 2025-09-04 17:36:30 +02:00
Steffen Jaeckel
2e09d68712 Update makefiles 2025-03-02 12:09:24 +01:00
Steffen Jaeckel
08b69be797 minor changes for amalgamation
* de-duplicate `struct oid_to_pbes`
* add makefile target
* add amalgamation to release
* fix `small` demo
* add header guards for `tomcrypt_private.h`
* update docs
* add CI job with amalgamated library

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-20 14:43:06 +01:00
Steffen Jaeckel
c93cc120f0 LTC_SOURCE ceased to exist
f55039bfeb removed all usage of
`LTC_SOURCE`, but I missed to remove it from the makefiles etc.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-17 15:05:01 +01:00
Steffen Jaeckel
f4df47b59b Update makefiles
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-17 18:24:26 +01:00
Steffen Jaeckel
87ff205c8b Handle potential pkg-config failures
There are cases where we want to use an MPI provider, but the package is
not installed in the system, so `pkg-config` can't find it.
To solve this simply ignore the errors created and only print something
if the user asks us to by passing `V=1`.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-11 11:57:08 +01:00
Steffen Jaeckel
54a16fb672 There are no broken demos anymore
... at least at compile time.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-11 11:09:58 +01:00
Steffen Jaeckel
88dcebdbf5 Rework demos building and installation
* add `ltc` wrapper script for installed demos
* rework demos/CMakeLists.txt and add some more bells and whistles
* prefix installed demos with `ltc-`

Currently this makes the standard makefiles and CMake results diverge, but
we can fix that later if required.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-05 17:23:12 +01:00
Steffen Jaeckel
98415b8a38 Change ltcrypt back to crypt
This reverts 85dc39483f

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-03 19:51:22 +01:00
Steffen Jaeckel
2400883060 Remove remaining footers
Fixes 24765c30c5

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-11-20 12:59:49 +01:00
Chao Wei
6f15a45adc Add SM4 block cipher
SM4 (formerly SMS4)[1] is a block cipher used in the Chinese
National Standard for Wireless LAN WAPI (Wired Authentication
and Privacy Infrastructure).
--from wikipedia
2024-08-30 05:30:48 +02:00
Steffen Jaeckel
5dec1ee02d Fix make tvs, add make pr-check
Fixup of 5ad1681ccb

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
ec8ffbb5bd Update makefiles 2024-08-20 13:29:27 +02:00
Steffen Jaeckel
65e05bfa56 Update docs
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
bee3ad2a2a add OpenSSH Private Key decryption demo
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
5ad1681ccb Add new make target tvs
To simplify generating the necessary testvectors when adding a new
algorithm.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-02-26 15:53:17 +01:00
Steffen Jaeckel
e4adaafd90 Fix make incompatibility
Since make version 4.3 [0] the `#` sign inside a string is handled
differently. Fix that.

[0] https://lists.gnu.org/archive/html/info-gnu/2020-01/msg00004.html

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-10-05 12:34:33 +02:00
Steffen Jaeckel
c48673234c Always determine manually whether CC is clang
This is required
1. when cross-compiling
2. to enable/disable the specific compiler warnings

Tested on `bash`, `dash`, `zsh` and FreeBSD `sh`.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-10-05 11:14:46 +02:00
Steffen Jaeckel
7a38fca62a Fix some pkg-config related things
* use a separate `libtomcrypt` folder to install the headers to
* use `INCPATH` and `LIBPATH` when installing `libtomcrypt.pc`
* fix `libtomcrypt.pc` generation for `makefile.unix`

This fixes #625

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 11:37:19 +02:00
Steffen Jaeckel
d026c63075 Update makefiles
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-22 18:37:25 +02:00
Steffen Jaeckel
9e0a131b2c introduce separate aes_desc
`aes_desc` and `aes_enc_desc` now do auto-detection of the best suitable
AES implementation for the platform.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-22 18:37:25 +02:00
Steffen Jaeckel
2314444cb0 Disable warnings from clang
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-22 18:37:25 +02:00
Steffen Jaeckel
8076d86366 Fix missing include paths of ltm and tfm
Default include paths of ltm and tfm have changed.
Try to get include paths from pkg-config.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 16:44:40 +02:00
Steffen Jaeckel
1ee85a8f25 Update makefiles 2022-09-02 11:30:45 +02:00
Steffen Jaeckel
23d7091b9f Update makefiles 2022-08-20 14:38:43 +02:00
Steffen Jaeckel
cf58641c99 migrate from travis CI to GitHub actions
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
c549f0fb3b add check maketarget 2020-12-21 13:53:36 +01:00
Steffen Jaeckel
461a047afd Update makefiles 2019-10-19 16:30:18 +02:00
Steffen Jaeckel
08abc93c40 Update makefiles 2019-10-17 22:27:54 +02:00