Commit graph

2353 commits

Author SHA1 Message Date
Steffen Jaeckel
39e8c51e4b WIP 2025-01-10 17:03:02 +01:00
Russ Williams
5127af0550 RFC6979: implementation, tests, docs 2025-01-10 17:02:40 +01:00
Steffen Jaeckel
2e9f2b5e44
Merge pull request #319 from libtom/add/SIV
Add SIV
2025-01-09 13:36:02 +01:00
Steffen Jaeckel
ad2696f24f Update SIV a bit
* Rename `siv_{en,de}crypt()` to `siv_{en,de}crypt_memory()`.
* The number of AAD components per SIV operation must not exceed 126.
* Init OMAC only once per SIV operation.
  All OMAC operations start off with the same key. Instead of
  re-initializing the OMAC context for each operation, init once and
  store the context.
* Add SIV to timing demo.
* Add 1000-times-encrypt-then-decrypt test for SIV.
* Update docs.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-01-01 17:05:36 +01:00
Steffen Jaeckel
8bdc093fae Add omac_vprocess()
As a new private API.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-28 19:11:32 +01:00
Steffen Jaeckel
197be81918 Re-factor SIV and add siv_memory()
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-19 16:17:34 +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
faa8cd71e5 add SIV
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-17 18:24:26 +01:00
Steffen Jaeckel
c900951dab Fix c&p error [skip-ci]
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-17 18:24:16 +01:00
Steffen Jaeckel
a81dab9970
Merge pull request #678 from libtom/some-improvements 2024-12-11 18:24:46 +01:00
Steffen Jaeckel
f6e71dfced Remove even more footers
Fixes 2400883060

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-11 12:10:02 +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
795e8e8cfe Re-work some of the demos
* Add at least a `-h` option, sometimes more.
* Fix the exit codes of some of them.
* Make them all compile with `LTC_EASY`.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-11 11:09:58 +01:00
Steffen Jaeckel
d96605b4b9 Fix build on x32
* `CONSTPTR()` must be 32bit.
* `CRYPT_HASH_OVERFLOW` test operates on `unsigned long`, which is only
  32bit wide on x32.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-11 11:09:58 +01:00
Steffen Jaeckel
e487f8400e Introduce CRYPT_ERR_NUM and build-time check err_2_str[] size
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-11 11:09:58 +01:00
Steffen Jaeckel
507c66827f
Merge pull request #677 from libtom/some-improvements
Some improvements
2024-12-05 18:34:05 +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
a9bb1c1525 Use cmake-format to format CMake files
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-03 19:51:26 +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
9eef89c5a4 Cancel running GH action on update of PR branch
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-03 19:48:18 +01:00
Steffen Jaeckel
dc945f9697 Add LTC_PTHREAD to pkg-config file if enabled at build time
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-11-20 13:11:59 +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
Richard Levitte
6659f36ad6 Align demo/CMakeLists.txt a bit more with with makefile_include.mk
Now, they build the same executables.
2024-11-20 12:59:45 +01:00
Steffen Jaeckel
17642547e4
Merge pull request #676 from hughsie/hughsie/sbom
Add a SBOM file in CycloneDX format
2024-11-19 14:39:57 +01:00
Richard Hughes
55441f12d2
Add a SBOM file in CycloneDX format
Improve supply chain security by including a SBOM file with substituted values.

This will be used to construct a composite platform SBOM.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2024-11-19 12:28:13 +00:00
Steffen Jaeckel
5d2b15472f
Merge pull request #667 from levitte/constify-math
Constify math descriptors
2024-11-09 09:56:08 +01:00
Steffen Jaeckel
1d07689581 Remove unnecessary casts in the tests
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-11-08 17:15:39 +01:00
Richard Levitte
1e31c38e61 Remove unnecessary casts in the demos 2024-11-08 17:15:39 +01:00
Richard Levitte
4b3c98a4e6 Remove unnecessary casts in the misc implementations 2024-11-08 17:15:39 +01:00
Richard Levitte
b98ef26112 Remove unnecessary casts in the Sober128 implementation 2024-11-08 17:15:39 +01:00
Richard Levitte
fc32d77845 Remove unnecessary casts in the ECC implementation 2024-11-08 17:15:39 +01:00
Richard Levitte
477d09fd01 Remove unnecessary casts in the DSA implementation 2024-11-08 17:15:39 +01:00
Richard Levitte
7d3e6b7066 Remove unnecessary casts in the RSA implementation 2024-11-08 17:15:39 +01:00
Richard Levitte
e95069924a src/math/tfm_desc.c: Compensate for TFM before 0.14.0 (yet to be released)
TFM is notorious for not having a properly constified API.  This is to appear
in its next release, which is tentatively set to 0.14.0.
2024-11-08 17:15:39 +01:00
Richard Levitte
88315ff8df Constify all the functions in ltc_math_descriptor appropriately
This includes amending the documentation in doc/crypt.tex
This also includes removing unnecessary casts in src/math/*.c
2024-11-08 17:15:39 +01:00
Steffen Jaeckel
2dd6690edf
Merge pull request #674 from cmorty/pem_decode_filehandle
Add missing ifndef LTC_NO_FILE
2024-11-07 10:46:30 +01:00
Moritz Strübe
89d73ac405 Add missing ifndef LTC_NO_FILE
pem_decode_filehandle is deactiveted in the header, but not the module.
2024-11-06 15:35:29 +00:00
Steffen Jaeckel
d34f2130a6
Merge pull request #673 from cmorty/ltc_lrw_mode-macro
Add missing LTC_ prefix to LTC_LRW_MODE macro
2024-11-06 00:07:28 +01:00
Moritz Strübe
8daa79f85b Add missing LTC_ prefix to LTC_LRW_MODE macro
This also fixes the implicit declaration of function ‘gcm_gf_mult’
warning in lrw_start.c.
2024-11-04 14:36:19 +00:00
Steffen Jaeckel
cbb01b3708
Merge pull request #672 from libtom/some-fixes
Some fixes
2024-10-14 19:30:11 +02:00
Steffen Jaeckel
5a1545a8ae Ensure test buffers are always '\0' terminated
This caused spurious test failures.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-10-12 14:04:49 +02:00
Steffen Jaeckel
ebfcff3027 Fix handling of trailing spaces when decoding PEM files
Reported via [0].

[0] https://github.com/DCIT/perl-CryptX/issues/110#issuecomment-2407279713

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-10-12 14:04:49 +02:00
Steffen Jaeckel
31a48d06bf Const arrays should be const
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-10-12 14:04:49 +02:00
Steffen Jaeckel
c1437deec2 Fix hang when decoding PEM
Reported via [0]

[0] https://github.com/DCIT/perl-CryptX/issues/110#issue-2533207989

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-10-12 14:04:33 +02:00
Steffen Jaeckel
29af8922b6
Merge pull request #670 from libtom/fix-669
Fix type in PEM+SSH decoder
2024-10-07 12:42:12 +02:00
Steffen Jaeckel
3df7a96258 Fix type in PEM+SSH decoder
9b6bf32f88 changed the type of the length
argument of a `LTC_SSHDATA_STRING` from `ulong32` to `unsigned long` and
usage of this wrong type survived multiple re-factors and code moves.

This fixes #669

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-10-07 12:10:40 +02:00
Steffen Jaeckel
24fc92b857
Merge pull request #668 from levitte/pem-doc-fixes
Fix PEM documentation
2024-10-06 14:41:34 +02:00
Richard Levitte
2026e2865d Fix demos/pem-info.c to properly display different CFB modes
Also, make CMake build it.
2024-09-20 13:38:26 +02:00
Richard Levitte
dd3b9e59e1 Fix PEM documentation 2024-09-20 11:24:19 +02:00