summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python/.gitignore2
-rwxr-xr-xpython/compare.sh15
-rwxr-xr-xpython/generate-vectors.sh27
-rw-r--r--src/add_python/lilliput/__init__.py (renamed from python/lilliput/__init__.py)0
-rw-r--r--src/add_python/lilliput/constants.py (renamed from python/lilliput/constants.py)0
-rw-r--r--src/add_python/lilliput/helpers.py (renamed from python/lilliput/helpers.py)0
-rw-r--r--src/add_python/lilliput/lilliput_ae_1.py (renamed from python/lilliput/lilliput_ae_1.py)0
-rw-r--r--src/add_python/lilliput/lilliput_ae_2.py (renamed from python/lilliput/lilliput_ae_2.py)0
-rw-r--r--src/add_python/lilliput/multiplications.py (renamed from python/lilliput/multiplications.py)0
-rw-r--r--src/add_python/lilliput/tbc.py (renamed from python/lilliput/tbc.py)0
-rwxr-xr-xtest/python.sh11
-rwxr-xr-xtest/python/compare.sh17
-rw-r--r--test/python/crypto_aead.py (renamed from python/crypto_aead.py)0
-rwxr-xr-xtest/python/generate-vectors.sh31
-rwxr-xr-xtest/python/genkat_aead.py (renamed from python/genkat_aead.py)0
16 files changed, 60 insertions, 44 deletions
diff --git a/.gitignore b/.gitignore
index 7477fbe..bf4a44b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
crypto_aead
results
+__pycache__
*.tgz
diff --git a/python/.gitignore b/python/.gitignore
deleted file mode 100644
index d9aa5d4..0000000
--- a/python/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-__pycache__
-results \ No newline at end of file
diff --git a/python/compare.sh b/python/compare.sh
deleted file mode 100755
index 41f27b6..0000000
--- a/python/compare.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-# TODO: make sure reference crypto_aead exists
-# TODO: cleanup previous vectors and run genkat_aead.py
-
-set -eux
-
-mkdir -p results/crypto_aead_ref
-for d in ../../SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/crypto_aead/lilliputaei*
-do
- mkdir -p results/crypto_aead_ref/$(basename $d)
- cp $d/LWC*.txt results/crypto_aead_ref/$(basename $d)/
-done
-
-diff -ru results/crypto_aead_ref results/crypto_aead
diff --git a/python/generate-vectors.sh b/python/generate-vectors.sh
deleted file mode 100755
index 90b5840..0000000
--- a/python/generate-vectors.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-set -eu
-
-rm -rf results
-
-mkdir -p results/crypto_aead/lilliputae{i,ii}{128,192,256}v1
-
-declare -A names=([1]=lilliputaei [2]=lilliputaeii)
-
-for mode in 1 2
-do
- for keylen in 128 192 256
- do
- echo generating for ${mode} ${keylen}
-
- cat <<EOF > results/parameters.py
-MODE = ${mode}
-KEYBYTES = $((keylen/8))
-EOF
-
- PYTHONPATH=results ./genkat_aead.py
-
- dest=results/crypto_aead/${names[${mode}]}${keylen}v1
- mv LWC_AEAD_KAT_${keylen}_120.txt ${dest}
- done
-done
diff --git a/python/lilliput/__init__.py b/src/add_python/lilliput/__init__.py
index 5fbc0de..5fbc0de 100644
--- a/python/lilliput/__init__.py
+++ b/src/add_python/lilliput/__init__.py
diff --git a/python/lilliput/constants.py b/src/add_python/lilliput/constants.py
index 0c9b89f..0c9b89f 100644
--- a/python/lilliput/constants.py
+++ b/src/add_python/lilliput/constants.py
diff --git a/python/lilliput/helpers.py b/src/add_python/lilliput/helpers.py
index 8677f06..8677f06 100644
--- a/python/lilliput/helpers.py
+++ b/src/add_python/lilliput/helpers.py
diff --git a/python/lilliput/lilliput_ae_1.py b/src/add_python/lilliput/lilliput_ae_1.py
index 0da2a95..0da2a95 100644
--- a/python/lilliput/lilliput_ae_1.py
+++ b/src/add_python/lilliput/lilliput_ae_1.py
diff --git a/python/lilliput/lilliput_ae_2.py b/src/add_python/lilliput/lilliput_ae_2.py
index 61aa86e..61aa86e 100644
--- a/python/lilliput/lilliput_ae_2.py
+++ b/src/add_python/lilliput/lilliput_ae_2.py
diff --git a/python/lilliput/multiplications.py b/src/add_python/lilliput/multiplications.py
index c5f1e44..c5f1e44 100644
--- a/python/lilliput/multiplications.py
+++ b/src/add_python/lilliput/multiplications.py
diff --git a/python/lilliput/tbc.py b/src/add_python/lilliput/tbc.py
index 5291994..5291994 100644
--- a/python/lilliput/tbc.py
+++ b/src/add_python/lilliput/tbc.py
diff --git a/test/python.sh b/test/python.sh
new file mode 100755
index 0000000..ea23caf
--- /dev/null
+++ b/test/python.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -eu
+
+TEST_DIR=$(dirname $0)
+ROOT_DIR=${TEST_DIR}/..
+
+make -C ${ROOT_DIR} nist
+
+./python/generate-vectors.sh
+./python/compare.sh
diff --git a/test/python/compare.sh b/test/python/compare.sh
new file mode 100755
index 0000000..414eb1e
--- /dev/null
+++ b/test/python/compare.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+PYTHON_DIR=$(dirname $0)
+ROOT_DIR=${PYTHON_DIR}/../../
+RESULTS_DIR=${ROOT_DIR}/results
+CRYPTO_AEAD=${ROOT_DIR}/crypto_aead
+
+set -eu
+
+mkdir -p ${RESULTS_DIR}/crypto_aead_ref
+for d in ${CRYPTO_AEAD}/lilliputaei*
+do
+ mkdir -p ${RESULTS_DIR}/crypto_aead_ref/$(basename $d)
+ cp $d/LWC*.txt ${RESULTS_DIR}/crypto_aead_ref/$(basename $d)/
+done
+
+diff -ru ${RESULTS_DIR}/crypto_aead_ref ${RESULTS_DIR}/crypto_aead_py
diff --git a/python/crypto_aead.py b/test/python/crypto_aead.py
index 792369c..792369c 100644
--- a/python/crypto_aead.py
+++ b/test/python/crypto_aead.py
diff --git a/test/python/generate-vectors.sh b/test/python/generate-vectors.sh
new file mode 100755
index 0000000..e328c67
--- /dev/null
+++ b/test/python/generate-vectors.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+set -eu
+
+PYTHON_DIR=$(dirname $0)
+ROOT_DIR=${PYTHON_DIR}/../../
+SRC_DIR=${ROOT_DIR}/src/add_python
+RESULTS_DIR=${ROOT_DIR}/results
+CRYPTO_AEAD=${RESULTS_DIR}/crypto_aead_py
+
+mkdir -p ${CRYPTO_AEAD}/lilliputae{i,ii}{128,192,256}v1
+
+declare -A names=([1]=lilliputaei [2]=lilliputaeii)
+
+for mode in 1 2
+do
+ for keylen in 128 192 256
+ do
+ echo generating for ${mode} ${keylen}
+
+ cat <<EOF > ${RESULTS_DIR}/parameters.py
+MODE = ${mode}
+KEYBYTES = $((keylen/8))
+EOF
+
+ PYTHONPATH=${RESULTS_DIR}:${SRC_DIR} ${PYTHON_DIR}/genkat_aead.py
+
+ dest=${CRYPTO_AEAD}/${names[${mode}]}${keylen}v1
+ mv LWC_AEAD_KAT_${keylen}_120.txt ${dest}
+ done
+done
diff --git a/python/genkat_aead.py b/test/python/genkat_aead.py
index 01bed6f..01bed6f 100755
--- a/python/genkat_aead.py
+++ b/test/python/genkat_aead.py