Explorar el Código

Qualifying Questions' functions as static whenever possible.

Michele Orrù hace 11 años
padre
commit
6c2a4ca53e
Se han modificado 3 ficheros con 10 adiciones y 6 borrados
  1. 1 1
      src/questions/example.c
  2. 7 4
      src/questions/pollard.c
  3. 2 1
      src/questions/wiener.c

+ 1 - 1
src/questions/example.c

@@ -65,7 +65,7 @@ example_question_ask_crt(X509* cert)
 /**
  * \brief Example Attack on a RSA key.
  */
-RSA*
+static RSA*
 example_question_ask_rsa(const RSA *rsa)
 {
   return NULL;

+ 7 - 4
src/questions/pollard.c

@@ -32,7 +32,8 @@
 
 static BIGNUM *two;
 
-int pollard1_question_setup(void)
+static int
+pollard1_question_setup(void)
 {
   /* create 2 */
   two = BN_new();
@@ -41,7 +42,8 @@ int pollard1_question_setup(void)
   return 1;
 }
 
-int pollard1_question_teardown(void)
+static int
+pollard1_question_teardown(void)
 {
   BN_free(two);
   return 1;
@@ -60,7 +62,8 @@ int pollard1_question_teardown(void)
  * about 3^(−3) = 1/27 that a B value of n^(1/6) will yield a factorisation.»
  *
  */
-RSA* pollard1_question_ask_rsa(const RSA *rsa)
+static RSA*
+pollard1_question_ask_rsa(const RSA *rsa)
 {
   RSA *ret = NULL;
   BIGNUM *a, *B, *a1;
@@ -111,7 +114,7 @@ RSA* pollard1_question_ask_rsa(const RSA *rsa)
 }
 
 
-struct qa_question PollardQuestion = {
+qa_question_t PollardQuestion = {
   .name = "pollard1",
   .pretty_name = "Pollard's (p-1) factorization",
   .setup = pollard1_question_setup,

+ 2 - 1
src/questions/wiener.c

@@ -146,7 +146,8 @@ bigfraction_t* cf_next(cf_t *f)
 /*
  *  Weiner Attack Implementation
  */
-RSA* wiener_question_ask_rsa(const RSA *rsa)
+static RSA*
+wiener_question_ask_rsa(const RSA *rsa)
 {
   /* key data */
   RSA *ret = NULL;