Browse Source

Updating despicable.c with the changes made on the cluster.

That's mainly documentation.
Michele Orrù 10 years ago
parent
commit
be9157b6c0
3 changed files with 24 additions and 7 deletions
  1. 12 0
      run_despicable.sh
  2. 4 3
      run_stranamore.sh
  3. 8 4
      src/despicable.c

+ 12 - 0
run_despicable.sh

@@ -0,0 +1,12 @@
+#!/bin/sh
+#PBS -V
+#PBS -N despicable
+#PBS -l nodes=120:ppn=4
+#PBS -l walltime=8:00:00
+#PBS -m bea
+#PBS -M michele.orru Ⓐ  studenti.unitn.it
+cd /home/michele.orru/bachelor-master/
+
+mpirun -hostfile $PBS_NODEFILE  ./src/despicable ukeys.ne.csv
+
+exit

+ 4 - 3
run_stranamore.sh

@@ -1,11 +1,12 @@
 #!/bin/sh
 #PBS -V
 #PBS -N stranamore
-#PBS -l nodes=200:ppn=4
+#PBS -l nodes=120:ppn=4
 #PBS -l walltime=10:00:00
 #PBS -m bea
-#PBS -M michele.orru Ⓐ  studenti.unitn.it
+#PBS -M michele.orru Ⓐ studenti.unitn.it
 cd /home/michele.orru/bachelor-master/
 
-mpirun -loadbalance -hostfile $PBS_HOSTFILE ./src/stranamore modules
+mpirun -hostfile $PBS_NODEFILE  ./src/stranamore modules
+
 exit

+ 8 - 4
src/despicable.c

@@ -1,15 +1,19 @@
 /**
- * \file donnie.c
+ * \file despicable.c
  * \brief Perform specific factorization attacks on the cluster.
  *
  *
- * For now, just using wiener, expecting a csv file composed of pairs <n, e>.
+ * Given a cvs file composed of public keys - pairs <n, e> - this file
+ * iteratively runs a pre-selected attack (see global var *question), eventually
+ * reporting broken keys to the standard output.
  */
 #include <openssl/rsa.h>
 #include <mpi.h>
 
 #include "qa/questions/questions.h"
-#include "qa/questions/qwiener.h"
+
+extern qa_question_t PollardQuestion;
+qa_question_t *question = &PollardQuestion;
 
 int next_pkey(RSA *pub, FILE *fp)
 {
@@ -42,7 +46,7 @@ int main(int argc, char **argv)
   rsa->e = BN_new();
   for (i=0; next_pkey(rsa, fp); i = (i+1) % procs) {
     if (i != proc) continue;
-    if (run_question(&WienerQuestion, NULL, rsa) == 1) {
+    if (run_question(question, NULL, rsa) == 1) {
       BN_print_fp(stdout, rsa->n);
       fprintf(stdout, "\t broken\n");
     }