Commit Graph

574 Commits

Author SHA1 Message Date
Karel Miko
aeaa6d4a51 cygwin related fix - variable name B0 changed to B_0 (part 2) 2015-04-17 08:59:35 +02:00
Karel Miko
6a257e15cd cygwin related fix - variable name B0 changed to B_0 as it caused collision when compiling libtomcrypt as a perl module (for some reason only on cygwin) 2015-04-17 08:56:42 +02:00
Karel Miko
a8e91afb16 cygwin/64bit related fix - added !defined(__x86_64__) 2015-04-17 08:50:38 +02:00
Steffen Jaeckel
4981e2ab3f Merge pull request #61 from ulikoehler/reffix
Fix config file reference
2015-03-28 08:31:21 -04:00
Uli Köhler
d24e9cd32d Fix config file reference 2015-03-27 21:41:51 +01:00
Steffen Jaeckel
925f1ec0e6 Merge pull request #60 from pascal-brand-st-dev/memneq
Use XMEM_NEQ instead of mem_neq
2015-02-27 10:11:14 +01:00
Pascal Brand
f20b5daf39 Use XMEM_NEQ instead of mem_neq
mem_neq is no more used directly. XMEM_NEQ is used instead,
in the same way XMEMCMP, XMEMCPY,... are.

Signed-off-by: Pascal Brand <pascal.brand@st.com>
2015-02-27 08:54:30 +01:00
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
90e968a202 der_decode_subject_public_key_info: fix compile error
also make it possible to define min/max RSA key sizes externally

This closes #59
2015-02-15 16:32:12 +01:00
Saleem Abdulrasool
62878de0c5 adjust inline asm requiring constants
In order to ensure that the shift is within range, convert the inline assembly
routines into macros with compound statements.
2015-01-20 22:36:07 +01:00
Steffen Jaeckel
e9f9c6fa55 create a makefile.include
it contains all the preparation and targets for the static and shared lib
2015-01-20 22:36:07 +01:00
Steffen Jaeckel
0b6915740c saferp: enclose macros in do{}while(0) loop 2015-01-20 22:36:07 +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
b8bf2f13b8 Merge branch 'feature/const_memcmp' into develop
This closes #57
2015-01-20 22:35:44 +01:00
Steffen Jaeckel
46c038f7d4 adapt rsa_test() to modified pkcs#1 decoding routines 2014-11-13 22:30:07 +01:00
Steffen Jaeckel
1e9e98aa0d make pkcs#1 decode functions constant-time
as proposed in RFC 3447 only one error return code is used when there are
errors while decoding the pkcs#1 format.
also, all steps are executed and only the "output" is skipped if something
went wrong.

Sorry this could break backwards compatibility, since there's no more
BUFFER_OVERFLOW messaging.
Former error-handling code could also be affected because now there's only
OK as return code in cases where "res" is also set to '1'.
2014-11-13 22:26:59 +01:00
Steffen Jaeckel
e57c92fd23 replace calls to standard memcmp with constant memcmp where necessary 2014-11-13 22:09:45 +01:00
Steffen Jaeckel
d54425adb4 update makefiles 2014-11-13 22:09:20 +01:00
Steffen Jaeckel
26c5d54e5c add constant-time memcmp()
[skip ci]
2014-11-12 23:59:27 +01:00
Steffen Jaeckel
ddca3d6422 Merge branch 'pascal-brand-st-dev/ccm' into develop
This closes #55
2014-11-02 17:02:21 +01:00
Steffen Jaeckel
f2f8342c43 ccm test: add missing AAD 2014-11-02 17:01:56 +01:00
Steffen Jaeckel
943a858d6c also run testvectors on new CCM API
[skip ci]
2014-10-31 19:41:14 +01:00
Steffen Jaeckel
4efa27ead1 add missing pointer checks 2014-10-31 19:39:03 +01:00
Steffen Jaeckel
53917750d8 trim trailing spaces 2014-10-31 19:38:47 +01:00
Pascal Brand
992506cb49 Add incremental CCM authentication processing
CCM is only meant for packet mode where the length of the input is known in
advance. Since it is a packet mode function, CCM only had one function that
performs the protocol.

However, incremental authentication is usefull in some usecases. It also
ensure some kind of coherencies when processing with a given authentication
mode or another. To achieve this aim, this commit adds the following functions:
    ccm_init()
    ccm_add_aad()
    cm_add_nonce()
    ccm_process()
    ccm_done()
    ccm_reset()
as well as the data structure
    ccm_state

Change-Id: I5225a42bb098708c4af07518b561bb00f85bc243
2014-10-17 09:00:19 +02:00
Steffen Jaeckel
ed28703804 der_decode_sequence_multi: calm coverity 2014-10-10 01:07:58 +02:00
Steffen Jaeckel
e6b1c7101e der test: also run der_length_utf8_string() 2014-10-10 00:56:23 +02:00
Steffen Jaeckel
3ecdd29847 fix coverity script 2014-10-10 00:55:18 +02:00
Steffen Jaeckel
ee1631f8b3 dsa import: no output on stderr please 2014-10-06 19:00:50 +02:00
Steffen Jaeckel
f75b5ec8f4 der tests: improve/implement handling of context-specific data
no more "EOL" in the output as the flexi decoder handles now
context-specific data
2014-10-06 18:59:40 +02:00
Steffen Jaeckel
6da3b856d6 der test: print list-element details on EOL
EOL indicates an unitialized list-element
2014-10-06 18:57:42 +02:00
Steffen Jaeckel
6bd6319fb0 der flexi decoder: implement decoding of context-specific data 2014-10-06 18:57:42 +02:00
Steffen Jaeckel
2d8933e4f1 der: add new enum element for context-specific encodings 2014-10-06 18:57:42 +02:00
Steffen Jaeckel
f0a1235614 der flexi decoder: remove duplicate code 2014-10-06 18:57:41 +02:00
Steffen Jaeckel
3d1231ab15 der flexi decoder: improve CONSTRUCTED type decoding
remove all teh flags
save the entire original identifier
2014-10-06 17:51:25 +02:00
Steffen Jaeckel
2e426e2d57 der test: add example of decoding a X.509 v3 cert with the flexi decoder
you can define "LTC_DER_TESTS_PRINT_FLEXI" at compile time to print
the decoded cert whenn running the test executable...
well not all of it, since some parts of the cert are marked as
"context-specific" so we would need to do some further digging
...these are the parts that are output as "EOL"...
2014-09-30 17:57:53 +02:00
Steffen Jaeckel
c1e81ad469 minor changes
print MP_DIGIT_BIT when running test
der_test: improve error output of 'short integer' test
2014-09-30 13:26:18 +02:00
Steffen Jaeckel
1cc26da35c fix coverity script 2014-09-30 10:53:05 +02:00
Steffen Jaeckel
b1b3d5870f Merge branch 'feature/formatRsaDsa' into develop
This closes #50
2014-09-29 23:45:34 +02:00
Steffen Jaeckel
eea24fe2c0 bring back possibility to import/export old DSA key format 2014-09-29 23:44:47 +02:00
Steffen Jaeckel
f58c87866e add possibility to export RSA public key in SubjectPublicKeyInfo format 2014-09-29 23:44:47 +02:00
Steffen Jaeckel
b1f29539be Revert "removed testing of "stripped" rsa key"
This reverts commit 496453f289.
2014-09-29 23:44:47 +02: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
b3b93675f5 Merge branch 'feature/sha2t' into develop 2014-09-29 19:57:43 +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
06321b8602 update makefiles 2014-09-29 19:57:21 +02:00
Steffen Jaeckel
c58e2cae75 add special build rules for sha512/224 and sha512/256 2014-09-29 19:57:21 +02:00
Steffen Jaeckel
23fb224e19 add sha512/224 and sha512/256 2014-09-29 19:57:21 +02:00
Steffen Jaeckel
5ce0c7f70e Merge branch 'pascal-brand-st/xts' into develop
This closes #52
2014-09-29 19:47:44 +02:00
Steffen Jaeckel
3d905ca178 add testcase for multiple XTS encryption/decryption 2014-09-29 19:47:18 +02:00