Commit Graph

2183 Commits

Author SHA1 Message Date
Steffen Jaeckel
5ce220fe02 fix unbalanced #ifdef for MIPS R5900
This fixes #562

[skip ci]
2024-02-18 17:02:06 +00:00
Steffen Jaeckel
33542d0a83 cast away cast-align warnings 2024-02-18 17:02:06 +00:00
Steffen Jaeckel
3e6ddfdcbd review CCM
* improve some comments
* harden some arguments
* fix the overflow warning

fixes #555, fixes #544
2024-02-18 17:02:06 +00:00
Steffen Jaeckel
9ffae6720c make sure that CTR->pad[] is aligned to 16 bytes
Fixes #549
2024-02-18 17:02:06 +00:00
Steffen Jaeckel
b2da51b518 clarify LTC_PAD_PKCS7 2024-02-18 17:02:06 +00:00
Steffen Jaeckel
489ca2699c add LTC_ALIGN() macro 2024-02-18 17:02:06 +00:00
Steffen Jaeckel
a0e47aac6b re-factor some tests 2024-02-18 17:02:06 +00:00
Steffen Jaeckel
90f0e0df80 make sure basic types are marked as UNIVERSAL&PRIMITIVE
This fixes DCIT/perl-CryptX#69
2024-02-18 17:02:06 +00:00
Biswapriyo Nath
115a689650 Makefile: Fix shared library build in MinGW.
This enables -no-undefined linker flag in mingw toolchain.
Previous related commit 9c2c9f8af4
2024-02-18 17:02:06 +00:00
James Muir
d5db9f1548 Add new utf8 test-vector, update comments explaining utf8 decoding
Description:
Minor changes to help test and clarify the way utf8 strings are
decoded.  This originated from my misunderstanding of the fix for
issue #507.  The new test-vector uses two bytes to encode each
wide-char.

The utf8 format is described here:

  https://tools.ietf.org/html/rfc3629#section-3

Testing:

  $ make clean
  $ make CFLAGS="-DUSE_LTM -DLTM_DESC -I../libtommath" EXTRALIBS="../libtommath/libtommath.a" test
  $ ./test

You can confirm that the new utf8 test data is correct using python:

  >>> s="\xD7\xA9\xD7\x9C\xD7\x95\xD7\x9D"
  >>> s.decode("utf-8")
  u'\u05e9\u05dc\u05d5\u05dd'
2024-02-18 17:02:06 +00:00
Steffen Jaeckel
2a4c731676 don't allow LTC_CLEAN_STACK to be enabled until fixed
As discussed in issue #486 [1] the current behavior shouldn't be used
anymore.

[1] https://github.com/libtom/libtomcrypt/issues/486
2024-02-18 17:02:06 +00:00
Steffen Jaeckel
bbeedb0751 update TEA testvectors 2024-02-18 17:02:06 +00:00
Steffen Jaeckel
49d6722fc3 fix tea_ecb_encrypt()
This fixes #553
2024-02-18 17:02:05 +00:00
Steffen Jaeckel
b48a724ba4 fix tea_test() 2024-02-18 17:02:05 +00:00
Steffen Jaeckel
6e3dc3379a make sure PKCS#5 iteration count is a "positive integer"
This fixes #552
2024-02-18 17:02:05 +00:00
Steffen Jaeckel
783b9f706d add check maketarget 2024-02-18 17:02:05 +00:00
Steffen Jaeckel
bff9a84ddd Exclude tests/test.key from potential crlf conversion
This closes #521
2024-02-18 17:02:05 +00:00
Steffen Jaeckel
64018dd683 add comment about padding types 2024-02-18 17:02:05 +00:00
Steffen Jaeckel
083ba719cf read system timer on AARCH64 2024-02-18 17:02:05 +00:00
Steffen Jaeckel
802907ba3f recent aesgcm versions have shorter iv/key strings 2024-02-18 17:02:05 +00:00
Steffen Jaeckel
5a31486a47 Fix returning too many or too few bits
original patch by @friedrichsenm

This closes #543
2024-02-18 17:02:05 +00:00
Tim Gates
f912a3ea3b docs: fix simple typo, succes -> success
There is a small typo in src/mac/f9/f9_test.c, src/mac/xcbc/xcbc_test.c.

Should read `success` rather than `succes`.
2024-02-18 17:02:05 +00:00
d059ecbbcb [*] LTC bug fixes. PR to upstream 2021-01-06 03:29:17 +00:00
20801f76d5 [+] Enable LTM
[-] Remove platform RNG
2021-01-06 01:09:19 +00:00
Steffen Jaeckel
cfbd7f8d36
Merge pull request #545 from libtom/pattop/fixes
Minor fix & cleanup
2020-08-29 11:30:23 +02:00
Patrick Oppenlander
d63d6faf22 sha256: minor undef cleanup
RND is #defined in both the #if and #else case, so move the #undef after
the #endif.
2020-08-17 09:54:14 +10:00
Patrick Oppenlander
40b9560521 HASH_PROCESS: fix overflow test
state_var.length counts bits, inlen is in bytes.
2020-08-17 09:44:21 +10:00
Steffen Jaeckel
3f1b6877c0
Merge pull request #541 from pattop/fixes
Minor dependency cleanups
2020-08-16 15:13:27 +02:00
Steffen Jaeckel
93ae347132 prevent usage of ifdef in code 2020-08-14 00:49:44 +02:00
Patrick Oppenlander
78f94225c8 error on missing dependencies for LTC_PBES and LTC_PKCS_5 2020-08-13 23:37:16 +02:00
Patrick Oppenlander
3a775da837 support compilation of x509 without LTC_MECC 2020-08-13 23:37:16 +02:00
Patrick Oppenlander
a5765d2b61 make ecc_ssh_ecdsa_encode_name conditional on LTC_SSH
This fixes build breakage when LTC_MECC is not defined:

src/pk/ecc/ecc_ssh_ecdsa_encode_name.c:20:74: error: unknown type name 'ecc_key'
   20 | int ecc_ssh_ecdsa_encode_name(char *buffer, unsigned long *buflen, const ecc_key *key)
2020-08-13 23:37:16 +02:00
Steffen Jaeckel
40eea675cd
Merge pull request #534 from libtom/pr/macro-names-cleanup
Clean up macro names and static functions
2020-08-03 14:01:42 +02:00
Steffen Jaeckel
469eeaf632 prefix static function in multi2 with s_
This fixes #540
2020-07-16 11:03:40 +02:00
Steffen Jaeckel
c5d7bfb2cc manually fix the remaining leading _'s 2020-07-16 10:38:33 +02:00
Steffen Jaeckel
373974edee Revert "rename according to currently still valid rules"
This reverts commit 561d4ab8e8.
2020-07-16 10:38:33 +02:00
Steffen Jaeckel
3447eaff53 also prefix static hash functions by s_ 2020-07-16 10:38:33 +02:00
Steffen Jaeckel
4fd7b5002d prefix static functions with s_ 2020-07-14 18:44:40 +02:00
Karel Miko
cb63d3c074 Fix macro names - related to #448 2020-07-14 18:44:38 +02:00
Karel Miko
89d991e946 add macro name check to helper.pl 2020-07-14 18:44:23 +02:00
Steffen Jaeckel
d8d7a83b34
Merge pull request #539 from libtom/relicense
Relicense
2020-07-14 18:42:24 +02:00
Steffen Jaeckel
3630bee6fc update LICENSE file 2020-07-14 18:41:30 +02:00
Steffen Jaeckel
9824af8e3b update header 2020-07-14 18:41:30 +02:00
Steffen Jaeckel
24765c30c5 remove footer 2020-07-14 18:41:29 +02:00
Steffen Jaeckel
6b85be4095
Merge pull request #533 from libtom/fix-373
really implement DER decoding resursion limit
2020-07-14 18:40:46 +02:00
Steffen Jaeckel
561d4ab8e8 rename according to currently still valid rules 2020-06-20 12:43:08 +02:00
Steffen Jaeckel
cac400cf79 really implement DER decoding resursion limit
PR #373 did not really fix the issue of preventing a potential stack
overflow in case a lot of nested sequences have to be decoded.
Instead it only threw an error after successfully decoding all the nested
sequences.
This change fixes this and prevents the decoding.
2020-06-20 12:28:22 +02:00
Steffen Jaeckel
14ed10c11f
Merge pull request #535 from libtom/fix-532
Add "memory" to clobber list of `STORE/LOAD32`
2020-05-08 14:01:59 +02:00
Frédéric Recoules
19c6e7942d Add "memory" to clobber list of STORE/LOAD32
c.f. cefff85550
2020-05-07 13:00:21 +02:00
Steffen Jaeckel
1937f41260
Merge pull request #523 from libtom/cleanup-hmac-state
remove unused `hashstate` from `hmac_state`
2019-11-22 12:03:27 +01:00