Skip to content

Commit

Permalink
updating readme to add gui doc and updating makefile to prepare for w…
Browse files Browse the repository at this point in the history
…indows
  • Loading branch information
Findeton committed Dec 24, 2014
1 parent 6d3c059 commit 8955666
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 7 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Now we can audit the ballot. On another console, execute the following command f

./agora-airgap download-audit ../example/ballot.json

As we mentioned earlier, you can also do the audit process in two steps. First to download the public key files, execute the following from the agora-airgap/src/x64.
As we mentioned earlier, you can also do the audit procedure in two steps. First to download the public key files, execute the following from the agora-airgap/src/x64.

./agora-airgap download ../example/ballot.json pk.file election_data.file

Expand All @@ -71,3 +71,11 @@ Afterwards, you can run the following command without the need of having the htt
In this case we will encrypt a plaintext ballot without the need of an internet connection. For that we need the public keys and the plaintext ballot files. The following command will encrypt the ballot and save it into the file encrypted_ballot.json. Execute it from the agora-airgap/src/x64 folder:

./agora-airgap encrypt ../example/votes.json ../example/pk_1 encrypted_ballot.json

## Graphic interface

There is a graphic interface for the audit procedure, available for linux 64 bits. Compile it executing the following command from the agora-airgap/src folder:

make gui

The audit graphic interface will be available in agora-airgap/src/x64/interface . If you want to move the program somewhere else don't forget to also copy/move the picture agora-airgap/src/x64/screen.png to the same folder.
32 changes: 27 additions & 5 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,33 +1,43 @@
OUTPUT := x64
OUTPUTW64 := w64

#INCSPATH := -Ilibjson
INCSPATH :=
INCSPATH := -I/usr/include/ -I/home/felix/workspace/libgmp/gmp-6.0.0/
LIBSPATH :=
#LIBS := -lgmpxx -lgmp -ljson
#LIBS := -lgmpxx -lgmp -ljson -I/usr/share/mingw-w64/include/
LIBS := -lgmpxx -lgmp -lcurl

OBJS := sha256.o ElGamal.o Random.o encrypt.o

WXX32 := i686-w64-mingw32-g++
WXX64 := x86_64-w64-mingw32-g++

all: build

build: $(OUTPUT) $(OBJS)
$(CXX) -DNDEBUG -g $(OUTPUT)/*.o main.cpp -o $(OUTPUT)/agora-airgap $(INCSPATH) $(LIBSPATH) $(LIBS)

.PHONY: build clean all run gui
.PHONY: build clean all run gui xcompile OBJSW64

clean:
rm -Rf $(OUTPUT)

%.o: %.cpp
$(CXX) -DNDEBUG -g -c $^ $(INCSPATH)
$(CXX) -DNDEBUG -g -c $^ $(INCSPATH) $(LIBSPATH) $(LIBS)
mv $@ $(OUTPUT)

$(OUTPUT):
mkdir -p $@

$(OUTPUTW64):
mkdir -p $@

$(OUTPUT)/screen.png:
cp screen.png $(OUTPUT)


$(OUTPUTW64)/screen.png:
cp screen.png $(OUTPUTW64)

run:
cd example && python -m SimpleHTTPServer & echo "$$!" > pid
sleep 1
Expand All @@ -38,4 +48,16 @@ run:
gui: $(OUTPUT) $(OUTPUT)/screen.png $(OBJS)
# `wx-config --libs` `wx-config --cxxflags`
$(CXX) -DNDEBUG -g $(OUTPUT)/*.o interface.cpp `wx-config --cxxflags --libs` -o $(OUTPUT)/interface $(INCSPATH) $(LIBSPATH) $(LIBS)


OBJSW64:
$(WXX64) -DNDEBUG -g -c sha256.cpp $(INCSPATH) $(LIBSPATH) $(LIBS)
$(WXX64) -DNDEBUG -g -c ElGamal.cpp $(INCSPATH) $(LIBSPATH) $(LIBS)
$(WXX64) -DNDEBUG -g -c Random.cpp $(INCSPATH) $(LIBSPATH) $(LIBS)
$(WXX64) -DNDEBUG -g -c encrypt.cpp $(INCSPATH) $(LIBSPATH) $(LIBS)
mv *.o $(OUTPUTW64)

xcompile: $(OUTPUTW64) $(OUTPUTW64)/screen.png OBJSW64
$(WXX64) $(XCOMPILEFLAGS) -DNDEBUG -g $(OUTPUTW64)/*.o interface.cpp `wx-config --cxxflags --libs` -o $(OUTPUTW64)/interface $(INCSPATH) $(LIBSPATH) $(LIBS)


2 changes: 1 addition & 1 deletion src/Random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ using namespace std;
#if defined(_WIN32) || defined(WIN32)
#include <iostream>
#include <windows.h>
#include <Wincrypt.h>
#include <wincrypt.h>
#endif

void Random::initState() {
Expand Down

0 comments on commit 8955666

Please sign in to comment.