jschanck / ntru

Implementations of the NIST post-quantum cryptography process finalist NTRU.
https://ntru.org
Creative Commons Zero v1.0 Universal
41 stars 8 forks source link

File 'package_pqclean.sh' contains bad characters #16

Closed mouse07410 closed 4 years ago

mouse07410 commented 4 years ago

Fix below (tested):

diff --git a/package_pqclean.sh b/package_pqclean.sh
index 2aa1300..6d46a55 100755
--- a/package_pqclean.sh
+++ b/package_pqclean.sh
@@ -16,7 +16,7 @@ for PARAM in hrss701 hps2048509 hps2048677 hps4096821; do
   mkdir -p ${DIRNAME}/ntru${PARAM}/avx2
   mkdir -p ${DIRNAME}/ntru${PARAM}/clean

-  export NTRU_NAMESPACE=PQCLEAN_NTRU${PARAM^^}_AVX2_
+  export NTRU_NAMESPACE=PQCLEAN_NTRU${PARAM}_AVX2_
   ( cd ${WORKDIR}/avx2-${PARAM} && make -B asm )

   ( cd ${WORKDIR}/ref-${PARAM}/
jschanck commented 4 years ago

As the #!/bin/bash at the top of the file indicates, this is a bash script. And those are a bash feature. Search for ^^ on https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html.

mouse07410 commented 4 years ago

@jschanck I understand now what you tried to do with ^^, but unfortunately it didn't work on Mac and CentOS - just blew the script. Needless to say, I used bash on all of the platforms - fairly recent on Mac, and whatever version came with CentOS.

Perhaps what you tried to accomplish with that conversion, isn't worth breaking at least two platforms?

jschanck commented 4 years ago

OK, ^^ is newer than I thought. Fixed.

mouse07410 commented 4 years ago

Thanks!

FYI, on Mac I have bash v5.0.17 and 3.2.57 (system-provided), on CentOS - v4.4.19.