Commit Graph

56 Commits

Author SHA1 Message Date
Steffen Jaeckel dfa938a4f6 verify outcome when defining LTC_NOTHING
check that LTC_NOTHING really creates nothing but the libraries' basic
API functions
2015-02-15 17:25:45 +01:00
Steffen Jaeckel 9782c09a3a use XMEM{CMP, CPY, SET} macros instead of standard versions 2015-01-20 22:36:06 +01:00
Steffen Jaeckel 26c5d54e5c add constant-time memcmp()
[skip ci]
2014-11-12 23:59:27 +01:00
Steffen Jaeckel 7842e338bf fix API of dynamic language helpers
it is easier to handle 'int' than 'long' in the foreign language
2014-09-29 23:30:02 +02:00
Steffen Jaeckel 1924e6fd47 add sha512/224 and sha512/256 to tests and crypt_build_settings 2014-09-29 19:57:21 +02:00
Steffen Jaeckel 67b9cd8a95 trim trailing spaces 2014-09-02 02:17:43 +02:00
Jonathan Herzog ff736a61bb Hash functions now check for input-length overflow.
Because many of the hash-functions implemented by LTC use the length
of the input when padding the input out to a block-length, LTC keeps
track of the input length in a 64-bit integer. However, it did not
previously test for overflow of this value. Since many of the
hash-functions implemented by LTC are defined for inputs of length
2^128 bits or more, this means that LTC was incorrectly implementing
these hash functions for extremely long inputs. Also, this might have
been a minor security problem: A clever attacker might have been able
to take a message with a known hash and find another message (longer
by 2^64 bits) that would be hashed to the same value by LTC.

Fortunately, LTC uses a pre-processor macro to make the actual code
for hashing, and so this problem could be fixed by adding an
overflow-check to that macro.
2014-08-06 19:06:00 +02:00
Steffen Jaeckel a8598b0faf fix unregister_prng() where always the first prng would have been removed 2014-08-05 17:47:50 +02:00
Steffen Jaeckel 155a54ba40 add LTC prefix to most macros 2014-07-17 10:50:36 +02:00
Steffen Jaeckel 1a61b42775 update output; remove unused define 2014-07-16 15:11:14 +02:00
Steffen Jaeckel 542ba9995c update math inititializers
make math initializer functions dependant on the xxx_DESC macro instead
of the USE_xxx macro, which is only relevant when building tests etc.
2014-07-15 15:38:18 +02:00
Steffen Jaeckel fc7eeac218 update/rework constants and sizes 2014-07-15 15:27:31 +02:00
Steffen Jaeckel fd7b3cd875 use snprintf() instead of sprintf() 2014-07-15 14:09:50 +02:00
Steffen Jaeckel e628fb9203 clean up/trim trailing spaces 2014-07-15 13:58:48 +02:00
Larry Bugbee a6b6884982 minor editorial changes 2014-07-14 15:47:20 +02:00
Larry Bugbee 46b6e36ea6 to know if LTC compiled big/little endian, 32/64-bit word 2014-07-14 15:47:20 +02:00
Larry Bugbee 1b29ce896f include compiler defines and other minor refinements 2014-07-14 15:47:20 +02:00
Steffen Jaeckel 8c488289f0 improve some error and informational output 2014-07-12 16:44:28 +02:00
Steffen Jaeckel b895f13484 minor changes/clean-up sources 2014-04-30 01:10:22 +02:00
Steffen Jaeckel 0aee5f3217 fix wrong spelled macros 2014-03-04 21:50:18 +01:00
Steffen Jaeckel 84298440f4 trim trailing spaces 2014-03-04 21:50:17 +01:00
Michael Stapelberg 8d7e3d8216 fix typo: s/Endianess/Endianness/ 2014-02-25 10:38:29 +01:00
Steffen Jaeckel 2adca46735 pkcs#5: add tests for 'algo 2' 2014-02-16 18:41:33 +01:00
Steffen Jaeckel 8e7777b554 trim trailing spaces/clean up 2014-02-16 18:41:28 +01:00
Steffen Jaeckel d78aa37c10 base64: add define LTC_BASE64_URL, make _internal functions static 2013-11-24 22:11:44 +01:00
Karel Miko 947fe41bbb Add URL safe base64 de-/encoding 2013-10-27 21:49:26 +02:00
Steffen Jaeckel 4f86ad7dcf hkdf: don't compile if not requested 2013-10-15 10:17:53 +02:00
karel-m abab7089a3 OCBv3 according http://tools.ietf.org/html/draft-krovetz-ocb-03 2013-03-15 13:30:29 +02:00
RyanC fe18c95e76 add the rest of the hkdf test cases 2013-03-15 11:16:17 +01:00
RyanC 11f50bfb3c fix hkdf_expand arguments 2013-03-15 11:16:17 +01:00
Steffen Jaeckel 1c779b88f1 moar debug output 2013-03-15 11:16:17 +01:00
Steffen Jaeckel c1243feef2 hkdf: improve argument validation 2013-03-15 11:16:16 +01:00
Steffen Jaeckel 13c42a00f6 hkdf: fix compiler warning 2013-03-15 11:16:16 +01:00
Steffen Jaeckel abeddd6c4b add hkdf_test() 2013-03-15 11:16:16 +01:00
RyanC c98857a47e add hkdf impl 2013-03-15 11:16:16 +01:00
Christopher Brown 2cb8c44113 der fixes and additions 2013-02-13 10:01:20 +01:00
Steffen Jaeckel 7050bdb7c8 use corrected version of zeromem() from @dtrebbien 2012-11-23 00:53:54 +01:00
Patrick Pelletier 382c9d4d85 Some fixes necessary to support the Clang compiler
First of all, it had a failure in SEED:

LTC_KSEED failed for x=0, I got:
expected    actual   (ciphertext)
     5e  ==  5e
     ba  ==  ba
     c6  ==  c6
     e0  ==  e0
     05  !=  00
     4e  !=  00
     16  !=  00
     68  !=  00
     19  ==  19
     af  ==  af
     f1  ==  f1
     cc  ==  cc
     6d  !=  00
     34  !=  00
     6c  !=  00
     db  !=  00

Since SEED uses the 32H macros, this is really analogous to the
problem I saw with the 64H macros in Camellia with gcc.  Not sure why
gcc only had a problem with 64H and not 32H, but since this is an
interaction with the optimizer, it's not going to happen every time
the macro is used (hence why the store tests pass; only when you get
into the complexity of a real cipher do you start having problems) and
it makes sense it will vary from compiler to compiler.

Anyway, I went ahead and added the ability to use __builtin_bswap32,
in addition to __builtin_bswap64, which I already did in a previous
commit.  This solves the problem for clang, although I had to add new
logic to detect the bswap builtins in clang, since it has a different
way to detect them than gcc (see the comments in the code).  The
detection logic was complicated enough, and applied to both the 32H
and 64H macros, so I factored out the detection logic into
tomcrypt_cfg.h.
2012-11-18 15:20:12 +01:00
Steffen Jaeckel 8859f6e73d fixed wrong return value interpretation of register_crypt/hash/prng function calls 2011-06-14 20:56:42 +02:00
Nikos Mavrogiannopoulos fa22e791d4 RSA and DSA public keys are stored using the SubjectPublicKeyInfo format. 2011-03-21 19:24:10 +01:00
Steffen Jaeckel 2f1fc7c50d import of libtomcrypt
out of
  lt_tree.tar.bz2
checksums of lt_tree.tar.bz2
MD5: 3c36e1ca95518f4d00a76dc9b7049952
SHA1: 4f31d1aa8cd1b9d7452b777cd52f8280dc7ebcbc
2010-06-16 19:58:20 +02:00
Tom St Denis bbc52b9e1b added libtomcrypt-1.17 2010-06-16 12:39:13 +02:00
Tom St Denis e24b01d392 added libtomcrypt-1.16 2010-06-16 12:39:09 +02:00
Tom St Denis 2de2976d25 added libtomcrypt-1.15 2010-06-16 12:39:06 +02:00
Tom St Denis 479cc9c261 added libtomcrypt-1.14 2010-06-16 12:39:03 +02:00
Tom St Denis 1eed98f629 added libtomcrypt-1.13 2010-06-16 12:39:00 +02:00
Tom St Denis 2945dea3e2 added libtomcrypt-1.12 2010-06-16 12:38:57 +02:00
Tom St Denis 64d7ebe166 added libtomcrypt-1.11 2010-06-16 12:38:54 +02:00
Tom St Denis 99b6d03203 added libtomcrypt-1.10 2010-06-16 12:38:51 +02:00
Tom St Denis a3ce807bae added libtomcrypt-1.09 2010-06-16 12:38:49 +02:00