diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-03-12 15:33:15 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-03-12 17:36:12 +0100 |
| commit | f24a5cdcf0eec552f2d2edc73a7df156784ed7c0 (patch) | |
| tree | 4a4959fd2824f3f02a3debe90c804d2a7e76028a /nist/make-package.sh | |
| parent | f1bf4826bb5307a2677d44af6f8079b6cf0b3224 (diff) | |
| download | lilliput-ae-implem-f24a5cdcf0eec552f2d2edc73a7df156784ed7c0.tar.xz | |
Utilisation d'un générateur d'aléa pour l'implémentation à seuil
Un peu de machinerie à mettre en place pour permettre l'ajout de
fichiers arbitraires dans une implémentation.
Diffstat (limited to 'nist/make-package.sh')
| -rwxr-xr-x | nist/make-package.sh | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/nist/make-package.sh b/nist/make-package.sh index abd3b50..124da4b 100755 --- a/nist/make-package.sh +++ b/nist/make-package.sh @@ -1,6 +1,7 @@ #!/bin/bash set -Eeu +shopt -s extglob # Generate NIST's expected tree: # @@ -34,6 +35,25 @@ cleanup () trap cleanup ERR +list-implementation-files () +{ + local mode=$1 + local key_length=$2 + local implem=$3 + + # src/${implem} can contain arbitrary files; we need to copy + # everything save for the unused AE mode. + + local f + for f in ${ROOT}/src/${implem}/!(lilliput-i|lilliput-ii).[ch] + do + echo ${f} + done + + echo ${ROOT}/src/${implem}/lilliput-${mode}.c + echo ${ROOT}/src/${mode}-${key_length}/parameters.h +} + add-variant () { mode=$1 @@ -43,14 +63,6 @@ add-variant () mkdir -p ${dest} - source_files=( - cipher.{c,h} - constants.h - lilliput-ae{.h,-utils.h} - lilliput-${mode}.c - tweakey.{c,h} - ) - implementations=( ref add_threshold @@ -60,13 +72,11 @@ add-variant () for implem in ${implementations[@]} do mkdir ${dest}/${implem} - cp ${ROOT}/src/${mode}-${key_length}/parameters.h ${dest}/${implem} - cp ${NIST_DIR}/{api.h,encrypt.c} ${dest}/${implem} - for f in ${source_files[@]} - do - cp ${ROOT}/src/${implem}/${f} ${dest}/${implem} - done + list-implementation-files ${mode} ${key_length} ${implem} | + xargs cp -t ${dest}/${implem} + + cp ${NIST_DIR}/{api.h,encrypt.c} ${dest}/${implem} done } |
