Implementation of the [Catalano-Fiore] CF13 scheme.
- gmp gmp The number library
- [libgcrypt] gcrypt For AES
- pinocchio pinocchio (Optional) For C to circuit compiler
- NTL NTL For FFT multiplication
To use the protocol there is the executable src/cf
. The following usages are available:
- Keygen:
./src/cf keygen [-n N_BITS -o KEY_FILE]
. This generates the key pair ofN_BITS
bits (defaults to 128). The evaluation key is stored inKEY_FILE.ek
and the secret key inKEY_FILE.sk
. - Message Authentication:
./src/cf auth -s KEY_FILE.sk -e KEY_FILE.ek -m MESSAGE -l LABEL [-o OUTFILE]
. Authenticates the messageMESSAGE
wrt labelLABEL
. It is possible to authenticate a single message, and in that caseMESSAGE
andLABEL
must be hexadecimal strings. To authenticate multiple messages at once,MESSAGE
andLABEL
must be files, where each line represent a message/label. The line count of both files must be the same. - Homomorphic Evaluation:
./src/cf eval -e KEY_FILE.ek -a AC_FILE -t TAGS [-o OUTFILE]
. Performs the homomorphic evaluation over the previously authenticated messages represented by theTAGS
file. The line count of this file must be exactly the same as the number of inputs of the Arithmetic Circuit represented inAC_FILE
. See the Arithmetic Circuits section for more information about them. The resulting tag should be written toOUTFILE
. - Verification:
./src/cf vrfy -s KEY_FILE.sk -e KEY_FILE.ek -m MESSAGE -a AC_FILE -l LABELS -t EVAL_TAG
. Verifies if theEVAL_TAG
obtained by a previous homomorphic evaluation is valid.MESSAGE
can either be the evaluated message (in hexadecimal format) or a file containg multiple messages (the number of messages in that file must be the same number of labels in theLABELS
file and the same number of inputs of the Arithmetic CircuitAC_FILE
) that are later evaluated by./src/cf
. In the end,TRUE
orFALSE
is printed on the screen. - Message Evaluation:
./src/cf msgeval [-e KEY_FILE.ek] -m MESSAGES -a AC_FILE [-o OUTFILE]
. Evaluates the messages inMESSAGES
file over the Arithmetic CircuitAC_FILE
. If the evaluation key is supplied, then operations are done modulop
.
In the test/
there are some tests to the protocol. To see which ones are
available run test/test --help
.
- Download the latest release from [codeplex] pinocchio
- It relies on python2
python2 ccompiler/src/aritheval.py AC_FILE INPUT_FILE OUTPUT_FILE
is the arithmetic circuit evaluator.
There are some helper scripts to generate random messages and labels.
- Generation of labels:
src/generator.py label N_LABELS N_BITS --out OUTFILE
. GeneratesN_LABELS
labels with exactlyN_BITS
each and stores them inOUTFILE
. - Generation of messages:
src/generator.py message N_MSGS MODULO --out OUTFILE
. GeneratesN_MSGS
messages moduloMODULO
and stores them inOUTFILE
.
These generated labels and messages can then be used as inputs to the CF protocol.
- Install
texlive2013
which includesxelatex
andlatexmk
- By default,
xelatex
(throughlatexmk
) is the default compiler. To change topdflatex
, just edit the$pdflatex
variable oftex/latexmkrc
. - To compile,
make pdf
. - Walk through
tex/Makefile
andtex/latexmkrc
if you wish to make further changes.