Browse Source

after submission

Michele Orrù 7 years ago
parent
commit
8381b30881
4 changed files with 19 additions and 5 deletions
  1. 1 0
      Makefile.am
  2. 12 4
      configure.ac
  3. 5 0
      src/elgamal.c
  4. 1 1
      src/fbase.h

+ 1 - 0
Makefile.am

@@ -1,2 +1,3 @@
 SUBDIRS = src/
+#SUBDIRS += paper/
 AUTOMAKE_ARGS = --add-missing

+ 12 - 4
configure.ac

@@ -2,12 +2,16 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.65])
-AC_INIT([ccs], [0.1], [michele.orru@ens.fr])
-AM_INIT_AUTOMAKE
+AC_INIT([hss], [0.1], [michele.orru@ens.fr])
+
+
 AC_CONFIG_SRCDIR([src/rms.c])
 AC_CONFIG_HEADERS([src/config.h])
 
 # Checks for programs.
+
+AC_CHECK_TARGET_TOOL([latexmk], [latexmk], [no])
+#AS_IF([test "x$latexmk" = "xno"], [AC_MSG_ERROR([cannot find pdflatex.])])
 AC_PROG_CC([gcc clang cc])
 AC_PROG_CC_C99
 AC_PROG_RANLIB
@@ -33,6 +37,9 @@ AC_FUNC_ERROR_AT_LINE
 AC_FUNC_MALLOC
 #AC_CHECK_FUNCS([dup2 setlocale strdup])
 
+
+AM_INIT_AUTOMAKE
+
 # Clear out compiler/linker flags
 CFLAGS+=" -pedantic -Wall "
 
@@ -49,8 +56,9 @@ AC_ARG_ENABLE(debug,
 
 
 AC_DEFINE([ERROR],  [16], [log inverse of the error probability, default: 16.])
-AC_DEFINE([FB_BASE], [8], [log of precomputed base for group operation, default: 8.])
-AC_DEFINE([SS_BASE], [2], [log of secret shares representation, default: 1.])
+AC_DEFINE([FB_BASE], [10], [log of precomputed base for group operation, default: 8.])
+AC_DEFINE([SS_BASE], [1], [log of secret shares representation, default: 1.])
+
 
 AC_OUTPUT([Makefile
            src/Makefile

+ 5 - 0
src/elgamal.c

@@ -12,6 +12,11 @@ void elgamal_keygen(elgamal_key_t rop)
 {
   mpz_set_ui(rop->pk, 2);
 
+  /*
+     yes we know GMP's RNG is NOT cryptographically secure.
+     we laughed at the "random functions" page, too.
+     however a rng mod p is not really the point of this project is it?
+  */
   //  mpz_urandomm(rop->sk, _rstate, q);
   mpz_urandomb(rop->sk, _rstate, SK_SIZE);
   mpz_powm(rop->pk, rop->pk, rop->sk, p);

+ 1 - 1
src/fbase.h

@@ -6,7 +6,7 @@
 
 #include "group.h"
 
-#define FB_FRAMES (64/(FB_BASE))
+#define FB_FRAMES (64/(FB_BASE) + (64 % (FB_BASE) != 0))
 #define FB_MASK   ((1 << (FB_BASE)) - 1)
 
 typedef mpz_t        fbase_unit[1 << FB_BASE];