]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - host/gf256_table_gen.c
clean up
[avr-crypto-lib.git] / host / gf256_table_gen.c
index 0d55db48f44acaa66954151ae676f1166129f436..395343a1574c9c35ff1c8b1294fabe8ed6bf013f 100644 (file)
@@ -1,6 +1,6 @@
 /* gf256_table_gen.c */
 /*
-    This file is part of the Crypto-avr-lib/microcrypt-lib.
+    This file is part of the AVR-Crypto-Lib.
     Copyright (C) 2008  Daniel Otte (daniel.otte@rub.de)
 
     This program is free software: you can redistribute it and/or modify
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <getopt.h>
-#include "gf256mul.h"
+#include "gf256mul/gf256mul.h"
 
 int print_header =  1,
     print_braces =  1,
@@ -58,6 +58,7 @@ void print_help(void){
 " -u max upper limit value for multiplication table (default: 255)\n"          
 " -f formatstring string for formating the output of a singel multiplicxation\n"
 " -o file outputfile\n"
+);
 }
                      
 int main(int argc, char** argv){
@@ -99,7 +100,7 @@ int main(int argc, char** argv){
        char** eptr;
        FILE* of = stdout;
        while(c!=-1){
-               c = getopt_long(argc, argv,"cCbBdhoaApPr:l:u:f:", 
+               c = getopt_long(argc, argv,"cCbBdh8aApPr:l:u:f:", 
                                long_options, &option_index);
                switch(c){
                        case 'c': print_header=1; break;
@@ -135,13 +136,16 @@ int main(int argc, char** argv){
                                          }
                                          break;
                        case 'f': fmt = optarg; break;
+                       case  -1: break;
                        case '?': 
                        default: 
+                               printf ("unknown option '%c' (%2.2X) !\n\t", c, c);
                                print_help();
+                               return 0;
                                break;
                }
        }
-       if(!reducer = ul_reducer&0xff){
+       if(!(reducer = ul_reducer&0xff)){
                        fprintf(stderr, "You must specify a reductionpolynomial!\n", argv[i]);
                        return -1;
        }