diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-03-13 18:03:10 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-03-13 18:03:10 +0100 |
| commit | 2bebfc0d0b77f586f77107d37cd6157e36f4420d (patch) | |
| tree | a5debe3e580cb2175deba12fdd5e74b49d854910 /nist/make-package.sh | |
| parent | ea7f29bb49ef3312c0bc22a3db2186c20162e09e (diff) | |
| parent | 590327c8d81e42079c1fb215512ff5f306d33ab0 (diff) | |
| download | lilliput-ae-implem-2bebfc0d0b77f586f77107d37cd6157e36f4420d.tar.xz | |
Merge branch 'implem-ti'
Diffstat (limited to 'nist/make-package.sh')
| -rwxr-xr-x | nist/make-package.sh | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/nist/make-package.sh b/nist/make-package.sh index 77c4057..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,29 +63,20 @@ 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 add_tweakeyloop ) 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 } |
