From fec05471aea0afed6ecf5ee1c8e10a64fe767260 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 22 Mar 2017 18:59:56 +0100 Subject: [PATCH 1/5] the latest tfm version has fp_rand() available, so we can test this now --- .travis.yml | 7 ++++--- src/headers/tomcrypt_custom.h | 5 ----- src/math/tfm_desc.c | 9 ++++++++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 86fade7..518ff1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ addons: packages: - binutils - libtommath-dev + - libtfm-dev before_script: - gem install coveralls-lcov @@ -22,9 +23,9 @@ branches: compiler: - gcc - clang - -script: bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" - +script: + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared" "-DUSE_TFM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtfm.so" env: - | BUILDSCRIPT="check_source.sh" diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index ce72015..1c9ebe0 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -492,11 +492,6 @@ #define LTC_PKCS_1 #endif -#if defined(TFM_DESC) && defined(LTC_RSA_BLINDING) - #warning RSA blinding currently not supported in combination with TFM - #undef LTC_RSA_BLINDING -#endif - #if defined(LTC_PELICAN) && !defined(LTC_RIJNDAEL) #error Pelican-MAC requires LTC_RIJNDAEL #endif diff --git a/src/math/tfm_desc.c b/src/math/tfm_desc.c index df4c63c..d8e09af 100644 --- a/src/math/tfm_desc.c +++ b/src/math/tfm_desc.c @@ -699,6 +699,13 @@ static int tfm_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R #endif +static int set_rand(void *a, int size) +{ + LTC_ARGCHK(a != NULL); + fp_rand(a, size); + return CRYPT_OK; +} + const ltc_math_descriptor tfm_desc = { "TomsFastMath", @@ -788,7 +795,7 @@ const ltc_math_descriptor tfm_desc = { &addmod, &submod, - NULL, + set_rand, }; From e2af986085aa3bb416a31d84572519f869925cfd Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 10 May 2017 19:23:31 +0200 Subject: [PATCH 2/5] make output verbose again --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 518ff1d..94b5ac2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,8 @@ compiler: - gcc - clang script: - - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile" "-DUSE_LTM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" - - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared" "-DUSE_TFM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtfm.so" + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared V=1" "-DUSE_TFM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtfm.so" env: - | BUILDSCRIPT="check_source.sh" From 104a451def1e64159cd7412f90bde59f4a6a5235 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 15:34:36 +0200 Subject: [PATCH 3/5] use packagecloud repo to install tfm --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 94b5ac2..b7a2536 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,12 +7,13 @@ addons: packages: - binutils - libtommath-dev - - libtfm-dev before_script: - gem install coveralls-lcov - curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz - export PATH=$PATH:`pwd`/lcov-1.11/bin + - curl -s https://packagecloud.io/install/repositories/libtom/tomsfastmath/script.deb.sh | sudo bash + - sudo apt-get install libtfm-dev=0.13-5 matrix: fast_finish: true From a9838f774578462de8e2c5dfe7f5dc90dfad72b7 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 15:58:19 +0200 Subject: [PATCH 4/5] fix linking to tomsfastmath & clean-up --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7a2536..20bf726 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,8 +25,8 @@ compiler: - gcc - clang script: - - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtommath.a" - - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared V=1" "-DUSE_TFM -DLTM_DESC -DTFM_DESC -I/usr/include" "/usr/lib/x86_64-linux-gnu/libtfm.so" + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC" "/usr/lib/x86_64-linux-gnu/libtommath.a" + - bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared V=1" "-DUSE_TFM -DTFM_DESC" "-ltfm" env: - | BUILDSCRIPT="check_source.sh" From f45f2f4faf803de6bb7ced5ceb402bd97d11ad36 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 12 Jun 2017 17:40:14 +0200 Subject: [PATCH 5/5] only create coverage for ltm build --- coverage.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/coverage.sh b/coverage.sh index 6686b44..d582f92 100755 --- a/coverage.sh +++ b/coverage.sh @@ -17,6 +17,11 @@ if [ -z "$(echo $CC | grep "gcc")" ]; then exit 0 fi +if [ "$(echo $2 | grep -v 'makefile[.]')" == "" ]; then + echo "only run coverage for the regular makefile, early exit success" + exit 0 +fi + # output version bash printinfo.sh