Browse Source

the latest tfm version has fp_rand() available, so we can test this now

Steffen Jaeckel 8 years ago
parent
commit
fec05471ae
3 changed files with 12 additions and 9 deletions
  1. 4 3
      .travis.yml
  2. 0 5
      src/headers/tomcrypt_custom.h
  3. 8 1
      src/math/tfm_desc.c

+ 4 - 3
.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"

+ 0 - 5
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

+ 8 - 1
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,
 
 };