442 Commits

Author SHA1 Message Date
Steffen Jaeckel
ddb26a4276 hmac test: remove comments, prepare for extension 2014-02-16 18:41:33 +01:00
Steffen Jaeckel
2adca46735 pkcs#5: add tests for 'algo 2' 2014-02-16 18:41:33 +01:00
Steffen Jaeckel
e48838559b der_encode_setof: fix compiler warning when compiling for windows 64bit 2014-02-16 18:41:32 +01:00
Karel Miko
45dcbc654d fixing broken camellia 2014-02-16 18:41:31 +01:00
Steffen Jaeckel
d2c1329f77 camellia: add new testvector 2014-02-16 18:41:30 +01:00
karel-m
f3789b31b6 fixing warnings when compiling camellia.c with 64bit MS compiler 2014-02-16 18:41:30 +01:00
Steffen Jaeckel
3da9adc366 aes: remove compiler warning when compiled with ENCRYPT_ONLY 2014-02-16 18:41:29 +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
Steffen Jaeckel
b1b15910ed fix rng_get_bytes() when compiling with mingw-gcc 2013-10-15 10:17:17 +02:00
Steffen Jaeckel
bf1ccb629b fix rsa_sign_saltlen_get_max_ex() 2013-10-14 14:16:44 +02:00
Steffen Jaeckel
aacfec441e add rsa_sign_saltlen_get_max_ex() 2013-10-14 14:16:42 +02:00
Steffen Jaeckel
73c201da1f add rsa_get_size() 2013-10-14 14:16:41 +02:00
Steffen Jaeckel
fb65cd0772 fix clang compiler warnings 2013-10-02 01:03:40 +02:00
Steffen Jaeckel
a667a93d52 trim trailing spaces 2013-10-02 01:02:58 +02:00
Steffen Jaeckel
031e551c57 tomcrypt_custom.h: improve and clean-up
Add the possibility to define LTC_NOTHING that disables everything
Remove LTC_NO_MATH as it didn't do anything at all
Enable RSA blinding by default
2013-08-14 16:12:56 +02:00
Steffen Jaeckel
c0b8774cc1 move hkdf to misc 2013-08-14 15:47:07 +02:00
Steffen Jaeckel
bfcf1eb200 trim trailing spaces in header files 2013-03-22 15:15:05 +02:00
Steffen Jaeckel
2526d5df8f xtea: use correct load and store macros 2013-03-22 15:15:04 +02:00
Steffen Jaeckel
0f0b182610 xtea: add new testvectors 2013-03-22 15:15:04 +02:00
Steffen Jaeckel
fa7051c21e xtea: trim trailing spaces 2013-03-22 15:15:02 +02:00
Steffen Jaeckel
e531af7add ecc: fix compiler warnings 2013-03-22 15:14:44 +02:00
Steffen Jaeckel
14b3a5290e include stddef.h per default 2013-03-22 15:14:44 +02:00
Steffen Jaeckel
9203472789 dsa: fix compiler warning 2013-03-22 15:14:43 +02:00
Steffen Jaeckel
2addbcf315 noekeon: fix compiler warning 2013-03-22 15:14:42 +02:00
Steffen Jaeckel
6b5b35e6cc ocb3: don't zero ocb3 context in ocb3_{de,en}crypt_last 2013-03-20 18:10:51 +02:00
Karel Miko
c5c067fd12 ocb_init fix (preventing index overflow) 2013-03-15 13:30:40 +02:00
Karel Miko
9c2193b722 ocb3_init fix (preventing index overflow) 2013-03-15 13:30:39 +02:00
karel-m
abab7089a3 OCBv3 according http://tools.ietf.org/html/draft-krovetz-ocb-03 2013-03-15 13:30:29 +02:00
Larry Bugbee
8e22b17a8e fix define LTC_YARROW_AES 2013-03-15 12:24:00 +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
Steffen Jaeckel
21ddcf3568 fix multi2 as proposed by kmx 2012-11-18 18:44:14 +01:00
Steffen Jaeckel
8cda684a0e improved multi2_test() 2012-11-18 18:41:46 +01:00
Patrick Pelletier
5b662d6ed8 Fix some small typos in documentation 2012-11-18 15:24:15 +01:00
Patrick Pelletier
6dc089015a Fix LTC's bug in PI1/PI2 of Noekeon. Add vectors from BouncyCastle. 2012-11-18 15:24:13 +01:00
Patrick Pelletier
65254f65bf Fix camellia_keysize() to not change the keysize if it is correct.
It was rounding 32 down to 24, 24 down to 16, and claiming 16 was invalid.
2012-11-18 15:24:12 +01:00
Patrick Pelletier
e3acd4cabe Make GMP use uppercase to match LibTomMath. 2012-11-18 15:24:11 +01:00
Patrick Pelletier
3fbccfcb5c support base 64 for GMP 2012-11-18 15:24:11 +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
Patrick Pelletier
ad566e1b00 Use __builtin_bswap64 if it is available
This produces slightly better performance than the inline assembly,
and has the added benefit that it should be portable to other systems
that use gcc, not just x86-64.

Here are the results on my "AMD Athlon(tm) 7450 Dual-Core Processor"
with "gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3":

with portable 64H macros:

camellia            : Schedule at   1659
camellia            [ 23]: Encrypt at   431, Decrypt at   434
whirlpool           : Process at    55

with inline assembly (with "memory clobber" for correctness):

camellia            : Schedule at   1380
camellia            [ 23]: Encrypt at   406, Decrypt at   403
whirlpool           : Process at    50

with __builtin_bswap64:

camellia            : Schedule at   1352
camellia            [ 23]: Encrypt at   396, Decrypt at   391
whirlpool           : Process at    46
2012-11-18 15:20:12 +01:00