Created
June 7, 2021 10:33
-
-
Save thomwiggers/626e74f6f5864e7100d158fc83769afd to your computer and use it in GitHub Desktop.
script to do namespacing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PREFIX="PQCLEAN_NTRUHPS2048509_AVX2_" | |
for symbol in $(nm -g lib*.a | grep -E ' (T|R) ' | cut -f3 -d' '); do | |
if [[ $symbol = $PREFIX* ]]; then | |
echo Already done $symbol | |
elif [[ $symbol = Keccak* ]]; then | |
echo "Don't need to do $symbol" | |
else | |
echo $symbol | |
perl -p -i -e "s/\\b$symbol\\b(?!\.[ch])/$PREFIX$symbol/g" *.[cSh] | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment